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

Case sensitivity when translating to SQL #181

Closed
krlmlr opened this issue Nov 5, 2018 · 1 comment · Fixed by #220
Closed

Case sensitivity when translating to SQL #181

krlmlr opened this issue Nov 5, 2018 · 1 comment · Fixed by #220
Labels
bug an unexpected problem or unintended behavior help wanted ❤️ we'd love your help! tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day verb trans 🤖 Translation of dplyr verbs to SQL
Milestone

Comments

@krlmlr
Copy link
Member

krlmlr commented Nov 5, 2018

Some SQL functions may be case-sensitive, for instance spatial methods in MSSQL. The syntax is a bit weird, e.g. colname.STBuffer(1) for STBuffer(), the call COLNAME.STBUFFER(1) fails.

library(tidyverse)
library(dbplyr)
memdb_frame(a = 1) %>%
  mutate(x = a.STBuffer(1)) %>%
  sql_render()
#> <SQL> SELECT `a`, A.STBUFFER(1.0) AS `x`
#> FROM `opozhizxky`

Created on 2018-11-05 by the reprex package (v0.2.1.9000)

(This example works identically with MSSQL, using SQLite for the reprex.)

What's the reason for converting all function calls to uppercase?

@krlmlr krlmlr mentioned this issue Nov 5, 2018
@hadley hadley added bug an unexpected problem or unintended behavior verb trans 🤖 Translation of dplyr verbs to SQL help wanted ❤️ we'd love your help! labels Jan 2, 2019
@hadley
Copy link
Member

hadley commented Jan 2, 2019

Probably no good reason, except my sense of SQL aesthetics (which is clearly wrong here).

I suspect this would be an easy fix for someone; should just require searching for toupper() and removing the inappropriate ones.

@batpigandme batpigandme added the tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day label Jan 8, 2019
@hadley hadley added this to the v1.4.0 milestone Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior help wanted ❤️ we'd love your help! tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day verb trans 🤖 Translation of dplyr verbs to SQL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants