Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

as.numeric in sparkSQL #32

Open
wush978 opened this issue Oct 28, 2015 · 0 comments
Open

as.numeric in sparkSQL #32

wush978 opened this issue Oct 28, 2015 · 0 comments

Comments

@wush978
Copy link

wush978 commented Oct 28, 2015

Under dplyr v 0.4.3, the as.numeric might fail.

After executing the following R script:

dplyr::group_by(df, day) %>%
  dplyr::summarise(imp = count(adid), clk = mean(as.numeric(is_click))) %>%
  dplyr::collect()

R will raise an error from spark: (org.apache.spark.sql.AnalysisException: cannot recognize input near 'numeric' ')' ')' in primitive type specification;

I fixed this issue according to https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types#LanguageManualTypes-NumericTypes in bridgewell/dplyrSparkSQL@781fba1 . It seems that this package does not add these customized translator (

src_translate_env.src_SparkSQL =
)

Hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant