Skip to content

feat(query): variant support extension types(Decimal, Binary, Date, Timestamp, Interval) #17835

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

Merged
merged 16 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
243 changes: 125 additions & 118 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ enquote = "1.1.0"
enum-as-inner = "0.6"
enum_dispatch = "0.3.13"
enumflags2 = { version = "0.7.7", features = ["serde"] }
ethnum = { version = "1.5.0" }
ethnum = { version = "1.5.1" }
faststr = "0.2"
feature-set = { version = "0.1.1" }
flatbuffers = "24" # Must use the same version with arrow-ipc
Expand Down Expand Up @@ -350,7 +350,7 @@ jaq-core = "1.5.1"
jaq-interpret = "1.5.0"
jaq-parse = "1.0.3"
jaq-std = "1.6.0"
jiff = { version = "0.2.1", features = ["serde", "tzdb-bundle-always"] }
jiff = { version = "0.2.10", features = ["serde", "tzdb-bundle-always"] }
jsonb = "0.5.1"
jwt-simple = { version = "0.12.10", default-features = false, features = ["pure-rust"] }
lenient_semver = "0.4.2"
Expand Down Expand Up @@ -637,7 +637,7 @@ backtrace = { git = "https://github.com/rust-lang/backtrace-rs.git", rev = "7226
color-eyre = { git = "https://github.com/eyre-rs/eyre.git", rev = "e5d92c3" }
deltalake = { git = "https://github.com/delta-io/delta-rs", rev = "c149502" }
display-more = { git = "https://github.com/databendlabs/display-more", tag = "v0.1.2" }
ethnum = { git = "https://github.com/datafuse-extras/ethnum-rs", rev = "4cb05f1" }
jsonb = { git = "https://github.com/b41sh/jsonb", rev = "73871c14bc11b65a1cba90bdb4ccc85f06c356e2" }
map-api = { git = "https://github.com/databendlabs/map-api", tag = "v0.2.3" }
openai_api_rust = { git = "https://github.com/datafuse-extras/openai-api", rev = "819a0ed" }
openraft = { git = "https://github.com/databendlabs/openraft", tag = "v0.10.0-alpha.9" }
Expand Down
1 change: 0 additions & 1 deletion src/common/native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ bytemuck = { workspace = true }
byteorder = { workspace = true }
bytes = { workspace = true }
env_logger = { workspace = true }
ethnum = { workspace = true }
hashbrown_v0_14 = { workspace = true }
log = { workspace = true }
lz4 = { workspace = true }
Expand Down
6 changes: 5 additions & 1 deletion src/common/native/src/read/batch_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ pub fn read_nested_column<R: NativeReadBuf>(
),
Decimal(decimal) if decimal.precision() > MAX_DECIMAL128_PRECISION => {
init.push(InitNested::Primitive(is_nullable));
read_nested_decimal::<databend_common_column::types::i256, ethnum::i256, _>(
read_nested_decimal::<
databend_common_column::types::i256,
databend_common_expression::types::i256,
_,
>(
&mut readers.pop().unwrap(),
data_type.clone(),
decimal.size(),
Expand Down
2 changes: 1 addition & 1 deletion src/common/native/src/read/deserialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ where
DynIter::new(DecimalNestedIter::<
_,
databend_common_column::types::i256,
ethnum::i256,
databend_common_expression::types::i256,
>::new(
readers.pop().unwrap(), data_type.clone(), t.size(), init
))
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ databend-common-io = { workspace = true }
educe = { workspace = true }
either = { workspace = true }
enum-as-inner = { workspace = true }
ethnum = { workspace = true, features = ["serde", "macros", "borsh"] }
ethnum = { workspace = true, features = ["serde", "macros"] }
futures = { workspace = true }
geo = { workspace = true }
geozero = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/aggregate/group_hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ use databend_common_column::bitmap::Bitmap;
use databend_common_column::buffer::Buffer;
use databend_common_column::types::Index;
use databend_common_exception::Result;
use ethnum::i256;

use crate::types::i256;
use crate::types::AnyType;
use crate::types::ArgType;
use crate::types::BinaryType;
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/aggregate/payload_flush.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use databend_common_exception::Result;
use databend_common_io::prelude::bincode_deserialize_from_slice;
use ethnum::i256;

use super::partitioned_payload::PartitionedPayload;
use super::payload::Payload;
Expand All @@ -25,6 +24,7 @@ use crate::types::binary::BinaryColumn;
use crate::types::binary::BinaryColumnBuilder;
use crate::types::decimal::Decimal;
use crate::types::decimal::DecimalType;
use crate::types::i256;
use crate::types::nullable::NullableColumn;
use crate::types::string::StringColumn;
use crate::types::string::StringColumnBuilder;
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/aggregate/payload_row.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ use bumpalo::Bump;
use databend_common_column::bitmap::Bitmap;
use databend_common_io::prelude::bincode_deserialize_from_slice;
use databend_common_io::prelude::bincode_serialize_into_buf;
use ethnum::i256;

use crate::read;
use crate::store;
use crate::types::binary::BinaryColumn;
use crate::types::decimal::DecimalColumn;
use crate::types::decimal::DecimalType;
use crate::types::i256;
use crate::types::AnyType;
use crate::types::ArgType;
use crate::types::BinaryType;
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/filter/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

use databend_common_exception::ErrorCode;
use databend_common_exception::Result;
use ethnum::i256;

use crate::arrow::and_validities;
use crate::filter::SelectOp;
use crate::filter::SelectStrategy;
use crate::types::decimal::DecimalType;
use crate::types::i256;
use crate::types::nullable::NullableColumn;
use crate::types::number::*;
use crate::types::AnyType;
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/kernels/concat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ use databend_common_column::bitmap::Bitmap;
use databend_common_column::buffer::Buffer;
use databend_common_exception::ErrorCode;
use databend_common_exception::Result;
use ethnum::i256;
use itertools::Itertools;

use crate::types::array::ArrayColumnBuilder;
use crate::types::decimal::Decimal;
use crate::types::decimal::DecimalColumn;
use crate::types::i256;
use crate::types::map::KvColumnBuilder;
use crate::types::nullable::NullableColumn;
use crate::types::number::NumberColumn;
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/kernels/group_by_hash/method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use databend_common_exception::Result;
use databend_common_hashtable::DictionaryKeys;
use databend_common_hashtable::FastHash;
use either::Either;
use ethnum::i256;
use ethnum::u256;

use crate::types::binary::BinaryColumn;
use crate::types::decimal::Decimal;
use crate::types::i256;
use crate::types::DataType;
use crate::types::DecimalDataType;
use crate::types::NumberDataType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ use databend_common_column::buffer::Buffer;
use databend_common_exception::ErrorCode;
use databend_common_exception::Result;
use databend_common_hashtable::FastHash;
use ethnum::i256;
use ethnum::u256;
use ethnum::U256;
use micromarshal::Marshal;

use crate::types::boolean::BooleanType;
use crate::types::decimal::Decimal;
use crate::types::decimal::DecimalColumn;
use crate::types::i256;
use crate::types::nullable::NullableColumn;
use crate::types::number::Number;
use crate::types::number::NumberColumn;
Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/row/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

use databend_common_column::bitmap::Bitmap;
use databend_common_column::types::months_days_micros;
use ethnum::i256;

use super::row_converter::null_sentinel;
use crate::types::binary::BinaryColumnBuilder;
use crate::types::i256;
use crate::types::F32;
use crate::types::F64;

Expand Down
2 changes: 1 addition & 1 deletion src/query/expression/src/row/row_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ use std::sync::Arc;
use databend_common_column::types::months_days_micros;
use databend_common_exception::ErrorCode;
use databend_common_exception::Result;
use ethnum::i256;

use super::fixed;
use super::fixed::FixedLengthEncoding;
use super::variable;
use crate::types::binary::BinaryColumn;
use crate::types::binary::BinaryColumnBuilder;
use crate::types::decimal::DecimalColumn;
use crate::types::i256;
use crate::types::DataType;
use crate::types::DecimalDataType;
use crate::types::NumberColumn;
Expand Down
Loading
Loading