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

SQL translate issues #5

Open
mdsumner opened this issue Oct 27, 2020 · 0 comments
Open

SQL translate issues #5

mdsumner opened this issue Oct 27, 2020 · 0 comments

Comments

@mdsumner
Copy link
Member

mdsumner commented Oct 27, 2020

Laundry list

paste() not available for GDB

What's the OGRSQL concat?

 transmute(adddress = paste(ST_NO_FROM, STREET))
Error in CPL_read_ogr(dsn, layer, query, as.character(options), quiet,  : 
  Query execution failed, cannot open layer.
In addition: Warning message:
In CPL_read_ogr(dsn, layer, query, as.character(options), quiet,  :
  GDAL Error 1: Undefined function 'CONCAT_WS' used.

It's CONCAT
works with transmute(), and mutate() but not with select()

 transmute(address = CONCAT(LOCALITY, STREET))

so this works

 sf::read_sf(files$fullname[1], query = "SELECT CAST(ST_NO_FROM AS character(255)) FROM list_address_points_statewide WHERE LOCALITY = 'Glenora'")

but this does not, I think because it requires a subquery and we can't

lazysf(files$fullname[1], sql("SELECT CAST(ST_NO_FROM AS character(255)) FROM list_address_points_statewide WHERE LOCALITY = 'Glenora'")) 
Error in CPL_read_ogr(dsn, layer, query, as.character(options), quiet,  : 
  Query execution failed, cannot open layer.
In addition: Warning message:
In CPL_read_ogr(dsn, layer, query, as.character(options), quiet,  :
  GDAL Error 1: SQL Expression Parsing Error: syntax error, unexpected '(', expecting string or identifier. Occurred around :
SELECT *
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