Skip to content

Commit 163d0d8

Browse files
authored
feat(query): variant support extension types(Decimal, Binary, Date, Timestamp, Interval) (#17835)
* feat: variant type support extension types * fix * fix * wrap i256 * fix * fix * fix * fix * fix * fix * fix * add i256 comment * fix
1 parent 1cac084 commit 163d0d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1003
-258
lines changed

Cargo.lock

Lines changed: 125 additions & 118 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ enquote = "1.1.0"
306306
enum-as-inner = "0.6"
307307
enum_dispatch = "0.3.13"
308308
enumflags2 = { version = "0.7.7", features = ["serde"] }
309-
ethnum = { version = "1.5.0" }
309+
ethnum = { version = "1.5.1" }
310310
faststr = "0.2"
311311
feature-set = { version = "0.1.1" }
312312
flatbuffers = "24" # Must use the same version with arrow-ipc
@@ -350,7 +350,7 @@ jaq-core = "1.5.1"
350350
jaq-interpret = "1.5.0"
351351
jaq-parse = "1.0.3"
352352
jaq-std = "1.6.0"
353-
jiff = { version = "0.2.1", features = ["serde", "tzdb-bundle-always"] }
353+
jiff = { version = "0.2.10", features = ["serde", "tzdb-bundle-always"] }
354354
jsonb = "0.5.1"
355355
jwt-simple = { version = "0.12.10", default-features = false, features = ["pure-rust"] }
356356
lenient_semver = "0.4.2"
@@ -637,7 +637,7 @@ backtrace = { git = "https://github.com/rust-lang/backtrace-rs.git", rev = "7226
637637
color-eyre = { git = "https://github.com/eyre-rs/eyre.git", rev = "e5d92c3" }
638638
deltalake = { git = "https://github.com/delta-io/delta-rs", rev = "c149502" }
639639
display-more = { git = "https://github.com/databendlabs/display-more", tag = "v0.1.2" }
640-
ethnum = { git = "https://github.com/datafuse-extras/ethnum-rs", rev = "4cb05f1" }
640+
jsonb = { git = "https://github.com/databendlabs/jsonb", rev = "dcaf261" }
641641
map-api = { git = "https://github.com/databendlabs/map-api", tag = "v0.2.3" }
642642
openai_api_rust = { git = "https://github.com/datafuse-extras/openai-api", rev = "819a0ed" }
643643
openraft = { git = "https://github.com/databendlabs/openraft", tag = "v0.10.0-alpha.9" }

src/common/native/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ bytemuck = { workspace = true }
1818
byteorder = { workspace = true }
1919
bytes = { workspace = true }
2020
env_logger = { workspace = true }
21-
ethnum = { workspace = true }
2221
hashbrown_v0_14 = { workspace = true }
2322
log = { workspace = true }
2423
lz4 = { workspace = true }

src/common/native/src/read/batch_read.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ pub fn read_nested_column<R: NativeReadBuf>(
7373
),
7474
Decimal(decimal) if decimal.precision() > MAX_DECIMAL128_PRECISION => {
7575
init.push(InitNested::Primitive(is_nullable));
76-
read_nested_decimal::<databend_common_column::types::i256, ethnum::i256, _>(
76+
read_nested_decimal::<
77+
databend_common_column::types::i256,
78+
databend_common_expression::types::i256,
79+
_,
80+
>(
7781
&mut readers.pop().unwrap(),
7882
data_type.clone(),
7983
decimal.size(),

src/common/native/src/read/deserialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ where
164164
DynIter::new(DecimalNestedIter::<
165165
_,
166166
databend_common_column::types::i256,
167-
ethnum::i256,
167+
databend_common_expression::types::i256,
168168
>::new(
169169
readers.pop().unwrap(), data_type.clone(), t.size(), init
170170
))

src/query/expression/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ databend-common-io = { workspace = true }
3131
educe = { workspace = true }
3232
either = { workspace = true }
3333
enum-as-inner = { workspace = true }
34-
ethnum = { workspace = true, features = ["serde", "macros", "borsh"] }
34+
ethnum = { workspace = true, features = ["serde", "macros"] }
3535
futures = { workspace = true }
3636
geo = { workspace = true }
3737
geozero = { workspace = true }

src/query/expression/src/aggregate/group_hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ use databend_common_column::bitmap::Bitmap;
1717
use databend_common_column::buffer::Buffer;
1818
use databend_common_column::types::Index;
1919
use databend_common_exception::Result;
20-
use ethnum::i256;
2120

21+
use crate::types::i256;
2222
use crate::types::AnyType;
2323
use crate::types::ArgType;
2424
use crate::types::BinaryType;

src/query/expression/src/aggregate/payload_flush.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use databend_common_exception::Result;
1616
use databend_common_io::prelude::bincode_deserialize_from_slice;
17-
use ethnum::i256;
1817

1918
use super::partitioned_payload::PartitionedPayload;
2019
use super::payload::Payload;
@@ -25,6 +24,7 @@ use crate::types::binary::BinaryColumn;
2524
use crate::types::binary::BinaryColumnBuilder;
2625
use crate::types::decimal::Decimal;
2726
use crate::types::decimal::DecimalType;
27+
use crate::types::i256;
2828
use crate::types::nullable::NullableColumn;
2929
use crate::types::string::StringColumn;
3030
use crate::types::string::StringColumnBuilder;

src/query/expression/src/aggregate/payload_row.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ use bumpalo::Bump;
1616
use databend_common_column::bitmap::Bitmap;
1717
use databend_common_io::prelude::bincode_deserialize_from_slice;
1818
use databend_common_io::prelude::bincode_serialize_into_buf;
19-
use ethnum::i256;
2019

2120
use crate::read;
2221
use crate::store;
2322
use crate::types::binary::BinaryColumn;
2423
use crate::types::decimal::DecimalColumn;
2524
use crate::types::decimal::DecimalType;
25+
use crate::types::i256;
2626
use crate::types::AnyType;
2727
use crate::types::ArgType;
2828
use crate::types::BinaryType;

src/query/expression/src/filter/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414

1515
use databend_common_exception::ErrorCode;
1616
use databend_common_exception::Result;
17-
use ethnum::i256;
1817

1918
use crate::arrow::and_validities;
2019
use crate::filter::SelectOp;
2120
use crate::filter::SelectStrategy;
2221
use crate::types::decimal::DecimalType;
22+
use crate::types::i256;
2323
use crate::types::nullable::NullableColumn;
2424
use crate::types::number::*;
2525
use crate::types::AnyType;

0 commit comments

Comments
 (0)