Skip to content

Commit 2f0b44a

Browse files
dantengskyzhaoboran
authored andcommitted
tweak parquet physical type mappings
1 parent b8e1e76 commit 2f0b44a

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/common/experimental_parquet_reader/src/reader/column_reader.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ fn pages_to_column_iter<'a>(
103103
chunk_size,
104104
)))
105105
}
106+
// TODO: arrow 55.1.0 does not support Decimal64 yet, so we use Decimal128, but the storage format is Int64
107+
(PhysicalType::Int64, TableDataType::Decimal(DecimalDataType::Decimal128(decimal_size))) => {
108+
Ok(Box::new(new_decimal64_iter(
109+
pages,
110+
num_rows,
111+
decimal_size.precision(),
112+
decimal_size.scale(),
113+
is_nullable,
114+
chunk_size,
115+
)))
116+
}
106117
(PhysicalType::FixedLenByteArray(_), TableDataType::Decimal(DecimalDataType::Decimal128(decimal_size))) => {
107118
Ok(Box::new(new_decimal128_iter(
108119
pages,

tests/sqllogictests/suites/base/03_common/03_extra_new_reader.test

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,38 @@ insert into t3 select * from r limit 100000;
4747
statement ok
4848
select sum(a) from t3 ignore_result;
4949

50+
statement ok
51+
CREATE TABLE IF NOT EXISTS lineitem
52+
(
53+
l_orderkey BIGINT not null,
54+
l_partkey BIGINT not null,
55+
l_suppkey BIGINT not null,
56+
l_linenumber BIGINT not null,
57+
l_quantity DECIMAL(15, 2) not null,
58+
l_extendedprice DECIMAL(15, 2) not null,
59+
l_discount DECIMAL(15, 2) not null,
60+
l_tax DECIMAL(15, 2) not null,
61+
l_returnflag STRING not null,
62+
l_linestatus STRING not null,
63+
l_shipdate DATE not null,
64+
l_commitdate DATE not null,
65+
l_receiptdate DATE not null,
66+
l_shipinstruct STRING not null,
67+
l_shipmode STRING not null,
68+
l_comment STRING not null
69+
);
70+
71+
statement ok
72+
create table lr like lineitem engine = random;
73+
74+
statement ok
75+
insert into lineitem select * from lr limit 1000;
76+
77+
statement ok
78+
insert into lineitem select * from lr limit 1000;
79+
80+
statement ok
81+
select * from lineitem ignore_result;
82+
83+
5084

0 commit comments

Comments
 (0)