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

Adding support for Impala data types. #39

Merged
merged 6 commits into from
Mar 22, 2017
Merged

Adding support for Impala data types. #39

merged 6 commits into from
Mar 22, 2017

Conversation

edgararuiz-zz
Copy link

Impala does not have a date type so mapping it to varchar

@jimhester
Copy link
Contributor

jimhester commented Mar 22, 2017

From Magnitude's documentation it does look like there is a DATE type, and looks like STRING should be CHAR?

screenshot 2017-03-22 08 28 13

I just pushed a commit (ef071fd) that exposes a test_roundtrip() function, which will try to roundtrip a data frame with all of the data types supported by the odbc package. Could you try impala with that to verify this method is correct for all data types? It is un-exported so you will need to use odbc:::test_roundtrip(con) to run it.

@edgararuiz-zz
Copy link
Author

Here's the article that discusses the differences between HiveQL and Impala: https://www.cloudera.com/documentation/enterprise/5-8-x/topics/impala_langref_unsupported.html#langref_hiveql_unsupported

@edgararuiz-zz
Copy link
Author

Test results:

Error: Test failed: '[Impala] round tripping data.frames works' * <SQL> 'CREATE TABLE `it` ( `datetime` TIMESTAMP, `date` DATE, `binary` BINARY, `integer` INTEGER, `double` DOUBLE, `character` VARCHAR(255), `logical` VARCHAR(5) ) ' nanodbc.cpp:1587: HY000: [RStudio][ImpalaODBC] (110) [HY000] : ImpalaRuntimeException: CAUSED BY: InvalidObjectException: Invalid column type: invalid_type 1: DBI::dbWriteTable(con, "it", it, overwrite = TRUE) 2: DBI::dbWriteTable(con, "it", it, overwrite = TRUE) 3: .local(conn, name, value, ...) 4: dbGetQuery(conn, sql) 5: dbGetQuery(conn, sql) 6: dbSendQuery(conn, statement, ...) 7: dbSendQuery(conn, statement, ...) 8: OdbcResult(connection = conn, statement = statement) 9: new_result(connection@ptr, statement)

@jimhester jimhester reopened this Mar 22, 2017
@jimhester jimhester merged commit 201a1e1 into r-dbi:master Mar 22, 2017
@jimhester
Copy link
Contributor

Thanks Edgar!

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

3 participants