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

copy_to is adding extra " to table name #272

Open
willshen99 opened this issue Oct 24, 2024 · 1 comment
Open

copy_to is adding extra " to table name #272

willshen99 opened this issue Oct 24, 2024 · 1 comment

Comments

@willshen99
Copy link

willshen99 commented Oct 24, 2024

I am creating a Trino table from a select statement on another Trino table. It renders the wrong sql script which adds extra " wrapping the table name.

httr::set_config(
  httr::config(
    httpauth=1,
    userpwd='user:password',
    ssl_verifypeer=0
  )
)

con = DBI::dbConnect(
  drv = RPresto::Presto(),
  host="https://trinohost",
  port=8443,
  user=user,
  password=password,
  catalog="hive",
  schema=my_schema,
  bigint="numeric"
)

person <- dplyr::tbl(con, "person")

dplyr::copy_to(dest = con, df = person, name = "person_new")

The sql it renders:

CREATE TABLE """person_new""" AS SELECT * FROM "person"

The table_name got created is "person_new" instead of person.

dplyr::tbl(con,'person')  # failed
dplyr::tbl(con,'"person_new"') # succeed

Version:

Browse[1]> packageVersion('RPresto')
[1] ‘1.4.6’
Browse[1]> packageVersion('dbplyr')
[1] ‘2.5.0’
Browse[1]> packageVersion('DBI')
[1] ‘1.2.2’
Browse[1]> packageVersion('dplyr')
[1] ‘1.1.4’
@willshen99
Copy link
Author

Seems a compatibility issue with dbplyr 2.5.0. It works fine after I downgrade dbplyr to 2.4.0

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