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

Numeric columns are converted to varchar upon import from PostgresQL #6186

Open
nvennin opened this issue Nov 28, 2024 · 2 comments
Open

Numeric columns are converted to varchar upon import from PostgresQL #6186

nvennin opened this issue Nov 28, 2024 · 2 comments
Labels
Type:Bug Something isn't working

Comments

@nvennin
Copy link

nvennin commented Nov 28, 2024

Describe the bug
When importing a view from a postgres database (hosted with supabase), columns that are fixed precision digits (numeric) are imported as varchar. I would expect them to be imported as duckdb numeric type.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Sources
  2. Create a model that pulls from a postgres database, containing numeric columns (see example below)
# Source YAML
# Reference documentation: https://docs.rilldata.com/reference/project-files/sources

type: source

connector: "postgres"
database_url: "postgresql://[email protected]:5432/postgres"
sql: "select line_amount_eur::real as value_real, line_amount_eur::numeric as value_numeric from analysis.sales_order_lines sol limit 10;"
  1. See that the column casted as numeric in the sql is imported as varchar.

image

Expected behavior
I would expect numeric columns to be imported as numeric.

Screenshots
See above

Desktop (please complete the following information): not relevant

Rill version: 0.49.1

Additional context
n/a

@nvennin nvennin added the Type:Bug Something isn't working label Nov 28, 2024
@mindspank
Copy link
Contributor

Do you get the same error on latest version of Rill?

::numeric should default to a 3 scale and 18 decimals. Is your data perhaps wider then that? Figured that duckdb might be smart and trying to auto cast to fit your data

@nvennin
Copy link
Author

nvennin commented Dec 9, 2024

Still the same. It seems that, somehow, rill's importer coerces numeric columns to varchar.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type:Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants