Search code examples
rdplyrdbplyr

dplyr function compute() failed, ParseException but other functions works


I tried to use dplyr with the version 1.1.2, 1.1.1, 1.1.0 and it works fine for the functions in packages except for the compute().

I'm not good with R and didn't find many code examples explained clearly how the compute() function work.

Here some code I tried but failed:

test <- df_select_20 %>% filter(quality >= 5) %>% select(chlorides:quality) %>% ungroup() %>% compute(name="new_tmp_view")

which is for a dataframe of wine quality in opensource. I might not use it correctly but here the error log I got:

Error in db_save_query.DBIConnection():
! Can't save query to "dbplyr_002".
Caused by error:
! org.apache.spark.sql.catalyst.parser.ParseException:
no viable alternative at input 'CREATE OR REPLACE TEMPORARY VIEW \n"dbplyr_002"'(line 2, pos 0)

== SQL ==
CREATE OR REPLACE TEMPORARY VIEW
"dbplyr_002" AS SELECT *
^^^
FROM sparklyr_tmp_275a91a3_e06b_44e4_a469_f3593c483a2d

Thank.

I tried different version of the packages, 1.1.2, 1.1.1 and 1.1.0 because some colleague got it working before but not anymore.

I tried with the x param of compute(x) with dataframe or query but I still had error.


Solution

  • The solution that works waschanging the version of the package dbplyr from 2.3.3 to 2.3.1 thanks to IceCreamToucan response.