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

Adds Hive subclass and dbQuoteString method for it #424

Merged
merged 9 commits into from Feb 25, 2021
Merged

Adds Hive subclass and dbQuoteString method for it #424

merged 9 commits into from Feb 25, 2021

Conversation

rnorberg
Copy link
Contributor

Hive uses C-style escape for string literals, so a single-quote inside a string literal should be replaced with \' and not '' (as is currently the case). See #184 for details.

Hive uses C-style escape for string literals, so a single-quote inside a string literal should be replaced with `\'` and not `''` (as is currently the case). See #184 for details.
Hive subclass with dbQuoteString, odbcListColumns methods
`setMethod("dbQuoteString", "Hive", ...)` ends up still dispatching to `DBI:::quote_string` - you need to specify the signature for both `con` and `x`.
will never dispatch to this method if `x` is not of class `character`, so no need for that check
so I backslash-escaped the backslash-escaped backslash

`DBI::SQL(paste0("'", gsub("'", "\\\\'", "it's"), "'"))` returns `<SQL> 'it\'s'`, which is what we want
@jimhester
Copy link
Contributor

It looks like you are missing documentation for the new methods, which is why the checks are failing. e.g. https://github.com/r-dbi/odbc/pull/424/checks?check_run_id=1619012948#step:10:74

@jimhester
Copy link
Contributor

/document

@jimhester
Copy link
Contributor

Thanks!

@jimhester jimhester merged commit 6fa48eb into r-dbi:master Feb 25, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants