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

translation of paste not working for Redshift query #458

Closed
dsen6644 opened this issue May 15, 2020 · 2 comments
Closed

translation of paste not working for Redshift query #458

dsen6644 opened this issue May 15, 2020 · 2 comments
Labels
feature a feature request or enhancement func trans 🌍 Translation of individual functions to SQL

Comments

@dsen6644
Copy link

paste() is translated as concat_ws which is not a function in redshift. It uses either the concat function or the || operator. Similiar issue to #155 .

df %>% mutate(month_year = paste(year, month))

#> Error in new_result(connection@ptr, statement, immediate): nanodbc/nanodbc.cpp:1374: 00000: [Amazon][Amazon Redshift] (30) Error occurred while trying to execute a query: [SQLState 42883] ERROR:  function concat_ws("unknown", character varying, character varying) does not exist
#> HINT:  No function matches the given name and argument types. You may need to add explicit type casts.
#> 
@cmohamma
Copy link

cmohamma commented Sep 4, 2020

I too am experiencing this issue!

@hadley
Copy link
Member

hadley commented Sep 16, 2020

Some discussion at SO: https://stackoverflow.com/questions/56708136/postgres-9-1s-concat-ws-equivalent-in-amazon-redshift

Probably simplest is to override paste(), paste0(), and str_c() to use infix ||.

@hadley hadley added feature a feature request or enhancement func trans 🌍 Translation of individual functions to SQL labels Sep 16, 2020
@hadley hadley closed this as completed in 175af9c Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement func trans 🌍 Translation of individual functions to SQL
Projects
None yet
Development

No branches or pull requests

3 participants