File tree Expand file tree Collapse file tree 1 file changed +22
-12
lines changed
src/query/storages/common/blocks/src Expand file tree Collapse file tree 1 file changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -90,16 +90,26 @@ pub fn blocks_to_parquet(
90
90
}
91
91
}
92
92
93
- fn col_encoding ( _data_type : & ArrowDataType ) -> Encoding {
94
- // Although encoding does work, parquet2 has not implemented decoding of DeltaLengthByteArray yet, we fallback to Plain
95
- // From parquet2: Decoding "DeltaLengthByteArray"-encoded required V2 pages is not yet implemented for Binary.
96
- //
97
- // match data_type {
98
- // ArrowDataType::Binary
99
- // | ArrowDataType::LargeBinary
100
- // | ArrowDataType::Utf8
101
- // | ArrowDataType::LargeUtf8 => Encoding::DeltaLengthByteArray,
102
- // _ => Encoding::Plain,
103
- //}
104
- Encoding :: Plain
93
+ fn col_encoding ( data_type : & ArrowDataType ) -> Encoding {
94
+ use common_arrow:: arrow:: datatypes:: DataType ;
95
+ let lt = data_type. to_logical_type ( ) ;
96
+ match lt {
97
+ DataType :: Decimal ( p, _) if * p <= 18 => Encoding :: DeltaBinaryPacked ,
98
+ DataType :: UInt8
99
+ | DataType :: UInt16
100
+ | DataType :: UInt32
101
+ | DataType :: UInt64
102
+ | DataType :: Int8
103
+ | DataType :: Int16
104
+ | DataType :: Int32
105
+ | DataType :: Date32
106
+ | DataType :: Time32 ( _)
107
+ | DataType :: Int64
108
+ | DataType :: Date64
109
+ | DataType :: Time64 ( _)
110
+ | DataType :: Timestamp ( _, _)
111
+ | DataType :: Duration ( _) => Encoding :: DeltaBinaryPacked ,
112
+
113
+ _ => Encoding :: Plain ,
114
+ }
105
115
}
You can’t perform that action at this time.
0 commit comments