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 new Datatypes #79

Open
4 tasks
tridelt opened this issue Jan 29, 2021 · 7 comments
Open
4 tasks

Support new Datatypes #79

tridelt opened this issue Jan 29, 2021 · 7 comments

Comments

@tridelt
Copy link
Collaborator

tridelt commented Jan 29, 2021

New Datatypes to be added

  • Decimals
  • IPv4

Enhancements

  • improve templating design
  • add option to create nullable columns by default
@Lupus
Copy link

Lupus commented Feb 2, 2021

There is also missing support for IPv4. Just stumbled upon this type in my CH database and RClickhouse refused to select it...

@tridelt
Copy link
Collaborator Author

tridelt commented Feb 2, 2021

There is also missing support for IPv4. Just stumbled upon this type in my CH database and RClickhouse refused to select it...

@Lupus thank you very much for your suggestion, it has been added to the todos

@eternityowo
Copy link

Can you add support for u\int128, u\int256?
And custom mapping Array to vector with padding (if the array is of variable length)?

@inkrement
Copy link
Member

Since R does not directly support bigger integer values, u\int128 and u\int256 are not that easy to implement. We would have to rely on additional packages. We'll re-evaluate existing packages and check if it is feasible.

@zhixue-luo
Copy link

zhixue-luo commented May 10, 2023

There still seems to be some problems with decimals for me:

> t_sale_details <- tbl(con, "T_SALE_D")

Error in `dplyr::db_query_fields()`:
! Can't query fields.
Caused by error in `fetch()`:
! cannot read unsupported type: Decimal(18,6)

@inkrement
Copy link
Member

Indeed, Decimals, especially those with custom precision, are not yet supported. There is no native R type that would fit reasonably well, but there are some third-party packages. Suppose your analyses heavily rely on these data types. In that case, I recommend doing most of these calculations directly in SQL and using other data types (e.g., floats) if possible. In the long run, we'll add support based on third-party packages.

@zhixue-luo
Copy link

Indeed, Decimals, especially those with custom precision, are not yet supported. There is no native R type that would fit reasonably well, but there are some third-party packages. Suppose your analyses heavily rely on these data types. In that case, I recommend doing most of these calculations directly in SQL and using other data types (e.g., floats) if possible. In the long run, we'll add support based on third-party packages.

Thanks for your reply! Due to permission issues, I can't modify the data type directly. Doing calculations directly in SQL is a feasible approach. But luckily, I have tried another solution that might be better, ODBC, which means you may need to install the ODBC driver first. For more specific details, see the Posit Solutions. Hope this helps people who have the same difficulties as me. : )

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

5 participants