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

Support for Date32 data type #100

Open
PJDuszynski opened this issue May 8, 2023 · 2 comments
Open

Support for Date32 data type #100

PJDuszynski opened this issue May 8, 2023 · 2 comments

Comments

@PJDuszynski
Copy link

R-Version: 4.2.2
RClickhouse Version: 0.6.7
Clickhouse Version: 23.3.2.37

Currently seems there is no support for the Date32 or Nullable(Date32) data types in the driver.

Reproducing:

  1. Create a table in clickhouse
create table default.test_table(
id int, date_32 Date32, date_32_null Nullable(Date32)
)
engine=MergeTree()
order by id
;

insert into default.test_table (id, date_32, date_32_null)
values (1, '1966-01-01'::Date32, Null);
  1. Run a select query in R on integer column, succeeds
DBI::dbGetQuery(pool::localCheckout(DW_POOL), "select id from default.test_table")
  id
1  1
  1. Run a select on either other column fails
> DBI::dbGetQuery(pool::localCheckout(DW_POOL), "select id, date_32 from default.test_table")
Error in select(conn@ptr, statement) : some data was not readed

DBI::dbGetQuery(pool::localCheckout(DW_POOL), "select id, date_32_null from default.test_table")
Error in select(conn@ptr, statement) : some data was not readed

dplyr::tbl(pool::localCheckout(DW_POOL), DBI::Id(schema="default", table="test_table"))
Error in fetch(res@ptr, n) : cannot read unsupported type: Void
@inkrement
Copy link
Member

Yes, there is no support for these data types (Date32 and Datetime64). The reason is that they were added relatively recently, and we did not have time yet to add them. Meanwhile, you can convert them to timestamps (Seconds/Milliseconds since 1970) and transfer them as unsigned integers.

@PJDuszynski
Copy link
Author

Thanks for the workaround!

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

2 participants