{"action":"opened","issue":{"url":"https://api.github.com/repos/rstudio/sparklyr/issues/313","repository_url":"https://api.github.com/repos/rstudio/sparklyr","labels_url":"https://api.github.com/repos/rstudio/sparklyr/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/sparklyr/issues/313/comments","events_url":"https://api.github.com/repos/rstudio/sparklyr/issues/313/events","html_url":"https://github.com/rstudio/sparklyr/issues/313","id":187799751,"number":313,"title":"sparklyr als getting a java.lang.NullPointerException error when predicting","user":{"login":"blacknred0","id":10933631,"avatar_url":"https://avatars.githubusercontent.com/u/10933631?v=3","gravatar_id":"","url":"https://api.github.com/users/blacknred0","html_url":"https://github.com/blacknred0","followers_url":"https://api.github.com/users/blacknred0/followers","following_url":"https://api.github.com/users/blacknred0/following{/other_user}","gists_url":"https://api.github.com/users/blacknred0/gists{/gist_id}","starred_url":"https://api.github.com/users/blacknred0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blacknred0/subscriptions","organizations_url":"https://api.github.com/users/blacknred0/orgs","repos_url":"https://api.github.com/users/blacknred0/repos","events_url":"https://api.github.com/users/blacknred0/events{/privacy}","received_events_url":"https://api.github.com/users/blacknred0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-07T19:08:38Z","updated_at":"2016-11-07T19:08:38Z","closed_at":null,"body":"Hi - \r\nNot sure if this is an issue from my side or not.  I am currently trying to use ALS Matrix Factorization [http://spark.rstudio.com/reference/sparklyr/latest/ml_als_factorization.html](url) in sparklyr (v0.4) with R 3.3.2 (Sincere Pumpkin Patch) on *nix (Mac and Linux).  I am also using Apache Spark compile version 2.0.1 with hadoop 2.7.\r\n\r\nI found this issue [https://github.com/rstudio/sparklyr/issues/139](url) which it was fixed, but it doesn't seem to work on my particular case, not sure why.  The file that I am using does not have null/NA/blanks values (since I am using spark-2.0.1-bin-hadoop2.7/data/mllib/als/test.data)\r\n\r\nHere is the code that I am using\r\n\r\n``` R\r\nlibrary(sparklyr)\r\nlibrary(dplyr)\r\n\r\nsc <- spark_connect(master = \"local\", config = spark_config())\r\ntest <- read.table('~/Applications/spark-2.0.1-bin-hadoop2.7/data/mllib/als/test.data', \r\n   header = FALSE, sep = ',')\r\n\r\ntest_tbl <- copy_to(sc, test, overwrite = TRUE)\r\nals_model <- test_tbl %>%\r\n  ml_als_factorization(user.column = \"V1\", item.column = \"V2\", rating.column = \"V3\", \r\n  rank = 10L, regularization.parameter = 0.01, iter.max = 10L, ml.options = ml_options())\r\npredictions = als_model$.model %>% invoke(\"transform\", spark_dataframe(test_tbl))\r\n#sdf_predict(als_model, test_tbl)\r\nsdf_predict(predictions, test_tbl) %>%\r\n  collect\r\nspark_disconnect(sc)\r\n```\r\n\r\nerror\r\n`Error: java.lang.NullPointerException\r\n\tat scala.collection.immutable.StringOps$.length$extension(StringOps.scala:47)\r\n\tat scala.collection.immutable.StringOps.length(StringOps.scala:47)\r\n\tat scala.collection.IndexedSeqOptimized$class.isEmpty(IndexedSeqOptimized.scala:27)\r\n\tat scala.collection.immutable.StringOps.isEmpty(StringOps.scala:29)\r\n\tat scala.collection.TraversableOnce$class.nonEmpty(TraversableOnce.scala:111)\r\n\tat scala.collection.immutable.StringOps.nonEmpty(StringOps.scala:29)\r\n\tat org.apache.spark.ml.attribute.AttributeGroup.<init>(AttributeGroup.scala:42)\r\n\tat org.apache.spark.ml.attribute.AttributeGroup.<init>(AttributeGroup.scala:65)\r\n\tat org.apache.spark.ml.feature.VectorAssembler.transform(VectorAssembler.scala:95)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.\r\n`\r\n\r\nThanks for your help in advance"}}
{"actor":{"display_login":"blacknred0"}}