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

weird schema when reading parquet with decimal dtypes #2904

Closed
universalmind303 opened this issue Sep 24, 2024 · 3 comments · Fixed by #2909
Closed

weird schema when reading parquet with decimal dtypes #2904

universalmind303 opened this issue Sep 24, 2024 · 3 comments · Fixed by #2909
Assignees
Labels
bug Something isn't working

Comments

@universalmind303
Copy link
Collaborator

universalmind303 commented Sep 24, 2024

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

From duckdb cli

D CALL dbgen(sf = 1);
D copy (select * from customer) to './tpch/customer.parquet';
D copy (select * from lineitem) to './tpch/lineitem.parquet';
D copy (select * from nation) to './tpch/nation.parquet';
D copy (select * from orders) to './tpch/orders.parquet';
D copy (select * from part) to './tpch/part.parquet';
D copy (select * from partsupp) to './tpch/partsupp.parquet';
D copy (select * from region) to './tpch/region.parquet';
D copy (select * from supplier) to './tpch/supplier.parquet';

then from daft

import daft
daft.read_parquet(f"./tpch/lineitem.parquet").schema()

╭─────────────────┬───────╮
│ Column NameType  │
╞═════════════════╪═══════╡
│ l_orderkeyInt64 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_partkeyInt64 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_suppkeyInt64 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_linenumberInt64 │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_quantity15.2  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_extendedprice15.2  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_discount15.2  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_tax15.2  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_returnflagUtf8  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_linestatusUtf8  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_shipdateDate  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_commitdateDate  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_receiptdateDate  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_shipinstructUtf8  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_shipmodeUtf8  │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┤
│ l_commentUtf8  │
╰─────────────────┴───────╯

Expected behavior
dtype should be Decimal(precision=15, scale=2), not 15.2

Additional context
duckdb version: v1.1.0

@universalmind303 universalmind303 changed the title weird schema when reading parquet generated from duckdb weird schema when reading parquet with decimal dtypes Sep 24, 2024
@universalmind303 universalmind303 added the bug Something isn't working label Sep 24, 2024
@samster25
Copy link
Member

I think it maybe something wrong with the repr? I wondering if it was hit during @raunakab display trait changes

@raunakab
Copy link
Contributor

raunakab commented Sep 24, 2024

I think it maybe something wrong with the repr? I wondering if it was hit during @raunakab display trait changes

This is probably it. I'll take a look into this asap.

@raunakab raunakab self-assigned this Sep 24, 2024
@raunakab raunakab linked a pull request Sep 24, 2024 that will close this issue
@raunakab
Copy link
Contributor

Updated and pushed a fix. Waiting for reviews to merge it in now.

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

Successfully merging a pull request may close this issue.

3 participants