diff --git a/Cargo.lock b/Cargo.lock index e149fad8ae5f9..6bd92df432733 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1392,6 +1392,7 @@ dependencies = [ "educe", "enum-as-inner", "enum_dispatch", + "ethnum", "futures", "goldenfile", "hex", @@ -3544,6 +3545,9 @@ name = "ethnum" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0198b9d0078e0f30dedc7acbb21c974e838fc8fae3ee170128658a98cb2c1c04" +dependencies = [ + "serde", +] [[package]] name = "event-listener" diff --git a/src/meta/proto-conv/src/schema_from_to_protobuf_impl.rs b/src/meta/proto-conv/src/schema_from_to_protobuf_impl.rs index ef91a931e5290..08bafd99b8e1e 100644 --- a/src/meta/proto-conv/src/schema_from_to_protobuf_impl.rs +++ b/src/meta/proto-conv/src/schema_from_to_protobuf_impl.rs @@ -226,6 +226,7 @@ impl FromToProto for ex::TableDataType { let x = n.to_pb()?; new_pb_dt24(Dt24::NumberT(x)) } + TableDataType::Decimal(_) => unimplemented!("decimal type is not supported"), TableDataType::Timestamp => new_pb_dt24(Dt24::TimestampT(pb::Empty {})), TableDataType::Date => new_pb_dt24(Dt24::DateT(pb::Empty {})), TableDataType::Nullable(v) => { diff --git a/src/query/expression/Cargo.toml b/src/query/expression/Cargo.toml index cbc0f0c232f13..fa4fd96df621d 100755 --- a/src/query/expression/Cargo.toml +++ b/src/query/expression/Cargo.toml @@ -26,6 +26,7 @@ common-jsonb = { path = "../../common/jsonb" } educe = "0.4" enum-as-inner = "0.5" enum_dispatch = "0.3.8" +ethnum = { version = "1.3", features = ["serde"] } futures = "0.3.24" hex = "0.4.3" itertools = "0.10" diff --git a/src/query/expression/src/converts/to.rs b/src/query/expression/src/converts/to.rs index 08d635002cac3..aba7a5ba3acc8 100644 --- a/src/query/expression/src/converts/to.rs +++ b/src/query/expression/src/converts/to.rs @@ -35,6 +35,7 @@ pub fn scalar_to_datavalue(scalar: &Scalar) -> DataValue { } crate::types::number::NumberScalar::Float64(x) => DataValue::Float64((*x).into()), }, + Scalar::Decimal(_) => unimplemented!("decimal type is not supported"), Scalar::Timestamp(x) => DataValue::Int64(*x), Scalar::Date(x) => DataValue::Int64(*x as i64), Scalar::Boolean(x) => DataValue::Boolean(*x), diff --git a/src/query/expression/src/kernels/concat.rs b/src/query/expression/src/kernels/concat.rs index 8940199f0d490..7b25e0b38875e 100644 --- a/src/query/expression/src/kernels/concat.rs +++ b/src/query/expression/src/kernels/concat.rs @@ -17,6 +17,7 @@ use common_exception::Result; use itertools::Itertools; use crate::types::array::ArrayColumnBuilder; +use crate::types::decimal::DecimalColumn; use crate::types::nullable::NullableColumn; use crate::types::number::NumberColumn; use crate::types::string::StringColumnBuilder; @@ -33,6 +34,7 @@ use crate::types::StringType; use crate::types::TimestampType; use crate::types::ValueType; use crate::types::VariantType; +use crate::with_decimal_type; use crate::with_number_mapped_type; use crate::BlockEntry; use crate::Column; @@ -104,6 +106,21 @@ impl Column { Self::concat_arg_types::>(columns) } }), + Column::Decimal(col) => with_decimal_type!(|DECIMAL_TYPE| match col { + DecimalColumn::DECIMAL_TYPE(_, size) => { + let mut builder = Vec::with_capacity(capacity); + for c in columns { + match c { + Column::Decimal(DecimalColumn::DECIMAL_TYPE(col, size)) => { + debug_assert_eq!(size, size); + builder.extend_from_slice(col); + } + _ => unreachable!(), + } + } + Column::Decimal(DecimalColumn::DECIMAL_TYPE(builder.into(), *size)) + } + }), Column::Boolean(_) => Self::concat_arg_types::(columns), Column::String(_) => { let data_capacity = columns.iter().map(|c| c.memory_size() - c.len() * 8).sum(); diff --git a/src/query/expression/src/kernels/filter.rs b/src/query/expression/src/kernels/filter.rs index 17f8f0387b3d5..25f732d101955 100644 --- a/src/query/expression/src/kernels/filter.rs +++ b/src/query/expression/src/kernels/filter.rs @@ -22,6 +22,7 @@ use common_exception::Result; use crate::filter_helper::FilterHelpers; use crate::types::array::ArrayColumnBuilder; +use crate::types::decimal::DecimalColumn; use crate::types::nullable::NullableColumn; use crate::types::number::NumberColumn; use crate::types::string::StringColumnBuilder; @@ -31,6 +32,7 @@ use crate::types::BooleanType; use crate::types::StringType; use crate::types::ValueType; use crate::types::VariantType; +use crate::with_decimal_type; use crate::with_number_type; use crate::BlockEntry; use crate::Column; @@ -115,6 +117,14 @@ impl Column { ))) } }), + Column::Decimal(column) => with_decimal_type!(|DECIMAL_TYPE| match column { + DecimalColumn::DECIMAL_TYPE(values, size) => { + Column::Decimal(DecimalColumn::DECIMAL_TYPE( + Self::filter_primitive_types(values, filter), + *size, + )) + } + }), Column::Boolean(bm) => Self::filter_scalar_types::( bm, MutableBitmap::with_capacity(length), diff --git a/src/query/expression/src/kernels/group_by_hash.rs b/src/query/expression/src/kernels/group_by_hash.rs index 1993faf371c06..95799ed1e200c 100644 --- a/src/query/expression/src/kernels/group_by_hash.rs +++ b/src/query/expression/src/kernels/group_by_hash.rs @@ -490,6 +490,7 @@ pub fn serialize_column_binary(column: &Column, row: usize, vec: &mut Vec) { Column::String(v) => { BinaryWrite::write_binary(vec, unsafe { v.index_unchecked(row) }).unwrap() } + Column::Decimal(_) => todo!("decimal"), Column::Timestamp(v) => vec.extend_from_slice(v[row].to_le_bytes().as_ref()), Column::Date(v) => vec.extend_from_slice(v[row].to_le_bytes().as_ref()), Column::Array(array) => { diff --git a/src/query/expression/src/kernels/scatter.rs b/src/query/expression/src/kernels/scatter.rs index 5c4a4016cc2cd..23c95cccc39c2 100644 --- a/src/query/expression/src/kernels/scatter.rs +++ b/src/query/expression/src/kernels/scatter.rs @@ -14,8 +14,10 @@ use common_arrow::arrow::bitmap::MutableBitmap; use common_exception::Result; +use itertools::Itertools; use crate::types::array::ArrayColumnBuilder; +use crate::types::decimal::DecimalColumn; use crate::types::nullable::NullableColumn; use crate::types::number::NumberColumn; use crate::types::string::StringColumnBuilder; @@ -29,6 +31,7 @@ use crate::types::StringType; use crate::types::TimestampType; use crate::types::ValueType; use crate::types::VariantType; +use crate::with_decimal_type; use crate::with_number_mapped_type; use crate::BlockEntry; use crate::Column; @@ -137,6 +140,20 @@ impl Column { scatter_size ), }), + Column::Decimal(column) => with_decimal_type!(|DECIMAL_TYPE| match column { + DecimalColumn::DECIMAL_TYPE(values, size) => { + let mut builder = (0..scatter_size) + .map(|_| Vec::with_capacity(length)) + .collect_vec(); + for (index, item) in indices.iter().zip(values.iter()) { + builder[index.to_usize()].push(*item); + } + builder + .into_iter() + .map(|v| Column::Decimal(DecimalColumn::DECIMAL_TYPE(v.into(), *size))) + .collect() + } + }), Column::EmptyArray { .. } => Self::scatter_repeat_scalars::( &Scalar::EmptyArray, data_type, diff --git a/src/query/expression/src/kernels/take.rs b/src/query/expression/src/kernels/take.rs index 4d36846e4a0f4..2aa055f533e5b 100644 --- a/src/query/expression/src/kernels/take.rs +++ b/src/query/expression/src/kernels/take.rs @@ -13,8 +13,10 @@ // limitations under the License. use common_exception::Result; +use itertools::Itertools; use crate::types::array::ArrayColumnBuilder; +use crate::types::decimal::DecimalColumn; use crate::types::nullable::NullableColumn; use crate::types::number::NumberColumn; use crate::types::AnyType; @@ -25,6 +27,7 @@ use crate::types::NumberType; use crate::types::StringType; use crate::types::ValueType; use crate::types::VariantType; +use crate::with_decimal_type; use crate::with_number_mapped_type; use crate::BlockEntry; use crate::Column; @@ -69,6 +72,15 @@ impl Column { NumberColumn::NUM_TYPE(values) => Self::take_arg_types::, _>(values, indices), }), + Column::Decimal(column) => with_decimal_type!(|DECIMAL_TYPE| match column { + DecimalColumn::DECIMAL_TYPE(values, size) => { + let builder = indices + .iter() + .map(|index| unsafe { *values.get_unchecked(index.to_usize()) }) + .collect_vec(); + Column::Decimal(DecimalColumn::DECIMAL_TYPE(builder.into(), *size)) + } + }), Column::Boolean(bm) => Self::take_arg_types::(bm, indices), Column::String(column) => Self::take_arg_types::(column, indices), Column::Timestamp(column) => { diff --git a/src/query/expression/src/kernels/take_chunks.rs b/src/query/expression/src/kernels/take_chunks.rs index edc281219bad6..f15810f2f7201 100644 --- a/src/query/expression/src/kernels/take_chunks.rs +++ b/src/query/expression/src/kernels/take_chunks.rs @@ -16,6 +16,7 @@ use common_arrow::arrow::compute::merge_sort::MergeSlice; use itertools::Itertools; use crate::types::array::ArrayColumnBuilder; +use crate::types::decimal::DecimalColumn; use crate::types::nullable::NullableColumn; use crate::types::number::NumberColumn; use crate::types::AnyType; @@ -29,6 +30,7 @@ use crate::types::StringType; use crate::types::TimestampType; use crate::types::ValueType; use crate::types::VariantType; +use crate::with_decimal_type; use crate::with_number_mapped_type; use crate::BlockEntry; use crate::Column; @@ -38,7 +40,7 @@ use crate::Scalar; use crate::TypeDeserializer; use crate::Value; -// Chunk idx, row idx in the block, times +// Block idx, row idx in the block, repeat times pub type BlockRowIndex = (usize, usize, usize); impl DataBlock { @@ -198,6 +200,25 @@ impl Column { Self::take_block_value_types::>(columns, builder, indices) } }), + Column::Decimal(column) => with_decimal_type!(|DECIMAL_TYPE| match column { + DecimalColumn::DECIMAL_TYPE(_, size) => { + let columns = columns + .iter() + .map(|col| match col { + Column::Decimal(DecimalColumn::DECIMAL_TYPE(col, _)) => col, + _ => unreachable!(), + }) + .collect_vec(); + let mut builder = Vec::with_capacity(result_size); + for &(block_index, row, times) in indices { + let val = unsafe { columns[block_index].get_unchecked(row) }; + for _ in 0..times { + builder.push(*val); + } + } + Column::Decimal(DecimalColumn::DECIMAL_TYPE(builder.into(), *size)) + } + }), Column::Boolean(_) => { let builder = BooleanType::create_builder(result_size, &[]); Self::take_block_value_types::(columns, builder, indices) @@ -303,12 +324,14 @@ impl Column { mut builder: T::ColumnBuilder, indices: &[BlockRowIndex], ) -> Column { - unsafe { - for &(block_index, row, times) in indices { - let col = T::try_downcast_column(&columns[block_index]).unwrap(); - for _ in 0..times { - T::push_item(&mut builder, T::index_column_unchecked(&col, row)) - } + let columns = columns + .iter() + .map(|col| T::try_downcast_column(col).unwrap()) + .collect_vec(); + for &(block_index, row, times) in indices { + let val = unsafe { T::index_column_unchecked(&columns[block_index], row) }; + for _ in 0..times { + T::push_item(&mut builder, val.clone()) } } T::upcast_column(T::build_column(builder)) diff --git a/src/query/expression/src/property.rs b/src/query/expression/src/property.rs index bceec1fa0d188..ef4a6cbc78cff 100644 --- a/src/query/expression/src/property.rs +++ b/src/query/expression/src/property.rs @@ -15,6 +15,7 @@ use enum_as_inner::EnumAsInner; use crate::types::boolean::BooleanDomain; +use crate::types::decimal::DecimalDomain; use crate::types::nullable::NullableDomain; use crate::types::number::NumberDomain; use crate::types::number::NumberScalar; @@ -67,6 +68,7 @@ pub enum FunctionDomain { #[derive(Debug, Clone, PartialEq, EnumAsInner)] pub enum Domain { Number(NumberDomain), + Decimal(DecimalDomain), Boolean(BooleanDomain), String(StringDomain), Timestamp(SimpleDomain), @@ -137,6 +139,7 @@ impl Domain { DataType::Number(NumberDataType::Float64) => { Domain::Number(NumberDomain::Float64(NumberType::::full_domain())) } + DataType::Decimal(_) => todo!("decimal"), DataType::Timestamp => Domain::Timestamp(TimestampType::full_domain()), DataType::Date => Domain::Date(DateType::full_domain()), DataType::Null => Domain::Nullable(NullableDomain { diff --git a/src/query/expression/src/schema.rs b/src/query/expression/src/schema.rs index f9ff20059d9e0..c52aa625f9bfb 100644 --- a/src/query/expression/src/schema.rs +++ b/src/query/expression/src/schema.rs @@ -39,6 +39,8 @@ use serde::Serialize; use crate::types::array::ArrayColumn; use crate::types::date::DATE_MAX; use crate::types::date::DATE_MIN; +use crate::types::decimal::DecimalDataType; +use crate::types::decimal::DecimalSize; use crate::types::nullable::NullableColumn; use crate::types::timestamp::TIMESTAMP_MAX; use crate::types::timestamp::TIMESTAMP_MIN; @@ -104,6 +106,7 @@ pub enum TableDataType { Boolean, String, Number(NumberDataType), + Decimal(DecimalDataType), Timestamp, Date, Nullable(Box), @@ -818,6 +821,7 @@ impl From<&TableDataType> for DataType { TableDataType::Boolean => DataType::Boolean, TableDataType::String => DataType::String, TableDataType::Number(ty) => DataType::Number(*ty), + TableDataType::Decimal(ty) => DataType::Decimal(*ty), TableDataType::Timestamp => DataType::Timestamp, TableDataType::Date => DataType::Date, TableDataType::Nullable(ty) => DataType::Nullable(Box::new((&**ty).into())), @@ -954,6 +958,7 @@ impl TableDataType { ), })), }, + TableDataType::Decimal(_) => todo!("decimal"), TableDataType::Timestamp => BlockEntry { data_type: DataType::Timestamp, value: Value::Column(TimestampType::from_data( @@ -1151,6 +1156,17 @@ impl From<&ArrowField> for TableDataType { let ty = with_number_type!(|TYPE| match f.data_type() { ArrowDataType::TYPE => TableDataType::Number(NumberDataType::TYPE), + ArrowDataType::Decimal(precision, scale) => + TableDataType::Decimal(DecimalDataType::Decimal128(DecimalSize { + precision: *precision as u8, + scale: *scale as u8, + })), + ArrowDataType::Decimal256(precision, scale) => + TableDataType::Decimal(DecimalDataType::Decimal256(DecimalSize { + precision: *precision as u8, + scale: *scale as u8, + })), + ArrowDataType::Null => return TableDataType::Null, ArrowDataType::Boolean => TableDataType::Boolean, @@ -1277,6 +1293,12 @@ impl From<&TableDataType> for ArrowDataType { TableDataType::Number(ty) => with_number_type!(|TYPE| match ty { NumberDataType::TYPE => ArrowDataType::TYPE, }), + TableDataType::Decimal(DecimalDataType::Decimal128(size)) => { + ArrowDataType::Decimal(size.precision as usize, size.scale as usize) + } + TableDataType::Decimal(DecimalDataType::Decimal256(size)) => { + ArrowDataType::Decimal256(size.precision as usize, size.scale as usize) + } TableDataType::Timestamp => ArrowDataType::Timestamp(TimeUnit::Microsecond, None), TableDataType::Date => ArrowDataType::Date32, TableDataType::Nullable(ty) => ty.as_ref().into(), diff --git a/src/query/expression/src/type_check.rs b/src/query/expression/src/type_check.rs index 1e460c90ea7d0..77572d49d54fc 100755 --- a/src/query/expression/src/type_check.rs +++ b/src/query/expression/src/type_check.rs @@ -460,7 +460,7 @@ pub fn common_super_type(ty1: DataType, ty2: DataType) -> Option { Some(DataType::Array(Box::new(common_super_type(ty1, ty2)?))) } (DataType::Number(num1), DataType::Number(num2)) => { - Some(DataType::Number(num1.lossful_super_type(num2))) + Some(DataType::Number(num1.super_type(num2))) } (DataType::String, DataType::Timestamp) | (DataType::Timestamp, DataType::String) => { diff --git a/src/query/expression/src/types.rs b/src/query/expression/src/types.rs index 089102d0d7102..a03535129fea2 100755 --- a/src/query/expression/src/types.rs +++ b/src/query/expression/src/types.rs @@ -16,6 +16,7 @@ pub mod any; pub mod array; pub mod boolean; pub mod date; +pub mod decimal; pub mod empty_array; pub mod generic; pub mod map; @@ -40,6 +41,7 @@ pub use self::any::AnyType; pub use self::array::ArrayType; pub use self::boolean::BooleanType; pub use self::date::DateType; +use self::decimal::DecimalDataType; pub use self::empty_array::EmptyArrayType; pub use self::generic::GenericType; pub use self::map::MapType; @@ -59,7 +61,6 @@ use crate::deserializations::TimestampDeserializer; use crate::deserializations::TupleDeserializer; use crate::deserializations::VariantDeserializer; use crate::property::Domain; -use crate::utils::concat_array; use crate::values::Column; use crate::values::Scalar; use crate::ColumnBuilder; @@ -75,6 +76,7 @@ pub enum DataType { Boolean, String, Number(NumberDataType), + Decimal(DecimalDataType), Timestamp, Date, Nullable(Box), @@ -85,29 +87,6 @@ pub enum DataType { Generic(usize), } -pub const ALL_UNSIGNED_INTEGER_TYPES: &[NumberDataType; 4] = &[ - NumberDataType::UInt8, - NumberDataType::UInt16, - NumberDataType::UInt32, - NumberDataType::UInt64, -]; - -pub const ALL_INTEGER_TYPES: &[NumberDataType; 8] = &[ - NumberDataType::UInt8, - NumberDataType::UInt16, - NumberDataType::UInt32, - NumberDataType::UInt64, - NumberDataType::Int8, - NumberDataType::Int16, - NumberDataType::Int32, - NumberDataType::Int64, -]; - -pub const ALL_FLOAT_TYPES: &[NumberDataType; 2] = - &[NumberDataType::Float32, NumberDataType::Float64]; -pub const ALL_NUMERICS_TYPES: &[NumberDataType; 10] = - &concat_array(ALL_INTEGER_TYPES, ALL_FLOAT_TYPES); - impl DataType { pub fn wrap_nullable(&self) -> Self { match self { diff --git a/src/query/expression/src/types/decimal.rs b/src/query/expression/src/types/decimal.rs new file mode 100644 index 0000000000000..1dff217cae77e --- /dev/null +++ b/src/query/expression/src/types/decimal.rs @@ -0,0 +1,267 @@ +// Copyright 2022 Datafuse Labs. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use std::fmt::Debug; +use std::ops::Range; + +use common_arrow::arrow::buffer::Buffer; +use enum_as_inner::EnumAsInner; +use ethnum::i256; +use itertools::Itertools; +use serde::Deserialize; +use serde::Serialize; + +use super::SimpleDomain; +use crate::utils::arrow::buffer_into_mut; + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize, EnumAsInner)] +pub enum DecimalDataType { + Decimal128(DecimalSize), + Decimal256(DecimalSize), +} + +#[derive(Clone, Copy, PartialEq, Eq, EnumAsInner, Serialize, Deserialize)] +pub enum DecimalScalar { + Decimal128(i128, DecimalSize), + Decimal256(i256, DecimalSize), +} + +#[derive(Clone, PartialEq, EnumAsInner)] +pub enum DecimalColumn { + Decimal128(Buffer, DecimalSize), + Decimal256(Buffer, DecimalSize), +} + +#[derive(Debug, Clone, PartialEq, Eq, EnumAsInner)] +pub enum DecimalColumnBuilder { + Decimal128(Vec, DecimalSize), + Decimal256(Vec, DecimalSize), +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, EnumAsInner)] +pub enum DecimalDomain { + Decimal128(SimpleDomain, DecimalSize), + Decimal256(SimpleDomain, DecimalSize), +} + +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub struct DecimalSize { + pub precision: u8, + pub scale: u8, +} + +impl PartialOrd for DecimalScalar { + fn partial_cmp(&self, other: &Self) -> Option { + crate::with_decimal_type!(|DECIMAL_TYPE| match (self, other) { + ( + DecimalScalar::DECIMAL_TYPE(lhs, lhs_size), + DecimalScalar::DECIMAL_TYPE(rhs, rhs_size), + ) => { + if lhs_size == rhs_size { + lhs.partial_cmp(rhs) + } else { + None + } + } + _ => None, + }) + } +} + +impl PartialOrd for DecimalColumn { + fn partial_cmp(&self, other: &Self) -> Option { + crate::with_decimal_type!(|DECIMAL_TYPE| match (self, other) { + ( + DecimalColumn::DECIMAL_TYPE(lhs, lhs_size), + DecimalColumn::DECIMAL_TYPE(rhs, rhs_size), + ) => { + if lhs_size == rhs_size { + lhs.iter().partial_cmp(rhs.iter()) + } else { + None + } + } + _ => None, + }) + } +} + +impl DecimalScalar { + pub fn domain(&self) -> DecimalDomain { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalScalar::DECIMAL_TYPE(num, size) => DecimalDomain::DECIMAL_TYPE( + SimpleDomain { + min: *num, + max: *num, + }, + *size + ), + }) + } +} + +impl DecimalColumn { + pub fn len(&self) -> usize { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumn::DECIMAL_TYPE(col, _) => col.len(), + }) + } + + pub fn index(&self, index: usize) -> Option { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumn::DECIMAL_TYPE(col, size) => + Some(DecimalScalar::DECIMAL_TYPE(col.get(index).cloned()?, *size)), + }) + } + + /// # Safety + /// Assumes that the `index` is not out of range. + pub unsafe fn index_unchecked(&self, index: usize) -> DecimalScalar { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumn::DECIMAL_TYPE(col, size) => + DecimalScalar::DECIMAL_TYPE(*col.get_unchecked(index), *size), + }) + } + + pub fn slice(&self, range: Range) -> Self { + assert!( + range.end <= self.len(), + "range {:?} out of len {}", + range, + self.len() + ); + + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumn::DECIMAL_TYPE(col, size) => { + DecimalColumn::DECIMAL_TYPE( + col.clone().slice(range.start, range.end - range.start), + *size, + ) + } + }) + } + + pub fn domain(&self) -> DecimalDomain { + assert!(self.len() > 0); + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumn::DECIMAL_TYPE(col, size) => { + let (min, max) = col.iter().minmax().into_option().unwrap(); + DecimalDomain::DECIMAL_TYPE( + SimpleDomain { + min: *min, + max: *max, + }, + *size, + ) + } + }) + } +} + +impl DecimalColumnBuilder { + pub fn from_column(col: DecimalColumn) -> Self { + crate::with_decimal_type!(|DECIMAL_TYPE| match col { + DecimalColumn::DECIMAL_TYPE(col, size) => + DecimalColumnBuilder::DECIMAL_TYPE(buffer_into_mut(col), size), + }) + } + + pub fn repeat(scalar: DecimalScalar, n: usize) -> DecimalColumnBuilder { + crate::with_decimal_type!(|DECIMAL_TYPE| match scalar { + DecimalScalar::DECIMAL_TYPE(num, size) => + DecimalColumnBuilder::DECIMAL_TYPE(vec![num; n], size), + }) + } + + pub fn len(&self) -> usize { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumnBuilder::DECIMAL_TYPE(col, _) => col.len(), + }) + } + + pub fn with_capacity(ty: &DecimalDataType, capacity: usize) -> Self { + crate::with_decimal_type!(|DECIMAL_TYPE| match ty { + DecimalDataType::DECIMAL_TYPE(size) => + DecimalColumnBuilder::DECIMAL_TYPE(Vec::with_capacity(capacity), *size), + }) + } + + pub fn push(&mut self, item: DecimalScalar) { + crate::with_decimal_type!(|DECIMAL_TYPE| match (self, item) { + ( + DecimalColumnBuilder::DECIMAL_TYPE(builder, builder_size), + DecimalScalar::DECIMAL_TYPE(value, value_size), + ) => { + debug_assert_eq!(*builder_size, value_size); + builder.push(value) + } + (builder, scalar) => unreachable!("unable to push {scalar:?} to {builder:?}"), + }) + } + + pub fn push_default(&mut self) { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumnBuilder::DECIMAL_TYPE(builder, _) => builder.push(0.into()), + }) + } + + pub fn append_column(&mut self, other: &DecimalColumn) { + crate::with_decimal_type!(|DECIMAL_TYPE| match (self, other) { + ( + DecimalColumnBuilder::DECIMAL_TYPE(builder, builder_size), + DecimalColumn::DECIMAL_TYPE(other, other_size), + ) => { + debug_assert_eq!(builder_size, other_size); + builder.extend_from_slice(other); + } + (this, other) => unreachable!("unable append {other:?} onto {this:?}"), + }) + } + + pub fn build(self) -> DecimalColumn { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumnBuilder::DECIMAL_TYPE(builder, size) => + DecimalColumn::DECIMAL_TYPE(builder.into(), size), + }) + } + + pub fn build_scalar(self) -> DecimalScalar { + assert_eq!(self.len(), 1); + + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumnBuilder::DECIMAL_TYPE(builder, size) => + DecimalScalar::DECIMAL_TYPE(builder[0], size), + }) + } + + pub fn pop(&mut self) -> Option { + crate::with_decimal_type!(|DECIMAL_TYPE| match self { + DecimalColumnBuilder::DECIMAL_TYPE(builder, size) => { + builder + .pop() + .map(|num| DecimalScalar::DECIMAL_TYPE(num, *size)) + } + }) + } +} + +#[macro_export] +macro_rules! with_decimal_type { + ( | $t:tt | $($tail:tt)* ) => { + match_template::match_template! { + $t = [Decimal128, Decimal256], + $($tail)* + } + } +} diff --git a/src/query/expression/src/types/number.rs b/src/query/expression/src/types/number.rs index 13624fb25d060..e1d09e688eeb2 100644 --- a/src/query/expression/src/types/number.rs +++ b/src/query/expression/src/types/number.rs @@ -25,6 +25,7 @@ use ordered_float::OrderedFloat; use serde::Deserialize; use serde::Serialize; +use crate::concat_array; use crate::property::Domain; use crate::types::ArgType; use crate::types::DataType; @@ -39,6 +40,29 @@ use crate::ScalarRef; pub type F32 = OrderedFloat; pub type F64 = OrderedFloat; +pub const ALL_UNSIGNED_INTEGER_TYPES: &[NumberDataType; 4] = &[ + NumberDataType::UInt8, + NumberDataType::UInt16, + NumberDataType::UInt32, + NumberDataType::UInt64, +]; + +pub const ALL_INTEGER_TYPES: &[NumberDataType; 8] = &[ + NumberDataType::UInt8, + NumberDataType::UInt16, + NumberDataType::UInt32, + NumberDataType::UInt64, + NumberDataType::Int8, + NumberDataType::Int16, + NumberDataType::Int32, + NumberDataType::Int64, +]; + +pub const ALL_FLOAT_TYPES: &[NumberDataType; 2] = + &[NumberDataType::Float32, NumberDataType::Float64]; +pub const ALL_NUMERICS_TYPES: &[NumberDataType; 10] = + &concat_array(ALL_INTEGER_TYPES, ALL_FLOAT_TYPES); + #[derive(Debug, Clone, PartialEq, Eq)] pub struct NumberType(PhantomData); @@ -82,7 +106,7 @@ impl ValueType for NumberType { Num::try_downcast_column(col.as_number()?) } - fn try_downcast_domain(domain: &Domain) -> Option> { + fn try_downcast_domain(domain: &Domain) -> Option { Num::try_downcast_domain(domain.as_number()?) } @@ -262,7 +286,7 @@ pub enum NumberDomain { Float64(SimpleDomain), } -#[derive(Debug, Clone, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct SimpleDomain { pub min: T, pub max: T, @@ -349,7 +373,7 @@ impl NumberDataType { } } - pub fn lossful_super_type(self, other: Self) -> Self { + pub fn super_type(self, other: Self) -> Self { if self.can_lossless_cast_to(other) { return other; } else if other.can_lossless_cast_to(self) { @@ -392,69 +416,6 @@ impl NumberDataType { }, } } - - pub const fn lossless_super_type(self, other: Self) -> Option { - if self.can_lossless_cast_to(other) { - return Some(other); - } else if other.can_lossless_cast_to(self) { - return Some(self); - } - Some(match (self.is_float(), other.is_float()) { - (true, true) => NumberDataType::new( - max_bit_with(self.bit_width(), other.bit_width()), - true, - true, - ), - (true, false) => { - let bin_width = - if let Some(next_other_bit_width) = next_bit_width(other.bit_width()) { - max_bit_with(self.bit_width(), next_other_bit_width) - } else { - return None; - }; - NumberDataType::new(bin_width, true, true) - } - (false, true) => { - let bin_width = if let Some(next_self_bit_width) = next_bit_width(self.bit_width()) - { - max_bit_with(next_self_bit_width, other.bit_width()) - } else { - return None; - }; - NumberDataType::new(bin_width, true, true) - } - (false, false) => match (self.is_signed(), other.is_signed()) { - (true, true) => NumberDataType::new( - max_bit_with(self.bit_width(), other.bit_width()), - true, - false, - ), - (false, false) => NumberDataType::new( - max_bit_with(self.bit_width(), other.bit_width()), - false, - false, - ), - (false, true) => { - let bin_width = - if let Some(next_other_bit_width) = next_bit_width(other.bit_width()) { - max_bit_with(self.bit_width(), next_other_bit_width) - } else { - return None; - }; - NumberDataType::new(bin_width, true, false) - } - (true, false) => { - let bin_width = - if let Some(next_self_bit_width) = next_bit_width(self.bit_width()) { - max_bit_with(next_self_bit_width, other.bit_width()) - } else { - return None; - }; - NumberDataType::new(bin_width, true, false) - } - }, - }) - } } const fn next_bit_width(width: u8) -> Option { @@ -480,6 +441,16 @@ impl PartialOrd for NumberScalar { } } +impl PartialOrd for NumberColumn { + fn partial_cmp(&self, other: &Self) -> Option { + crate::with_number_type!(|NUM_TYPE| match (self, other) { + (NumberColumn::NUM_TYPE(lhs), NumberColumn::NUM_TYPE(rhs)) => + lhs.iter().partial_cmp(rhs.iter()), + _ => None, + }) + } +} + impl NumberScalar { pub fn domain(&self) -> NumberDomain { crate::with_number_type!(|NUM_TYPE| match self { @@ -606,12 +577,7 @@ impl NumberColumnBuilder { pub fn pop(&mut self) -> Option { crate::with_number_type!(|NUM_TYPE| match self { - NumberColumnBuilder::NUM_TYPE(builder) => { - match builder.pop() { - Some(num) => Some(NumberScalar::NUM_TYPE(num)), - None => None, - } - } + NumberColumnBuilder::NUM_TYPE(builder) => builder.pop().map(NumberScalar::NUM_TYPE), }) } } diff --git a/src/query/expression/src/types/variant.rs b/src/query/expression/src/types/variant.rs index 01735dcc55f35..a39bcec33d8fd 100644 --- a/src/query/expression/src/types/variant.rs +++ b/src/query/expression/src/types/variant.rs @@ -186,6 +186,7 @@ pub fn cast_scalar_to_variant(scalar: ScalarRef, tz: Tz, buf: &mut Vec) { NumberScalar::Float32(n) => n.0.into(), NumberScalar::Float64(n) => n.0.into(), }, + ScalarRef::Decimal(_) => todo!("decimal"), ScalarRef::Boolean(b) => common_jsonb::Value::Bool(b), ScalarRef::String(s) => common_jsonb::Value::String(String::from_utf8_lossy(s)), ScalarRef::Timestamp(ts) => timestamp_to_string(ts, tz).to_string().into(), diff --git a/src/query/expression/src/utils/display.rs b/src/query/expression/src/utils/display.rs index 61e60435615ee..2a9dc525410f9 100755 --- a/src/query/expression/src/utils/display.rs +++ b/src/query/expression/src/utils/display.rs @@ -15,9 +15,11 @@ use std::fmt::Debug; use std::fmt::Display; use std::fmt::Formatter; +use std::fmt::Write; use comfy_table::Cell; use comfy_table::Table; +use ethnum::i256; use itertools::Itertools; use num_traits::FromPrimitive; use rust_decimal::Decimal; @@ -33,6 +35,10 @@ use crate::property::Domain; use crate::property::FunctionProperty; use crate::types::boolean::BooleanDomain; use crate::types::date::date_to_string; +use crate::types::decimal::DecimalColumn; +use crate::types::decimal::DecimalDataType; +use crate::types::decimal::DecimalDomain; +use crate::types::decimal::DecimalScalar; use crate::types::nullable::NullableDomain; use crate::types::number::NumberColumn; use crate::types::number::NumberDataType; @@ -101,8 +107,18 @@ impl<'a> Debug for ScalarRef<'a> { ScalarRef::Null => write!(f, "NULL"), ScalarRef::EmptyArray => write!(f, "[] :: Array(Nothing)"), ScalarRef::Number(val) => write!(f, "{val:?}"), + ScalarRef::Decimal(val) => write!(f, "{val:?}"), ScalarRef::Boolean(val) => write!(f, "{val}"), - ScalarRef::String(s) => write!(f, "{:?}", String::from_utf8_lossy(s)), + ScalarRef::String(s) => match std::str::from_utf8(s) { + Ok(v) => write!(f, "{:?}", v), + Err(_e) => { + write!(f, "0x")?; + for c in *s { + write!(f, "{:02x}", c)?; + } + Ok(()) + } + }, ScalarRef::Timestamp(t) => write!(f, "{t:?}"), ScalarRef::Date(d) => write!(f, "{d:?}"), ScalarRef::Array(col) => write!(f, "[{}]", col.iter().join(", ")), @@ -130,6 +146,7 @@ impl Debug for Column { Column::Null { len } => f.debug_struct("Null").field("len", len).finish(), Column::EmptyArray { len } => f.debug_struct("EmptyArray").field("len", len).finish(), Column::Number(col) => write!(f, "{col:?}"), + Column::Decimal(col) => write!(f, "{col:?}"), Column::Boolean(col) => f.debug_tuple("Boolean").field(col).finish(), Column::String(col) => write!(f, "{col:?}"), Column::Timestamp(col) => write!(f, "{col:?}"), @@ -151,9 +168,19 @@ impl<'a> Display for ScalarRef<'a> { match self { ScalarRef::Null => write!(f, "NULL"), ScalarRef::EmptyArray => write!(f, "[]"), - ScalarRef::Number(val) => write!(f, "{:?}", val), + ScalarRef::Number(val) => write!(f, "{val}"), + ScalarRef::Decimal(val) => write!(f, "{val}"), ScalarRef::Boolean(val) => write!(f, "{val}"), - ScalarRef::String(s) => write!(f, "{:?}", String::from_utf8_lossy(s)), + ScalarRef::String(s) => match std::str::from_utf8(s) { + Ok(v) => write!(f, "{:?}", v), + Err(_e) => { + write!(f, "0x")?; + for c in *s { + write!(f, "{:02x}", c)?; + } + Ok(()) + } + }, ScalarRef::Timestamp(t) => write!(f, "{}", timestamp_to_string(*t, chrono_tz::Tz::UTC)), ScalarRef::Date(d) => write!(f, "{}", date_to_string(*d as i64, chrono_tz::Tz::UTC)), ScalarRef::Array(col) => write!(f, "[{}]", col.iter().join(", ")), @@ -179,45 +206,8 @@ impl<'a> Display for ScalarRef<'a> { } impl Display for Scalar { - fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { - match self { - Scalar::Null => write!(f, "NULL"), - Scalar::EmptyArray => write!(f, "[]"), - Scalar::Number(n) => write!(f, "{}", n), - Scalar::Boolean(b) => write!(f, "{}", b), - Scalar::String(s) => match std::str::from_utf8(s) { - Ok(v) => write!(f, "{}", v), - Err(_e) => { - for c in s { - write!(f, "{:02x}", c)?; - } - Ok(()) - } - }, - Scalar::Timestamp(t) => write!(f, "{}", timestamp_to_string(*t, chrono_tz::Tz::UTC)), - Scalar::Date(d) => write!(f, "{}", date_to_string(*d as i64, chrono_tz::Tz::UTC)), - Scalar::Array(v) => { - write!( - f, - "[{}]", - v.iter() - .map(|v| v.to_string()) - .collect::>() - .join(", ") - ) - } - Scalar::Tuple(v) => { - write!( - f, - "({})", - v.iter() - .map(|v| v.to_string()) - .collect::>() - .join(", ") - ) - } - Scalar::Variant(v) => write!(f, "{}", common_jsonb::to_string(v)), - } + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.as_ref()) } } @@ -255,6 +245,32 @@ impl Display for NumberScalar { } } +impl Debug for DecimalScalar { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + DecimalScalar::Decimal128(val, size) => { + write!(f, "{}_d128", display_decimal_128(*val, size.scale)) + } + DecimalScalar::Decimal256(val, size) => { + write!(f, "{}_d256", display_decimal_256(*val, size.scale)) + } + } + } +} + +impl Display for DecimalScalar { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + DecimalScalar::Decimal128(val, size) => { + write!(f, "{}", display_decimal_128(*val, size.scale)) + } + DecimalScalar::Decimal256(val, size) => { + write!(f, "{}", display_decimal_256(*val, size.scale)) + } + } + } +} + impl Debug for NumberColumn { fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { match self { @@ -270,35 +286,38 @@ impl Debug for NumberColumn { .debug_tuple("Float32") .field(&format_args!( "[{}]", - &val.iter() - .map(|x| match Decimal::from_f32(x.0) { - Some(d) => d - .round_dp_with_strategy( - FLOAT_NUM_FRAC_DIGITS, - RoundingStrategy::ToZero - ) - .normalize() - .to_string(), - None => x.to_string(), - }) - .join(", ") + &val.iter().map(|x| display_f32(x.0)).join(", ") )) .finish(), NumberColumn::Float64(val) => f .debug_tuple("Float64") + .field(&format_args!( + "[{}]", + &val.iter().map(|x| display_f64(x.0)).join(", ") + )) + .finish(), + } + } +} + +impl Debug for DecimalColumn { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + match self { + DecimalColumn::Decimal128(val, size) => f + .debug_tuple("Decimal128") .field(&format_args!( "[{}]", &val.iter() - .map(|x| match Decimal::from_f64(x.0) { - Some(d) => d - .round_dp_with_strategy( - FLOAT_NUM_FRAC_DIGITS, - RoundingStrategy::ToZero - ) - .normalize() - .to_string(), - None => x.to_string(), - }) + .map(|x| display_decimal_128(*x, size.scale)) + .join(", ") + )) + .finish(), + DecimalColumn::Decimal256(val, size) => f + .debug_tuple("Decimal256") + .field(&format_args!( + "[{}]", + &val.iter() + .map(|x| display_decimal_256(*x, size.scale)) .join(", ") )) .finish(), @@ -391,6 +410,7 @@ impl Display for DataType { DataType::Boolean => write!(f, "Boolean"), DataType::String => write!(f, "String"), DataType::Number(num) => write!(f, "{num}"), + DataType::Decimal(decimal) => write!(f, "{decimal}"), DataType::Timestamp => write!(f, "Timestamp"), DataType::Date => write!(f, "Date"), DataType::Null => write!(f, "NULL"), @@ -423,6 +443,7 @@ impl Display for TableDataType { TableDataType::Boolean => write!(f, "Boolean"), TableDataType::String => write!(f, "String"), TableDataType::Number(num) => write!(f, "{num}"), + TableDataType::Decimal(decimal) => write!(f, "{decimal}"), TableDataType::Timestamp => write!(f, "Timestamp"), TableDataType::Date => write!(f, "Date"), TableDataType::Null => write!(f, "NULL"), @@ -468,6 +489,19 @@ impl Display for NumberDataType { } } +impl Display for DecimalDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> { + match &self { + DecimalDataType::Decimal128(size) => { + write!(f, "Decimal({}, {})", size.precision, size.scale) + } + DecimalDataType::Decimal256(size) => { + write!(f, "Decimal({}, {})", size.precision, size.scale) + } + } + } +} + impl Display for Expr { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { @@ -630,6 +664,25 @@ impl Display for NumberDomain { } } +impl Display for DecimalDomain { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + DecimalDomain::Decimal128(SimpleDomain { min, max }, size) => { + write!(f, "{}", SimpleDomain { + min: display_decimal_128(*min, size.scale), + max: display_decimal_128(*max, size.scale), + }) + } + DecimalDomain::Decimal256(SimpleDomain { min, max }, size) => { + write!(f, "{}", SimpleDomain { + min: display_decimal_256(*min, size.scale), + max: display_decimal_256(*max, size.scale), + }) + } + } + } +} + impl Display for SimpleDomain { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, "{{{}..={}}}", self.min, self.max) @@ -639,6 +692,7 @@ impl Display for Domain { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Domain::Number(domain) => write!(f, "{domain}"), + Domain::Decimal(domain) => write!(f, "{domain}"), Domain::Boolean(domain) => write!(f, "{domain}"), Domain::String(domain) => write!(f, "{domain}"), Domain::Timestamp(domain) => write!(f, "{domain}"), @@ -684,3 +738,39 @@ fn display_f64(num: f64) -> String { None => num.to_string(), } } + +fn display_decimal_128(num: i128, scale: u8) -> String { + let mut buf = String::new(); + if scale == 0 { + write!(buf, "{}", num).unwrap(); + } else { + let pow_scale = 10_i128.pow(scale as u32); + write!( + buf, + "{}.{:0>width$}", + num / pow_scale, + num % pow_scale, + width = scale as usize + ) + .unwrap(); + } + buf +} + +fn display_decimal_256(num: i256, scale: u8) -> String { + let mut buf = String::new(); + if scale == 0 { + write!(buf, "{}", num).unwrap(); + } else { + let pow_scale = i256::from(10).pow(scale as u32); + write!( + buf, + "{}.{:0>width$}", + num / pow_scale, + num % pow_scale, + width = scale as usize + ) + .unwrap(); + } + buf +} diff --git a/src/query/expression/src/values.rs b/src/query/expression/src/values.rs index 7b19b6673fe0c..7729725aed063 100755 --- a/src/query/expression/src/values.rs +++ b/src/query/expression/src/values.rs @@ -36,6 +36,10 @@ use crate::property::Domain; use crate::types::array::ArrayColumn; use crate::types::array::ArrayColumnBuilder; use crate::types::boolean::BooleanDomain; +use crate::types::decimal::DecimalColumn; +use crate::types::decimal::DecimalColumnBuilder; +use crate::types::decimal::DecimalDataType; +use crate::types::decimal::DecimalScalar; use crate::types::nullable::NullableColumn; use crate::types::nullable::NullableColumnBuilder; use crate::types::nullable::NullableDomain; @@ -56,8 +60,8 @@ use crate::utils::arrow::buffer_into_mut; use crate::utils::arrow::constant_bitmap; use crate::utils::arrow::deserialize_column; use crate::utils::arrow::serialize_column; +use crate::with_decimal_type; use crate::with_integer_mapped_type; -use crate::with_number_mapped_type; use crate::with_number_type; #[derive(Debug, Clone, PartialEq, EnumAsInner)] @@ -78,6 +82,7 @@ pub enum Scalar { Null, EmptyArray, Number(NumberScalar), + Decimal(DecimalScalar), Timestamp(i64), Date(i32), Boolean(bool), @@ -93,6 +98,7 @@ pub enum ScalarRef<'a> { Null, EmptyArray, Number(NumberScalar), + Decimal(DecimalScalar), Boolean(bool), String(&'a [u8]), Timestamp(i64), @@ -107,6 +113,7 @@ pub enum Column { Null { len: usize }, EmptyArray { len: usize }, Number(NumberColumn), + Decimal(DecimalColumn), Boolean(Bitmap), String(StringColumn), Timestamp(Buffer), @@ -126,6 +133,7 @@ pub enum ColumnBuilder { len: usize, }, Number(NumberColumnBuilder), + Decimal(DecimalColumnBuilder), Boolean(MutableBitmap), String(StringColumnBuilder), Timestamp(Vec), @@ -240,6 +248,7 @@ impl Scalar { Scalar::Null => ScalarRef::Null, Scalar::EmptyArray => ScalarRef::EmptyArray, Scalar::Number(n) => ScalarRef::Number(*n), + Scalar::Decimal(d) => ScalarRef::Decimal(*d), Scalar::Boolean(b) => ScalarRef::Boolean(*b), Scalar::String(s) => ScalarRef::String(s.as_slice()), Scalar::Timestamp(t) => ScalarRef::Timestamp(*t), @@ -257,6 +266,7 @@ impl<'a> ScalarRef<'a> { ScalarRef::Null => Scalar::Null, ScalarRef::EmptyArray => Scalar::EmptyArray, ScalarRef::Number(n) => Scalar::Number(*n), + ScalarRef::Decimal(d) => Scalar::Decimal(*d), ScalarRef::Boolean(b) => Scalar::Boolean(*b), ScalarRef::String(s) => Scalar::String(s.to_vec()), ScalarRef::Timestamp(t) => Scalar::Timestamp(*t), @@ -287,6 +297,7 @@ impl<'a> ScalarRef<'a> { }), ScalarRef::EmptyArray => Domain::Array(None), ScalarRef::Number(num) => Domain::Number(num.domain()), + ScalarRef::Decimal(dec) => Domain::Decimal(dec.domain()), ScalarRef::Boolean(true) => Domain::Boolean(BooleanDomain { has_false: false, has_true: true, @@ -335,6 +346,8 @@ impl<'a> ScalarRef<'a> { ScalarRef::Number(NumberScalar::Int16(_)) => 2, ScalarRef::Number(NumberScalar::Int32(_)) => 4, ScalarRef::Number(NumberScalar::Int64(_)) => 8, + ScalarRef::Decimal(DecimalScalar::Decimal128(_, _)) => 16, + ScalarRef::Decimal(DecimalScalar::Decimal256(_, _)) => 32, ScalarRef::Boolean(_) => 1, ScalarRef::String(s) => s.len(), ScalarRef::Timestamp(_) => 8, @@ -431,11 +444,16 @@ impl Hash for ScalarRef<'_> { fn hash(&self, state: &mut H) { match self { ScalarRef::Null | ScalarRef::EmptyArray => {} - ScalarRef::Number(t) => with_number_mapped_type!(|NUM_TYPE| match t { + ScalarRef::Number(t) => with_number_type!(|NUM_TYPE| match t { NumberScalar::NUM_TYPE(v) => { v.hash(state); } }), + ScalarRef::Decimal(t) => with_decimal_type!(|DECIMAL_TYPE| match t { + DecimalScalar::DECIMAL_TYPE(v, _) => { + v.hash(state); + } + }), ScalarRef::Boolean(v) => v.hash(state), ScalarRef::String(v) => v.hash(state), ScalarRef::Timestamp(v) => v.hash(state), @@ -465,13 +483,7 @@ impl PartialOrd for Column { (Column::EmptyArray { len: col1 }, Column::EmptyArray { len: col2 }) => { col1.partial_cmp(col2) } - (Column::Number(col1), Column::Number(col2)) => { - with_number_type!(|NUM_TYPE| match (col1, col2) { - (NumberColumn::NUM_TYPE(c1), NumberColumn::NUM_TYPE(c2)) => - c1.iter().partial_cmp(c2.iter()), - _ => None, - }) - } + (Column::Number(col1), Column::Number(col2)) => col1.partial_cmp(col2), (Column::Boolean(col1), Column::Boolean(col2)) => col1.iter().partial_cmp(col2.iter()), (Column::String(col1), Column::String(col2)) => col1.iter().partial_cmp(col2.iter()), (Column::Timestamp(col1), Column::Timestamp(col2)) => { @@ -508,6 +520,7 @@ impl Column { Column::Null { len } => *len, Column::EmptyArray { len } => *len, Column::Number(col) => col.len(), + Column::Decimal(col) => col.len(), Column::Boolean(col) => col.len(), Column::String(col) => col.len(), Column::Timestamp(col) => col.len(), @@ -524,6 +537,7 @@ impl Column { Column::Null { .. } => Some(ScalarRef::Null), Column::EmptyArray { .. } => Some(ScalarRef::EmptyArray), Column::Number(col) => Some(ScalarRef::Number(col.index(index)?)), + Column::Decimal(col) => Some(ScalarRef::Decimal(col.index(index)?)), Column::Boolean(col) => Some(ScalarRef::Boolean(col.get(index)?)), Column::String(col) => Some(ScalarRef::String(col.index(index)?)), Column::Timestamp(col) => Some(ScalarRef::Timestamp(col.get(index).cloned()?)), @@ -547,6 +561,7 @@ impl Column { Column::Null { .. } => ScalarRef::Null, Column::EmptyArray { .. } => ScalarRef::EmptyArray, Column::Number(col) => ScalarRef::Number(col.index_unchecked(index)), + Column::Decimal(col) => ScalarRef::Decimal(col.index_unchecked(index)), Column::Boolean(col) => ScalarRef::Boolean(col.get_bit_unchecked(index)), Column::String(col) => ScalarRef::String(col.index_unchecked(index)), Column::Timestamp(col) => ScalarRef::Timestamp(*col.get_unchecked(index)), @@ -586,6 +601,7 @@ impl Column { len: range.end - range.start, }, Column::Number(col) => Column::Number(col.slice(range)), + Column::Decimal(col) => Column::Decimal(col.slice(range)), Column::Boolean(col) => { Column::Boolean(col.clone().slice(range.start, range.end - range.start)) } @@ -626,6 +642,7 @@ impl Column { }), Column::EmptyArray { .. } => Domain::Array(None), Column::Number(col) => Domain::Number(col.domain()), + Column::Decimal(col) => Domain::Decimal(col.domain()), Column::Boolean(col) => Domain::Boolean(BooleanDomain { has_false: col.unset_bits() > 0, has_true: col.len() - col.unset_bits() > 0, @@ -681,6 +698,10 @@ impl Column { Column::Number(c) => with_number_type!(|NUM_TYPE| match c { NumberColumn::NUM_TYPE(_) => DataType::Number(NumberDataType::NUM_TYPE), }), + Column::Decimal(c) => with_decimal_type!(|DECIMAL_TYPE| match c { + DecimalColumn::DECIMAL_TYPE(_, size) => + DataType::Decimal(DecimalDataType::DECIMAL_TYPE(*size)), + }), Column::Boolean(_) => DataType::Boolean, Column::String(_) => DataType::String, Column::Timestamp(_) => DataType::Timestamp, @@ -803,6 +824,22 @@ impl Column { .unwrap(), ) } + Column::Decimal(DecimalColumn::Decimal128(col, _)) => Box::new( + common_arrow::arrow::array::PrimitiveArray::::try_new( + arrow_type, + col.clone(), + None, + ) + .unwrap(), + ), + Column::Decimal(DecimalColumn::Decimal256(col, _)) => Box::new( + common_arrow::arrow::array::PrimitiveArray::::try_new( + arrow_type, + col.iter().cloned().map(common_arrow::arrow::types::i256).collect::>().into(), + None, + ) + .unwrap(), + ), Column::Boolean(col) => Box::new( common_arrow::arrow::array::BooleanArray::try_new(arrow_type, col.clone(), None) .unwrap(), @@ -1205,6 +1242,8 @@ impl Column { Column::Number(NumberColumn::Int16(_)) => self.len() * 2, Column::Number(NumberColumn::Int32(_)) => self.len() * 4, Column::Number(NumberColumn::Int64(_)) => self.len() * 8, + Column::Decimal(DecimalColumn::Decimal128(_, _)) => self.len() * 16, + Column::Decimal(DecimalColumn::Decimal256(_, _)) => self.len() * 32, Column::Boolean(c) => c.as_slice().0.len(), Column::String(col) => col.data.len() + col.offsets.len() * 8, Column::Timestamp(col) => col.len() * 8, @@ -1271,6 +1310,7 @@ impl ColumnBuilder { Column::Null { len } => ColumnBuilder::Null { len }, Column::EmptyArray { len } => ColumnBuilder::EmptyArray { len }, Column::Number(col) => ColumnBuilder::Number(NumberColumnBuilder::from_column(col)), + Column::Decimal(col) => ColumnBuilder::Decimal(DecimalColumnBuilder::from_column(col)), Column::Boolean(col) => ColumnBuilder::Boolean(bitmap_into_mut(col)), Column::String(col) => ColumnBuilder::String(StringColumnBuilder::from_column(col)), Column::Timestamp(col) => ColumnBuilder::Timestamp(buffer_into_mut(col)), @@ -1323,6 +1363,9 @@ impl ColumnBuilder { }, ScalarRef::EmptyArray => ColumnBuilder::EmptyArray { len: n }, ScalarRef::Number(num) => ColumnBuilder::Number(NumberColumnBuilder::repeat(*num, n)), + ScalarRef::Decimal(dec) => { + ColumnBuilder::Decimal(DecimalColumnBuilder::repeat(*dec, n)) + } ScalarRef::Boolean(b) => ColumnBuilder::Boolean(constant_bitmap(*b, n)), ScalarRef::String(s) => ColumnBuilder::String(StringColumnBuilder::repeat(s, n)), ScalarRef::Timestamp(d) => ColumnBuilder::Timestamp(vec![*d; n]), @@ -1353,6 +1396,7 @@ impl ColumnBuilder { ColumnBuilder::Null { len } => *len, ColumnBuilder::EmptyArray { len } => *len, ColumnBuilder::Number(col) => col.len(), + ColumnBuilder::Decimal(col) => col.len(), ColumnBuilder::Boolean(builder) => builder.len(), ColumnBuilder::String(builder) => builder.len(), ColumnBuilder::Timestamp(builder) => builder.len(), @@ -1371,6 +1415,9 @@ impl ColumnBuilder { DataType::Number(num_ty) => { ColumnBuilder::Number(NumberColumnBuilder::with_capacity(num_ty, capacity)) } + DataType::Decimal(decimal_ty) => { + ColumnBuilder::Decimal(DecimalColumnBuilder::with_capacity(decimal_ty, capacity)) + } DataType::Boolean => ColumnBuilder::Boolean(MutableBitmap::with_capacity(capacity)), DataType::String => { ColumnBuilder::String(StringColumnBuilder::with_capacity(capacity, 0)) @@ -1455,6 +1502,7 @@ impl ColumnBuilder { ColumnBuilder::Null { len } => *len += 1, ColumnBuilder::EmptyArray { len } => *len += 1, ColumnBuilder::Number(builder) => builder.push_default(), + ColumnBuilder::Decimal(builder) => builder.push_default(), ColumnBuilder::Boolean(builder) => builder.push(false), ColumnBuilder::String(builder) => builder.commit_row(), ColumnBuilder::Timestamp(builder) => builder.push(0), @@ -1528,6 +1576,7 @@ impl ColumnBuilder { ColumnBuilder::Null { len } => Column::Null { len }, ColumnBuilder::EmptyArray { len } => Column::EmptyArray { len }, ColumnBuilder::Number(builder) => Column::Number(builder.build()), + ColumnBuilder::Decimal(builder) => Column::Decimal(builder.build()), ColumnBuilder::Boolean(builder) => Column::Boolean(builder.into()), ColumnBuilder::String(builder) => Column::String(builder.build()), ColumnBuilder::Timestamp(builder) => Column::Timestamp(builder.into()), @@ -1548,6 +1597,7 @@ impl ColumnBuilder { ColumnBuilder::Null { .. } => Scalar::Null, ColumnBuilder::EmptyArray { .. } => Scalar::EmptyArray, ColumnBuilder::Number(builder) => Scalar::Number(builder.build_scalar()), + ColumnBuilder::Decimal(builder) => Scalar::Decimal(builder.build_scalar()), ColumnBuilder::Boolean(builder) => Scalar::Boolean(builder.get(0)), ColumnBuilder::String(builder) => Scalar::String(builder.build_scalar()), ColumnBuilder::Timestamp(builder) => Scalar::Timestamp(builder[0]), diff --git a/src/query/expression/tests/it/testdata/kernel-pass.txt b/src/query/expression/tests/it/testdata/kernel-pass.txt index c1a7e87093d44..b8d72cb9941b2 100644 --- a/src/query/expression/tests/it/testdata/kernel-pass.txt +++ b/src/query/expression/tests/it/testdata/kernel-pass.txt @@ -3,18 +3,18 @@ Source: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ @@ -23,17 +23,17 @@ Source: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 1_i32 | 11_u8 | NULL | "y" | +| 1 | 11 | NULL | "y" | +----------+----------+----------+----------+ @@ -42,19 +42,19 @@ Source: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ @@ -63,19 +63,19 @@ Source: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +----------+----------+----------+----------+ @@ -103,13 +103,13 @@ Result: +----------+----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | +----------+----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | [] | NULL | -| 1_i32 | 11_u8 | NULL | [] | "y" | -| 2_i32 | NULL | NULL | [] | "z" | -| 3_i32 | NULL | NULL | [] | NULL | -| -4_i32 | NULL | NULL | [] | NULL | -| 5_i32 | NULL | NULL | [] | NULL | -| 6_i32 | 16_u8 | NULL | [] | "y" | +| 0 | NULL | NULL | [] | NULL | +| 1 | 11 | NULL | [] | "y" | +| 2 | NULL | NULL | [] | "z" | +| 3 | NULL | NULL | [] | NULL | +| -4 | NULL | NULL | [] | NULL | +| 5 | NULL | NULL | [] | NULL | +| 6 | 16 | NULL | [] | "y" | +----------+----------+----------+----------+----------+ @@ -118,19 +118,19 @@ Source: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 3_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | +| 0 | NULL | NULL | NULL | +| 3 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +----------+----------+----------+----------+ @@ -139,48 +139,48 @@ Block0: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | -| 10_u8 | NULL | -| 10_u8 | NULL | +| 10 | 10 | +| 10 | 10 | +| 10 | NULL | +| 10 | NULL | +----------+----------+ Block1: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 11_u8 | 11_u8 | -| 11_u8 | 11_u8 | -| 11_u8 | NULL | -| 11_u8 | NULL | +| 11 | 11 | +| 11 | 11 | +| 11 | NULL | +| 11 | NULL | +----------+----------+ Block2: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 12_u8 | 12_u8 | -| 12_u8 | 12_u8 | -| 12_u8 | NULL | -| 12_u8 | NULL | +| 12 | 12 | +| 12 | 12 | +| 12 | NULL | +| 12 | NULL | +----------+----------+ Result: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 10_u8 | 10_u8 | -| 11_u8 | 11_u8 | -| 12_u8 | 12_u8 | -| 10_u8 | 10_u8 | -| 11_u8 | 11_u8 | -| 12_u8 | 12_u8 | -| 10_u8 | NULL | -| 11_u8 | NULL | -| 12_u8 | NULL | -| 10_u8 | NULL | -| 11_u8 | NULL | -| 12_u8 | NULL | -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | +| 10 | 10 | +| 11 | 11 | +| 12 | 12 | +| 10 | 10 | +| 11 | 11 | +| 12 | 12 | +| 10 | NULL | +| 11 | NULL | +| 12 | NULL | +| 10 | NULL | +| 11 | NULL | +| 12 | NULL | +| 10 | 10 | +| 10 | 10 | +| 10 | 10 | +----------+----------+ @@ -189,44 +189,44 @@ Block0: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | -| 10_u8 | NULL | -| 10_u8 | NULL | +| 10 | 10 | +| 10 | 10 | +| 10 | NULL | +| 10 | NULL | +----------+----------+ Block1: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 11_u8 | 11_u8 | -| 11_u8 | 11_u8 | -| 11_u8 | NULL | -| 11_u8 | NULL | +| 11 | 11 | +| 11 | 11 | +| 11 | NULL | +| 11 | NULL | +----------+----------+ Block2: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 12_u8 | 12_u8 | -| 12_u8 | 12_u8 | -| 12_u8 | NULL | -| 12_u8 | NULL | +| 12 | 12 | +| 12 | 12 | +| 12 | NULL | +| 12 | NULL | +----------+----------+ Result: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | -| 11_u8 | 11_u8 | -| 11_u8 | 11_u8 | -| 11_u8 | NULL | -| 12_u8 | 12_u8 | -| 12_u8 | 12_u8 | -| 10_u8 | NULL | -| 12_u8 | NULL | -| 10_u8 | NULL | -| 12_u8 | NULL | +| 10 | 10 | +| 10 | 10 | +| 11 | 11 | +| 11 | 11 | +| 11 | NULL | +| 12 | 12 | +| 12 | 12 | +| 10 | NULL | +| 12 | NULL | +| 10 | NULL | +| 12 | NULL | +----------+----------+ @@ -235,37 +235,37 @@ Block0: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | -| 10_u8 | NULL | -| 10_u8 | NULL | +| 10 | 10 | +| 10 | 10 | +| 10 | NULL | +| 10 | NULL | +----------+----------+ Block1: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 11_u8 | 11_u8 | -| 11_u8 | 11_u8 | -| 11_u8 | NULL | -| 11_u8 | NULL | +| 11 | 11 | +| 11 | 11 | +| 11 | NULL | +| 11 | NULL | +----------+----------+ Block2: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 12_u8 | 12_u8 | -| 12_u8 | 12_u8 | -| 12_u8 | NULL | -| 12_u8 | NULL | +| 12 | 12 | +| 12 | 12 | +| 12 | NULL | +| 12 | NULL | +----------+----------+ Result: +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| 10_u8 | 10_u8 | -| 10_u8 | 10_u8 | -| 11_u8 | 11_u8 | -| 11_u8 | 11_u8 | +| 10 | 10 | +| 10 | 10 | +| 11 | 11 | +| 11 | 11 | +----------+----------+ @@ -274,19 +274,19 @@ Block: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ @@ -295,18 +295,18 @@ Block: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +----------+----------+----------+----------+ @@ -315,31 +315,31 @@ Source: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | -| 2_i32 | NULL | NULL | "z" | -| 3_i32 | NULL | NULL | NULL | -| -4_i32 | NULL | NULL | NULL | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +| 2 | NULL | NULL | "z" | +| 3 | NULL | NULL | NULL | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result-0: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 0_i32 | NULL | NULL | NULL | -| 1_i32 | 11_u8 | NULL | "y" | +| 0 | NULL | NULL | NULL | +| 1 | 11 | NULL | "y" | +----------+----------+----------+----------+ Result-1: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 2_i32 | NULL | NULL | "z" | -| -4_i32 | NULL | NULL | NULL | +| 2 | NULL | NULL | "z" | +| -4 | NULL | NULL | NULL | +----------+----------+----------+----------+ Result-2: +----------+----------+----------+----------+ | Column 0 | Column 1 | Column 2 | Column 3 | +----------+----------+----------+----------+ -| 3_i32 | NULL | NULL | NULL | +| 3 | NULL | NULL | NULL | +----------+----------+----------+----------+ diff --git a/src/query/formats/src/field_encoder/row_based.rs b/src/query/formats/src/field_encoder/row_based.rs index 95c556660fa09..9fe6665b32e62 100644 --- a/src/query/formats/src/field_encoder/row_based.rs +++ b/src/query/formats/src/field_encoder/row_based.rs @@ -50,6 +50,7 @@ pub trait FieldEncoderRowBased { NumberColumn::Float32(c) => self.write_float(c, row_index, out_buf, raw), NumberColumn::Float64(c) => self.write_float(c, row_index, out_buf, raw), }, + Column::Decimal(_) => todo!("decimal"), Column::Date(c) => self.write_date(c, row_index, out_buf, raw), Column::Timestamp(c) => self.write_timestamp(c, row_index, out_buf, raw), Column::String(c) => self.write_string(c, row_index, out_buf, raw), diff --git a/src/query/formats/src/output_format/json.rs b/src/query/formats/src/output_format/json.rs index 504071b082905..16c4430b35247 100644 --- a/src/query/formats/src/output_format/json.rs +++ b/src/query/formats/src/output_format/json.rs @@ -78,7 +78,6 @@ fn scalar_to_json(s: ScalarRef<'_>, format: &FormatSettings) -> JsonValue { NumberScalar::UInt16(v) => JsonValue::Number(v.into()), NumberScalar::UInt32(v) => JsonValue::Number(v.into()), NumberScalar::UInt64(v) => JsonValue::Number(v.into()), - NumberScalar::Float32(v) => { JsonValue::Number(serde_json::Number::from_f64(f32::from(v) as f64).unwrap()) } @@ -86,6 +85,7 @@ fn scalar_to_json(s: ScalarRef<'_>, format: &FormatSettings) -> JsonValue { JsonValue::Number(serde_json::Number::from_f64(v.into()).unwrap()) } }, + ScalarRef::Decimal(_) => todo!("decimal"), ScalarRef::Date(v) => { let dt = DateConverter::to_date(&v, format.timezone); serde_json::to_value(dt.format("%Y-%m-%d").to_string()).unwrap() diff --git a/src/query/functions/src/scalars/datetime.rs b/src/query/functions/src/scalars/datetime.rs index b017013faf0aa..0b63e02c563a7 100644 --- a/src/query/functions/src/scalars/datetime.rs +++ b/src/query/functions/src/scalars/datetime.rs @@ -403,7 +403,7 @@ fn register_to_number(registry: &mut FunctionRegistry) { registry.register_passthrough_nullable_1_arg::, _, _>( "to_int64", FunctionProperty::default(), - |domain| FunctionDomain::Domain(domain.clone()), + |domain| FunctionDomain::Domain(*domain), |val, _| match val { ValueRef::Scalar(scalar) => Value::Scalar(scalar), ValueRef::Column(col) => Value::Column(col), @@ -423,7 +423,7 @@ fn register_to_number(registry: &mut FunctionRegistry) { |domain| { FunctionDomain::Domain(NullableDomain { has_null: false, - value: Some(Box::new(domain.clone())), + value: Some(Box::new(*domain)), }) }, |val, _| match val { diff --git a/src/query/functions/src/scalars/math.rs b/src/query/functions/src/scalars/math.rs index 3077afd284903..79242d7036df9 100644 --- a/src/query/functions/src/scalars/math.rs +++ b/src/query/functions/src/scalars/math.rs @@ -155,7 +155,7 @@ pub fn register(registry: &mut FunctionRegistry) { registry.register_1_arg::, NumberType, _, _>( "abs", FunctionProperty::default(), - |domain| FunctionDomain::Domain(domain.clone()), + |domain| FunctionDomain::Domain(*domain), |val, _| val, ); diff --git a/src/query/functions/src/scalars/variant.rs b/src/query/functions/src/scalars/variant.rs index da38fcdd1c3fe..6e9a993a57cf5 100644 --- a/src/query/functions/src/scalars/variant.rs +++ b/src/query/functions/src/scalars/variant.rs @@ -64,8 +64,6 @@ use common_jsonb::to_i64; use common_jsonb::to_str; use common_jsonb::to_u64; use common_jsonb::JsonPathRef; -use common_jsonb::Number as JsonbNumber; -use common_jsonb::Value as JsonbValue; pub fn register(registry: &mut FunctionRegistry) { registry.register_passthrough_nullable_1_arg::( @@ -126,131 +124,6 @@ pub fn register(registry: &mut FunctionRegistry) { }), ); - registry.register_passthrough_nullable_1_arg::( - "parse_json", - FunctionProperty::default(), - |_| FunctionDomain::Full, - vectorize_with_builder_1_arg::(|s, output, _| { - let value = if s { - JsonbValue::Bool(true) - } else { - JsonbValue::Bool(false) - }; - value.write_to_vec(&mut output.data); - output.commit_row(); - }), - ); - - registry.register_combine_nullable_1_arg::( - "try_parse_json", - FunctionProperty::default(), - |_| { - FunctionDomain::Domain(NullableDomain { - has_null: false, - value: Some(Box::new(())), - }) - }, - vectorize_with_builder_1_arg::>(|s, output, _| { - let value = if s { - JsonbValue::Bool(true) - } else { - JsonbValue::Bool(false) - }; - output.validity.push(true); - value.write_to_vec(&mut output.builder.data); - output.builder.commit_row(); - }), - ); - - registry.register_combine_nullable_1_arg::( - "check_json", - FunctionProperty::default(), - |_| { - FunctionDomain::Domain(NullableDomain { - has_null: true, - value: None, - }) - }, - vectorize_with_builder_1_arg::>(|_, output, _| { - output.push_null(); - }), - ); - - for src_type in ALL_NUMERICS_TYPES { - with_number_mapped_type!(|NUM_TYPE| match src_type { - NumberDataType::NUM_TYPE => { - registry - .register_passthrough_nullable_1_arg::, VariantType, _, _>( - "parse_json", - FunctionProperty::default(), - |_| FunctionDomain::Full, - vectorize_with_builder_1_arg::, VariantType>( - move |s, output, _| { - let value = if src_type.is_float() { - let v = num_traits::cast::cast(s).unwrap(); - JsonbValue::Number(JsonbNumber::Float64(v)) - } else if src_type.is_signed() { - let v = num_traits::cast::cast(s).unwrap(); - JsonbValue::Number(JsonbNumber::Int64(v)) - } else { - let v = num_traits::cast::cast(s).unwrap(); - JsonbValue::Number(JsonbNumber::UInt64(v)) - }; - value.write_to_vec(&mut output.data); - output.commit_row(); - }, - ), - ); - - registry - .register_combine_nullable_1_arg::, VariantType, _, _>( - "try_parse_json", - FunctionProperty::default(), - |_| { - FunctionDomain::Domain(NullableDomain { - has_null: false, - value: Some(Box::new(())), - }) - }, - vectorize_with_builder_1_arg::< - NumberType, - NullableType, - >(move |s, output, _ctx| { - let value = if src_type.is_float() { - let v = num_traits::cast::cast(s).unwrap(); - JsonbValue::Number(JsonbNumber::Float64(v)) - } else if src_type.is_signed() { - let v = num_traits::cast::cast(s).unwrap(); - JsonbValue::Number(JsonbNumber::Int64(v)) - } else { - let v = num_traits::cast::cast(s).unwrap(); - JsonbValue::Number(JsonbNumber::UInt64(v)) - }; - output.validity.push(true); - value.write_to_vec(&mut output.builder.data); - output.builder.commit_row(); - }), - ); - - registry.register_combine_nullable_1_arg::, StringType, _, _>( - "check_json", - FunctionProperty::default(), - |_| { - FunctionDomain::Domain(NullableDomain { - has_null: true, - value: None, - }) - }, - vectorize_with_builder_1_arg::, NullableType>( - |_, output, _| { - output.push_null(); - }, - ), - ); - } - }); - } - registry.register_1_arg_core::, NullableType, _, _>( "length", FunctionProperty::default(), diff --git a/src/query/functions/tests/it/scalars/testdata/arithmetic.txt b/src/query/functions/tests/it/scalars/testdata/arithmetic.txt index ed3e9aceab5b6..b03b7e654bd81 100644 --- a/src/query/functions/tests/it/scalars/testdata/arithmetic.txt +++ b/src/query/functions/tests/it/scalars/testdata/arithmetic.txt @@ -7,9 +7,9 @@ evaluation: +--------+---------+---------+---------+ | Type | Int8 | Int16 | Int32 | | Domain | {1..=3} | {2..=6} | {3..=9} | -| Row 0 | 1_i8 | 2_i16 | 3_i32 | -| Row 1 | 2_i8 | 4_i16 | 6_i32 | -| Row 2 | 3_i8 | 6_i16 | 9_i32 | +| Row 0 | 1 | 2 | 3 | +| Row 1 | 2 | 4 | 6 | +| Row 2 | 3 | 6 | 9 | +--------+---------+---------+---------+ evaluation (internal): +--------+------------------+ @@ -31,8 +31,8 @@ evaluation: +--------+------------------+--------------------+ | Type | UInt8 NULL | UInt16 NULL | | Domain | {1..=3} ∪ {NULL} | {11..=13} ∪ {NULL} | -| Row 0 | 1_u8 | 11_u16 | -| Row 1 | 2_u8 | 12_u16 | +| Row 0 | 1 | 11 | +| Row 1 | 2 | 12 | | Row 2 | NULL | NULL | +--------+------------------+--------------------+ evaluation (internal): @@ -53,9 +53,9 @@ evaluation: +--------+------------------+-----------+--------------------+ | Type | UInt8 NULL | UInt32 | UInt64 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} | {11..=33} ∪ {NULL} | -| Row 0 | 1_u8 | 10_u32 | 11_u64 | -| Row 1 | 2_u8 | 20_u32 | 22_u64 | -| Row 2 | NULL | 30_u32 | NULL | +| Row 0 | 1 | 10 | 11 | +| Row 1 | 2 | 20 | 22 | +| Row 2 | NULL | 30 | NULL | +--------+------------------+-----------+--------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------+ @@ -76,9 +76,9 @@ evaluation: +--------+---------+-----------+-----------+ | Type | Int16 | UInt32 | Int64 | | Domain | {2..=6} | {10..=30} | {12..=36} | -| Row 0 | 2_i16 | 10_u32 | 12_i64 | -| Row 1 | 4_i16 | 20_u32 | 24_i64 | -| Row 2 | 6_i16 | 30_u32 | 36_i64 | +| Row 0 | 2 | 10 | 12 | +| Row 1 | 4 | 20 | 24 | +| Row 2 | 6 | 30 | 36 | +--------+---------+-----------+-----------+ evaluation (internal): +--------+----------------------+ @@ -99,9 +99,9 @@ evaluation: +--------+-----------+------------+------------+ | Type | UInt32 | Float64 | Float64 | | Domain | {10..=30} | {-20..=30} | {-10..=60} | -| Row 0 | 10_u32 | 10_f64 | 20_f64 | -| Row 1 | 20_u32 | -20_f64 | 0_f64 | -| Row 2 | 30_u32 | 30_f64 | 60_f64 | +| Row 0 | 10 | 10 | 20 | +| Row 1 | 20 | -20 | 0 | +| Row 2 | 30 | 30 | 60 | +--------+-----------+------------+------------+ evaluation (internal): +--------+------------------------+ @@ -122,9 +122,9 @@ evaluation: +--------+---------+---------+----------+ | Type | Int8 | Int16 | Int32 | | Domain | {1..=3} | {2..=6} | {-5..=1} | -| Row 0 | 1_i8 | 2_i16 | -1_i32 | -| Row 1 | 2_i8 | 4_i16 | -2_i32 | -| Row 2 | 3_i8 | 6_i16 | -3_i32 | +| Row 0 | 1 | 2 | -1 | +| Row 1 | 2 | 4 | -2 | +| Row 2 | 3 | 6 | -3 | +--------+---------+---------+----------+ evaluation (internal): +--------+---------------------+ @@ -146,8 +146,8 @@ evaluation: +--------+------------------+--------------------+ | Type | UInt8 NULL | Int16 NULL | | Domain | {1..=3} ∪ {NULL} | {-9..=-7} ∪ {NULL} | -| Row 0 | 1_u8 | -9_i16 | -| Row 1 | 2_u8 | -8_i16 | +| Row 0 | 1 | -9 | +| Row 1 | 2 | -8 | | Row 2 | NULL | NULL | +--------+------------------+--------------------+ evaluation (internal): @@ -168,9 +168,9 @@ evaluation: +--------+------------------+-----------+---------------------+ | Type | UInt8 NULL | UInt32 | Int64 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} | {-29..=-7} ∪ {NULL} | -| Row 0 | 1_u8 | 10_u32 | -9_i64 | -| Row 1 | 2_u8 | 20_u32 | -18_i64 | -| Row 2 | NULL | 30_u32 | NULL | +| Row 0 | 1 | 10 | -9 | +| Row 1 | 2 | 20 | -18 | +| Row 2 | NULL | 30 | NULL | +--------+------------------+-----------+---------------------+ evaluation (internal): +--------+--------------------------------------------------------------------------+ @@ -191,9 +191,9 @@ evaluation: +--------+---------+-----------+----------+ | Type | Int16 | UInt32 | Int64 | | Domain | {2..=6} | {10..=30} | {4..=28} | -| Row 0 | 2_i16 | 10_u32 | 8_i64 | -| Row 1 | 4_i16 | 20_u32 | 16_i64 | -| Row 2 | 6_i16 | 30_u32 | 24_i64 | +| Row 0 | 2 | 10 | 8 | +| Row 1 | 4 | 20 | 16 | +| Row 2 | 6 | 30 | 24 | +--------+---------+-----------+----------+ evaluation (internal): +--------+----------------------+ @@ -214,9 +214,9 @@ evaluation: +--------+-----------+------------+------------+ | Type | UInt32 | Float64 | Float64 | | Domain | {10..=30} | {-20..=30} | {-20..=50} | -| Row 0 | 10_u32 | 10_f64 | 0_f64 | -| Row 1 | 20_u32 | -20_f64 | 40_f64 | -| Row 2 | 30_u32 | 30_f64 | 0_f64 | +| Row 0 | 10 | 10 | 0 | +| Row 1 | 20 | -20 | 40 | +| Row 2 | 30 | 30 | 0 | +--------+-----------+------------+------------+ evaluation (internal): +--------+------------------------+ @@ -237,9 +237,9 @@ evaluation: +--------+-----------+-------------+ | Type | UInt32 | Int64 | | Domain | {10..=30} | {-30..=-10} | -| Row 0 | 10_u32 | -10_i64 | -| Row 1 | 20_u32 | -20_i64 | -| Row 2 | 30_u32 | -30_i64 | +| Row 0 | 10 | -10 | +| Row 1 | 20 | -20 | +| Row 2 | 30 | -30 | +--------+-----------+-------------+ evaluation (internal): +--------+------------------------+ @@ -259,9 +259,9 @@ evaluation: +--------+---------+---------+----------+ | Type | Int8 | Int16 | Int32 | | Domain | {1..=3} | {2..=6} | {2..=18} | -| Row 0 | 1_i8 | 2_i16 | 2_i32 | -| Row 1 | 2_i8 | 4_i16 | 8_i32 | -| Row 2 | 3_i8 | 6_i16 | 18_i32 | +| Row 0 | 1 | 2 | 2 | +| Row 1 | 2 | 4 | 8 | +| Row 2 | 3 | 6 | 18 | +--------+---------+---------+----------+ evaluation (internal): +--------+-------------------+ @@ -283,8 +283,8 @@ evaluation: +--------+------------------+--------------------+ | Type | UInt8 NULL | UInt16 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} ∪ {NULL} | -| Row 0 | 1_u8 | 10_u16 | -| Row 1 | 2_u8 | 20_u16 | +| Row 0 | 1 | 10 | +| Row 1 | 2 | 20 | | Row 2 | NULL | NULL | +--------+------------------+--------------------+ evaluation (internal): @@ -305,9 +305,9 @@ evaluation: +--------+------------------+-----------+--------------------+ | Type | UInt8 NULL | UInt32 | UInt64 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} | {10..=90} ∪ {NULL} | -| Row 0 | 1_u8 | 10_u32 | 10_u64 | -| Row 1 | 2_u8 | 20_u32 | 40_u64 | -| Row 2 | NULL | 30_u32 | NULL | +| Row 0 | 1 | 10 | 10 | +| Row 1 | 2 | 20 | 40 | +| Row 2 | NULL | 30 | NULL | +--------+------------------+-----------+--------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------+ @@ -328,9 +328,9 @@ evaluation: +--------+---------+-----------+------------+ | Type | Int16 | UInt32 | Int64 | | Domain | {2..=6} | {10..=30} | {20..=180} | -| Row 0 | 2_i16 | 10_u32 | 20_i64 | -| Row 1 | 4_i16 | 20_u32 | 80_i64 | -| Row 2 | 6_i16 | 30_u32 | 180_i64 | +| Row 0 | 2 | 10 | 20 | +| Row 1 | 4 | 20 | 80 | +| Row 2 | 6 | 30 | 180 | +--------+---------+-----------+------------+ evaluation (internal): +--------+----------------------+ @@ -351,9 +351,9 @@ evaluation: +--------+-----------+------------+--------------+ | Type | UInt32 | Float64 | Float64 | | Domain | {10..=30} | {-20..=30} | {-600..=900} | -| Row 0 | 10_u32 | 10_f64 | 100_f64 | -| Row 1 | 20_u32 | -20_f64 | -400_f64 | -| Row 2 | 30_u32 | 30_f64 | 900_f64 | +| Row 0 | 10 | 10 | 100 | +| Row 1 | 20 | -20 | -400 | +| Row 2 | 30 | 30 | 900 | +--------+-----------+------------+--------------+ evaluation (internal): +--------+---------------------------+ @@ -374,9 +374,9 @@ evaluation: +--------+---------+---------+---------+ | Type | Int8 | Int16 | Float64 | | Domain | {1..=3} | {2..=6} | Unknown | -| Row 0 | 1_i8 | 2_i16 | 0.5_f64 | -| Row 1 | 2_i8 | 4_i16 | 0.5_f64 | -| Row 2 | 3_i8 | 6_i16 | 0.5_f64 | +| Row 0 | 1 | 2 | 0.5 | +| Row 1 | 2 | 4 | 0.5 | +| Row 2 | 3 | 6 | 0.5 | +--------+---------+---------+---------+ evaluation (internal): +--------+--------------------------+ @@ -398,8 +398,8 @@ evaluation: +--------+------------------+--------------+ | Type | UInt8 NULL | Float64 NULL | | Domain | {1..=3} ∪ {NULL} | Unknown | -| Row 0 | 1_u8 | 0.1_f64 | -| Row 1 | 2_u8 | 0.2_f64 | +| Row 0 | 1 | 0.1 | +| Row 1 | 2 | 0.2 | | Row 2 | NULL | NULL | +--------+------------------+--------------+ evaluation (internal): @@ -420,9 +420,9 @@ evaluation: +--------+------------------+-----------+--------------+ | Type | UInt8 NULL | UInt32 | Float64 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} | Unknown | -| Row 0 | 1_u8 | 10_u32 | 0.1_f64 | -| Row 1 | 2_u8 | 20_u32 | 0.1_f64 | -| Row 2 | NULL | 30_u32 | NULL | +| Row 0 | 1 | 10 | 0.1 | +| Row 1 | 2 | 20 | 0.1 | +| Row 2 | NULL | 30 | NULL | +--------+------------------+-----------+--------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------+ @@ -443,9 +443,9 @@ evaluation: +--------+---------+-----------+---------+ | Type | Int16 | UInt32 | Float64 | | Domain | {2..=6} | {10..=30} | Unknown | -| Row 0 | 2_i16 | 10_u32 | 5_f64 | -| Row 1 | 4_i16 | 20_u32 | 5_f64 | -| Row 2 | 6_i16 | 30_u32 | 5_f64 | +| Row 0 | 2 | 10 | 5 | +| Row 1 | 4 | 20 | 5 | +| Row 2 | 6 | 30 | 5 | +--------+---------+-----------+---------+ evaluation (internal): +--------+----------------------+ @@ -466,9 +466,9 @@ evaluation: +--------+-----------+------------+---------+ | Type | UInt32 | Float64 | Float64 | | Domain | {10..=30} | {-20..=30} | Unknown | -| Row 0 | 10_u32 | 10_f64 | 1_f64 | -| Row 1 | 20_u32 | -20_f64 | -1_f64 | -| Row 2 | 30_u32 | 30_f64 | 1_f64 | +| Row 0 | 10 | 10 | 1 | +| Row 1 | 20 | -20 | -1 | +| Row 2 | 30 | 30 | 1 | +--------+-----------+------------+---------+ evaluation (internal): +--------+------------------------+ @@ -489,9 +489,9 @@ evaluation: +--------+---------+------------------+--------------+ | Type | Int16 | UInt8 NULL | Float64 NULL | | Domain | {2..=6} | {0..=3} ∪ {NULL} | Unknown | -| Row 0 | 2_i16 | 1_u8 | 2_f64 | -| Row 1 | 4_i16 | NULL | NULL | -| Row 2 | 6_i16 | 3_u8 | 2_f64 | +| Row 0 | 2 | 1 | 2 | +| Row 1 | 4 | NULL | NULL | +| Row 2 | 6 | 3 | 2 | +--------+---------+------------------+--------------+ evaluation (internal): +--------+-----------------------------------------------------------------------+ @@ -507,7 +507,7 @@ error: --> SQL:1:5 | 1 | 2.0 / 0 - | ^ divided by zero while evaluating function `divide(2_f64, 0_u8)` + | ^ divided by zero while evaluating function `divide(2, 0)` @@ -520,9 +520,9 @@ evaluation: +--------+---------+---------+---------+ | Type | Int8 | Int16 | Int16 | | Domain | {1..=3} | {2..=6} | Unknown | -| Row 0 | 1_i8 | 2_i16 | 0_i16 | -| Row 1 | 2_i8 | 4_i16 | 0_i16 | -| Row 2 | 3_i8 | 6_i16 | 0_i16 | +| Row 0 | 1 | 2 | 0 | +| Row 1 | 2 | 4 | 0 | +| Row 2 | 3 | 6 | 0 | +--------+---------+---------+---------+ evaluation (internal): +--------+------------------+ @@ -544,8 +544,8 @@ evaluation: +--------+------------------+------------+ | Type | UInt8 NULL | UInt8 NULL | | Domain | {1..=3} ∪ {NULL} | Unknown | -| Row 0 | 1_u8 | 0_u8 | -| Row 1 | 2_u8 | 0_u8 | +| Row 0 | 1 | 0 | +| Row 1 | 2 | 0 | | Row 2 | NULL | NULL | +--------+------------------+------------+ evaluation (internal): @@ -566,9 +566,9 @@ evaluation: +--------+------------------+-----------+-------------+ | Type | UInt8 NULL | UInt32 | UInt32 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} | Unknown | -| Row 0 | 1_u8 | 10_u32 | 0_u32 | -| Row 1 | 2_u8 | 20_u32 | 0_u32 | -| Row 2 | NULL | 30_u32 | NULL | +| Row 0 | 1 | 10 | 0 | +| Row 1 | 2 | 20 | 0 | +| Row 2 | NULL | 30 | NULL | +--------+------------------+-----------+-------------+ evaluation (internal): +--------+----------------------------------------------------------------------+ @@ -589,9 +589,9 @@ evaluation: +--------+---------+-----------+---------+ | Type | Int16 | UInt32 | Int32 | | Domain | {2..=6} | {10..=30} | Unknown | -| Row 0 | 2_i16 | 10_u32 | 5_i32 | -| Row 1 | 4_i16 | 20_u32 | 5_i32 | -| Row 2 | 6_i16 | 30_u32 | 5_i32 | +| Row 0 | 2 | 10 | 5 | +| Row 1 | 4 | 20 | 5 | +| Row 2 | 6 | 30 | 5 | +--------+---------+-----------+---------+ evaluation (internal): +--------+----------------------+ @@ -612,9 +612,9 @@ evaluation: +--------+-----------+------------+---------+ | Type | UInt32 | Float64 | Int64 | | Domain | {10..=30} | {-20..=30} | Unknown | -| Row 0 | 10_u32 | 10_f64 | 1_i64 | -| Row 1 | 20_u32 | -20_f64 | -1_i64 | -| Row 2 | 30_u32 | 30_f64 | 1_i64 | +| Row 0 | 10 | 10 | 1 | +| Row 1 | 20 | -20 | -1 | +| Row 2 | 30 | 30 | 1 | +--------+-----------+------------+---------+ evaluation (internal): +--------+------------------------+ @@ -635,9 +635,9 @@ evaluation: +--------+-----------+------------------+-------------+ | Type | UInt32 | UInt8 NULL | UInt32 NULL | | Domain | {10..=30} | {0..=3} ∪ {NULL} | Unknown | -| Row 0 | 10_u32 | 1_u8 | 10_u32 | -| Row 1 | 20_u32 | NULL | NULL | -| Row 2 | 30_u32 | 3_u8 | 10_u32 | +| Row 0 | 10 | 1 | 10 | +| Row 1 | 20 | NULL | NULL | +| Row 2 | 30 | 3 | 10 | +--------+-----------+------------------+-------------+ evaluation (internal): +--------+------------------------------------------------------------------------+ @@ -653,7 +653,7 @@ error: --> SQL:1:3 | 1 | c div 0 - | ^^^ divided by zero while evaluating function `div(10_u32, 0_u8)` + | ^^^ divided by zero while evaluating function `div(10, 0)` @@ -666,9 +666,9 @@ evaluation: +--------+---------+---------+---------+ | Type | Int8 | Int16 | Int32 | | Domain | {1..=3} | {2..=6} | Unknown | -| Row 0 | 1_i8 | 2_i16 | 0_i32 | -| Row 1 | 2_i8 | 4_i16 | 1_i32 | -| Row 2 | 3_i8 | 6_i16 | 0_i32 | +| Row 0 | 1 | 2 | 0 | +| Row 1 | 2 | 4 | 1 | +| Row 2 | 3 | 6 | 0 | +--------+---------+---------+---------+ evaluation (internal): +--------+------------------+ @@ -690,8 +690,8 @@ evaluation: +--------+------------------+------------+ | Type | UInt8 NULL | UInt8 NULL | | Domain | {1..=3} ∪ {NULL} | Unknown | -| Row 0 | 1_u8 | 1_u8 | -| Row 1 | 2_u8 | 2_u8 | +| Row 0 | 1 | 1 | +| Row 1 | 2 | 2 | | Row 2 | NULL | NULL | +--------+------------------+------------+ evaluation (internal): @@ -713,9 +713,9 @@ evaluation: +--------+------------------+-----------+-------------+ | Type | UInt8 NULL | UInt32 | UInt32 NULL | | Domain | {1..=3} ∪ {NULL} | {10..=30} | Unknown | -| Row 0 | 1_u8 | 10_u32 | 5_u32 | -| Row 1 | 2_u8 | 20_u32 | 6_u32 | -| Row 2 | NULL | 30_u32 | NULL | +| Row 0 | 1 | 10 | 5 | +| Row 1 | 2 | 20 | 6 | +| Row 2 | NULL | 30 | NULL | +--------+------------------+-----------+-------------+ evaluation (internal): +--------+----------------------------------------------------------------------+ @@ -736,9 +736,9 @@ evaluation: +--------+---------+-----------+---------+ | Type | Int16 | UInt32 | UInt32 | | Domain | {2..=6} | {10..=30} | Unknown | -| Row 0 | 2_i16 | 10_u32 | 0_u32 | -| Row 1 | 4_i16 | 20_u32 | 6_u32 | -| Row 2 | 6_i16 | 30_u32 | 3_u32 | +| Row 0 | 2 | 10 | 0 | +| Row 1 | 4 | 20 | 6 | +| Row 2 | 6 | 30 | 3 | +--------+---------+-----------+---------+ evaluation (internal): +--------+----------------------+ @@ -759,9 +759,9 @@ evaluation: +--------+-----------+------------+---------+ | Type | UInt32 | Float64 | Float64 | | Domain | {10..=30} | {-20..=30} | Unknown | -| Row 0 | 10_u32 | 10_f64 | 3_f64 | -| Row 1 | 20_u32 | -20_f64 | 20_f64 | -| Row 2 | 30_u32 | 30_f64 | 3_f64 | +| Row 0 | 10 | 10 | 3 | +| Row 1 | 20 | -20 | 20 | +| Row 2 | 30 | 30 | 3 | +--------+-----------+------------+---------+ evaluation (internal): +--------+------------------------+ @@ -777,7 +777,7 @@ error: --> SQL:1:3 | 1 | c % 0 - | ^ Division by zero while evaluating function `modulo(10_u32, 0_u8)` + | ^ Division by zero while evaluating function `modulo(10, 0)` @@ -790,9 +790,9 @@ evaluation: +--------+-----------+------------------+------------+ | Type | UInt32 | UInt8 NULL | UInt8 NULL | | Domain | {10..=30} | {0..=3} ∪ {NULL} | Unknown | -| Row 0 | 10_u32 | 1_u8 | 0_u8 | -| Row 1 | 20_u32 | NULL | NULL | -| Row 2 | 30_u32 | 3_u8 | 0_u8 | +| Row 0 | 10 | 1 | 0 | +| Row 1 | 20 | NULL | NULL | +| Row 2 | 30 | 3 | 0 | +--------+-----------+------------------+------------+ evaluation (internal): +--------+---------------------------------------------------------------------+ @@ -813,9 +813,9 @@ evaluation: +--------+---------+--------+ | Type | Int8 | String | | Domain | {1..=3} | {""..} | -| Row 0 | 1_i8 | "1" | -| Row 1 | 2_i8 | "2" | -| Row 2 | 3_i8 | "3" | +| Row 0 | 1 | "1" | +| Row 1 | 2 | "2" | +| Row 2 | 3 | "3" | +--------+---------+--------+ evaluation (internal): +--------+--------------------------------------------------------+ @@ -835,8 +835,8 @@ evaluation: +--------+------------------+-----------------+ | Type | UInt8 NULL | String NULL | | Domain | {1..=3} ∪ {NULL} | {""..} ∪ {NULL} | -| Row 0 | 1_u8 | "1" | -| Row 1 | 2_u8 | "2" | +| Row 0 | 1 | "1" | +| Row 1 | 2 | "2" | | Row 2 | NULL | NULL | +--------+------------------+-----------------+ evaluation (internal): @@ -857,9 +857,9 @@ evaluation: +--------+---------+--------+ | Type | Int16 | String | | Domain | {2..=6} | {""..} | -| Row 0 | 2_i16 | "2" | -| Row 1 | 4_i16 | "4" | -| Row 2 | 6_i16 | "6" | +| Row 0 | 2 | "2" | +| Row 1 | 4 | "4" | +| Row 2 | 6 | "6" | +--------+---------+--------+ evaluation (internal): +--------+--------------------------------------------------------+ @@ -879,9 +879,9 @@ evaluation: +--------+-----------+--------+ | Type | UInt32 | String | | Domain | {10..=30} | {""..} | -| Row 0 | 10_u32 | "10" | -| Row 1 | 20_u32 | "20" | -| Row 2 | 30_u32 | "30" | +| Row 0 | 10 | "10" | +| Row 1 | 20 | "20" | +| Row 2 | 30 | "30" | +--------+-----------+--------+ evaluation (internal): +--------+--------------------------------------------------------------+ @@ -901,9 +901,9 @@ evaluation: +--------+------------+--------+ | Type | Float64 | String | | Domain | {-20..=30} | {""..} | -| Row 0 | 10_f64 | "10" | -| Row 1 | -20_f64 | "-20" | -| Row 2 | 30_f64 | "30" | +| Row 0 | 10 | "10" | +| Row 1 | -20 | "-20" | +| Row 2 | 30 | "30" | +--------+------------+--------+ evaluation (internal): +--------+----------------------------------------------------------------+ @@ -923,9 +923,9 @@ evaluation: +--------+------------------+-----------------+ | Type | UInt8 NULL | String NULL | | Domain | {0..=3} ∪ {NULL} | {""..} ∪ {NULL} | -| Row 0 | 1_u8 | "1" | +| Row 0 | 1 | "1" | | Row 1 | NULL | NULL | -| Row 2 | 3_u8 | "3" | +| Row 2 | 3 | "3" | +--------+------------------+-----------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/array.txt b/src/query/functions/tests/it/scalars/testdata/array.txt index de448493b8647..895ae865c4bd5 100644 --- a/src/query/functions/tests/it/scalars/testdata/array.txt +++ b/src/query/functions/tests/it/scalars/testdata/array.txt @@ -10,10 +10,10 @@ output : [] ast : [NULL, 8, -10] raw expr : array(NULL, 8_u8, minus(10_u8)) checked expr : array(CAST(NULL AS Int16 NULL), CAST(8_u8 AS Int16 NULL), CAST(minus(10_u8) AS Int16 NULL)) -optimized expr : [NULL, 8_i16, -10_i16] +optimized expr : [NULL, 8, -10] output type : Array(Int16 NULL) output domain : [{-10..=8} ∪ {NULL}] -output : [NULL, 8_i16, -10_i16] +output : [NULL, 8, -10] ast : [['a', 'b'], []] @@ -49,7 +49,7 @@ checked expr : length(array<>()) optimized expr : 0_u8 output type : UInt8 output domain : {0..=0} -output : 0_u8 +output : 0 ast : length([1, 2, 3]) @@ -58,7 +58,7 @@ checked expr : length(array(1_u8, 2 optimized expr : 3_u64 output type : UInt64 output domain : {3..=3} -output : 3_u64 +output : 3 ast : length([true, false]) @@ -67,7 +67,7 @@ checked expr : length(array(true, f optimized expr : 2_u64 output type : UInt64 output domain : {2..=2} -output : 2_u64 +output : 2 ast : length(['a', 'b', 'c', 'd']) @@ -76,7 +76,7 @@ checked expr : length(array(" optimized expr : 4_u64 output type : UInt64 output domain : {4..=4} -output : 4_u64 +output : 4 error: @@ -138,7 +138,7 @@ checked expr : get(CAST(array(CAST(array(array(array(1_u8), to_uint64(1_u8), to_uint64(2_u8)) -optimized expr : [1_u8] +optimized expr : [1] output type : Array(UInt8) output domain : [{1..=1}] -output : [1_u8] +output : [1] ast : slice([NULL, 1, 2, 3], 0, 2) raw expr : slice(array(NULL, 1_u8, 2_u8, 3_u8), 0_u8, 2_u8) checked expr : slice(array(CAST(NULL AS UInt8 NULL), CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(3_u8 AS UInt8 NULL)), to_uint64(0_u8), to_uint64(2_u8)) -optimized expr : [NULL, 1_u8] +optimized expr : [NULL, 1] output type : Array(UInt8 NULL) output domain : [{0..=1} ∪ {NULL}] -output : [NULL, 1_u8] +output : [NULL, 1] ast : slice([0, 1, 2, 3], 1, 2) raw expr : slice(array(0_u8, 1_u8, 2_u8, 3_u8), 1_u8, 2_u8) checked expr : slice(array(0_u8, 1_u8, 2_u8, 3_u8), to_uint64(1_u8), to_uint64(2_u8)) -optimized expr : [0_u8, 1_u8] +optimized expr : [0, 1] output type : Array(UInt8) output domain : [{0..=1}] -output : [0_u8, 1_u8] +output : [0, 1] ast : slice([0, 1, 2, 3], 1, 5) raw expr : slice(array(0_u8, 1_u8, 2_u8, 3_u8), 1_u8, 5_u8) checked expr : slice(array(0_u8, 1_u8, 2_u8, 3_u8), to_uint64(1_u8), to_uint64(5_u8)) -optimized expr : [0_u8, 1_u8, 2_u8, 3_u8] +optimized expr : [0, 1, 2, 3] output type : Array(UInt8) output domain : [{0..=3}] -output : [0_u8, 1_u8, 2_u8, 3_u8] +output : [0, 1, 2, 3] ast : slice(['a', 'b', 'c', 'd'], 0, 2) @@ -278,15 +278,15 @@ raw expr : slice(array(a::Int16, b::Int16, c::Int16), 1_u8, 2_u8) checked expr : slice(array(a, b, c), to_uint64(1_u8), to_uint64(2_u8)) optimized expr : slice(array(a, b, c), 1_u64, 2_u64) evaluation: -+--------+---------+---------+---------+----------------+ -| | a | b | c | Output | -+--------+---------+---------+---------+----------------+ -| Type | Int16 | Int16 | Int16 | Array(Int16) | -| Domain | {0..=2} | {3..=5} | {7..=9} | [{0..=9}] | -| Row 0 | 0_i16 | 3_i16 | 7_i16 | [0_i16, 3_i16] | -| Row 1 | 1_i16 | 4_i16 | 8_i16 | [1_i16, 4_i16] | -| Row 2 | 2_i16 | 5_i16 | 9_i16 | [2_i16, 5_i16] | -+--------+---------+---------+---------+----------------+ ++--------+---------+---------+---------+--------------+ +| | a | b | c | Output | ++--------+---------+---------+---------+--------------+ +| Type | Int16 | Int16 | Int16 | Array(Int16) | +| Domain | {0..=2} | {3..=5} | {7..=9} | [{0..=9}] | +| Row 0 | 0 | 3 | 7 | [0, 3] | +| Row 1 | 1 | 4 | 8 | [1, 4] | +| Row 2 | 2 | 5 | 9 | [2, 5] | ++--------+---------+---------+---------+--------------+ evaluation (internal): +--------+--------------------------------------------------------------------------+ | Column | Data | @@ -328,17 +328,17 @@ output : true ast : int8_col not in (1, 2, 3, 4, 5, null) raw expr : not(contains(array(1_u8, 2_u8, 3_u8, 4_u8, 5_u8), int8_col::Int8)) checked expr : not(contains(CAST(array(1_u8, 2_u8, 3_u8, 4_u8, 5_u8) AS Array(Int16)), to_int16(int8_col))) -optimized expr : not(contains([1_i16, 2_i16, 3_i16, 4_i16, 5_i16], to_int16(int8_col))) +optimized expr : not(contains([1, 2, 3, 4, 5], to_int16(int8_col))) evaluation: +--------+----------+---------------+ | | int8_col | Output | +--------+----------+---------------+ | Type | Int8 | Boolean | | Domain | {1..=8} | {FALSE, TRUE} | -| Row 0 | 1_i8 | false | -| Row 1 | 2_i8 | false | -| Row 2 | 7_i8 | true | -| Row 3 | 8_i8 | true | +| Row 0 | 1 | false | +| Row 1 | 2 | false | +| Row 2 | 7 | true | +| Row 3 | 8 | true | +--------+----------+---------------+ evaluation (internal): +----------+-----------------------+ @@ -352,15 +352,15 @@ evaluation (internal): ast : contains([1,2,null], nullable_col) raw expr : contains(array(1_u8, 2_u8, NULL), nullable_col::Int64 NULL) checked expr : contains(CAST(array(CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL)) AS Array(Int64 NULL)), nullable_col) -optimized expr : contains([1_i64, 2_i64, NULL], nullable_col) +optimized expr : contains([1, 2, NULL], nullable_col) evaluation: +--------+-------------------+---------------+ | | nullable_col | Output | +--------+-------------------+---------------+ | Type | Int64 NULL | Boolean | | Domain | {9..=12} ∪ {NULL} | {FALSE, TRUE} | -| Row 0 | 9_i64 | false | -| Row 1 | 10_i64 | false | +| Row 0 | 9 | false | +| Row 1 | 10 | false | | Row 2 | NULL | true | | Row 3 | NULL | true | +--------+-------------------+---------------+ @@ -392,8 +392,8 @@ evaluation: +--------+-------------------+------------------------+ | Type | Int64 NULL | Boolean NULL | | Domain | {9..=12} ∪ {NULL} | {FALSE, TRUE} ∪ {NULL} | -| Row 0 | 9_i64 | true | -| Row 1 | 10_i64 | true | +| Row 0 | 9 | true | +| Row 1 | 10 | true | | Row 2 | NULL | NULL | | Row 3 | NULL | NULL | +--------+-------------------+------------------------+ @@ -416,8 +416,8 @@ evaluation: +--------+-------------------+---------------+ | Type | Int64 NULL | Boolean | | Domain | {9..=12} ∪ {NULL} | {FALSE, TRUE} | -| Row 0 | 9_i64 | false | -| Row 1 | 10_i64 | true | +| Row 0 | 9 | false | +| Row 1 | 10 | true | | Row 2 | NULL | false | | Row 3 | NULL | false | +--------+-------------------+---------------+ @@ -451,19 +451,19 @@ output : [] ast : array_remove_first([0, 1, 2, NULL]) raw expr : array_remove_first(array(0_u8, 1_u8, 2_u8, NULL)) checked expr : array_remove_first(array(CAST(0_u8 AS UInt8 NULL), CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL))) -optimized expr : [1_u8, 2_u8, NULL] +optimized expr : [1, 2, NULL] output type : Array(UInt8 NULL) output domain : [{0..=2} ∪ {NULL}] -output : [1_u8, 2_u8, NULL] +output : [1, 2, NULL] ast : array_remove_first([0, 1, 2, 3]) raw expr : array_remove_first(array(0_u8, 1_u8, 2_u8, 3_u8)) checked expr : array_remove_first(array(0_u8, 1_u8, 2_u8, 3_u8)) -optimized expr : [1_u8, 2_u8, 3_u8] +optimized expr : [1, 2, 3] output type : Array(UInt8) output domain : [{1..=3}] -output : [1_u8, 2_u8, 3_u8] +output : [1, 2, 3] ast : array_remove_first(['a', 'b', 'c', 'd']) @@ -484,9 +484,9 @@ evaluation: +--------+---------+---------+--------------+ | Type | Int16 | Int16 | Array(Int16) | | Domain | {0..=2} | {3..=5} | [{0..=5}] | -| Row 0 | 0_i16 | 3_i16 | [3_i16] | -| Row 1 | 1_i16 | 4_i16 | [4_i16] | -| Row 2 | 2_i16 | 5_i16 | [5_i16] | +| Row 0 | 0 | 3 | [3] | +| Row 1 | 1 | 4 | [4] | +| Row 2 | 2 | 5 | [5] | +--------+---------+---------+--------------+ evaluation (internal): +--------+-----------------------------------------------------------------+ @@ -519,19 +519,19 @@ output : [] ast : array_remove_last([0, 1, 2, NULL]) raw expr : array_remove_last(array(0_u8, 1_u8, 2_u8, NULL)) checked expr : array_remove_last(array(CAST(0_u8 AS UInt8 NULL), CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL))) -optimized expr : [0_u8, 1_u8, 2_u8] +optimized expr : [0, 1, 2] output type : Array(UInt8 NULL) output domain : [{0..=2}] -output : [0_u8, 1_u8, 2_u8] +output : [0, 1, 2] ast : array_remove_last([0, 1, 2, 3]) raw expr : array_remove_last(array(0_u8, 1_u8, 2_u8, 3_u8)) checked expr : array_remove_last(array(0_u8, 1_u8, 2_u8, 3_u8)) -optimized expr : [0_u8, 1_u8, 2_u8] +optimized expr : [0, 1, 2] output type : Array(UInt8) output domain : [{0..=2}] -output : [0_u8, 1_u8, 2_u8] +output : [0, 1, 2] ast : array_remove_last(['a', 'b', 'c', 'd']) @@ -552,9 +552,9 @@ evaluation: +--------+---------+---------+--------------+ | Type | Int16 | Int16 | Array(Int16) | | Domain | {0..=2} | {3..=5} | [{0..=5}] | -| Row 0 | 0_i16 | 3_i16 | [0_i16] | -| Row 1 | 1_i16 | 4_i16 | [1_i16] | -| Row 2 | 2_i16 | 5_i16 | [2_i16] | +| Row 0 | 0 | 3 | [0] | +| Row 1 | 1 | 4 | [1] | +| Row 2 | 2 | 5 | [2] | +--------+---------+---------+--------------+ evaluation (internal): +--------+-----------------------------------------------------------------+ @@ -578,10 +578,10 @@ output : [] ast : array_concat([], [1,2]) raw expr : array_concat(array(), array(1_u8, 2_u8)) checked expr : array_concat(CAST(array<>() AS Array(UInt8)), array(1_u8, 2_u8)) -optimized expr : [1_u8, 2_u8] +optimized expr : [1, 2] output type : Array(UInt8) output domain : [{1..=2}] -output : [1_u8, 2_u8] +output : [1, 2] ast : array_concat([false, true], []) @@ -614,17 +614,17 @@ output : [1, 2, 3, "s", NULL] ast : array_concat([1, 2, 3, 4, 5, null], [nullable_col]) raw expr : array_concat(array(1_u8, 2_u8, 3_u8, 4_u8, 5_u8, NULL), array(nullable_col::Int64 NULL)) checked expr : array_concat(CAST(array(CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(3_u8 AS UInt8 NULL), CAST(4_u8 AS UInt8 NULL), CAST(5_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL)) AS Array(Int64 NULL)), array(nullable_col)) -optimized expr : array_concat([1_i64, 2_i64, 3_i64, 4_i64, 5_i64, NULL], array(nullable_col)) +optimized expr : array_concat([1, 2, 3, 4, 5, NULL], array(nullable_col)) evaluation: +--------+-------------------+---------------------------------------------------------+ | | nullable_col | Output | +--------+-------------------+---------------------------------------------------------+ | Type | Int64 NULL | Array(Int64 NULL) | | Domain | {9..=12} ∪ {NULL} | [{-9223372036854775808..=9223372036854775807} ∪ {NULL}] | -| Row 0 | 9_i64 | [1_i64, 2_i64, 3_i64, 4_i64, 5_i64, NULL, 9_i64] | -| Row 1 | 10_i64 | [1_i64, 2_i64, 3_i64, 4_i64, 5_i64, NULL, 10_i64] | -| Row 2 | NULL | [1_i64, 2_i64, 3_i64, 4_i64, 5_i64, NULL, NULL] | -| Row 3 | NULL | [1_i64, 2_i64, 3_i64, 4_i64, 5_i64, NULL, NULL] | +| Row 0 | 9 | [1, 2, 3, 4, 5, NULL, 9] | +| Row 1 | 10 | [1, 2, 3, 4, 5, NULL, 10] | +| Row 2 | NULL | [1, 2, 3, 4, 5, NULL, NULL] | +| Row 3 | NULL | [1, 2, 3, 4, 5, NULL, NULL] | +--------+-------------------+---------------------------------------------------------+ evaluation (internal): +--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -638,17 +638,17 @@ evaluation (internal): ast : array_concat([1,2,null], [int8_col]) raw expr : array_concat(array(1_u8, 2_u8, NULL), array(int8_col::Int8)) checked expr : array_concat(CAST(array(CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL)) AS Array(Int16 NULL)), CAST(array(int8_col) AS Array(Int16 NULL))) -optimized expr : array_concat([1_i16, 2_i16, NULL], CAST(array(int8_col) AS Array(Int16 NULL))) +optimized expr : array_concat([1, 2, NULL], CAST(array(int8_col) AS Array(Int16 NULL))) evaluation: +--------+----------+-----------------------------+ | | int8_col | Output | +--------+----------+-----------------------------+ | Type | Int8 | Array(Int16 NULL) | | Domain | {1..=8} | [{-32768..=32767} ∪ {NULL}] | -| Row 0 | 1_i8 | [1_i16, 2_i16, NULL, 1_i16] | -| Row 1 | 2_i8 | [1_i16, 2_i16, NULL, 2_i16] | -| Row 2 | 7_i8 | [1_i16, 2_i16, NULL, 7_i16] | -| Row 3 | 8_i8 | [1_i16, 2_i16, NULL, 8_i16] | +| Row 0 | 1 | [1, 2, NULL, 1] | +| Row 1 | 2 | [1, 2, NULL, 2] | +| Row 2 | 7 | [1, 2, NULL, 7] | +| Row 3 | 8 | [1, 2, NULL, 8] | +--------+----------+-----------------------------+ evaluation (internal): +----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -662,19 +662,19 @@ evaluation (internal): ast : array_prepend(1, []) raw expr : array_prepend(1_u8, array()) checked expr : array_prepend(1_u8, CAST(array<>() AS Array(UInt8))) -optimized expr : [1_u8] +optimized expr : [1] output type : Array(UInt8) output domain : [{1..=1}] -output : [1_u8] +output : [1] ast : array_prepend(1, [2, 3, NULL, 4]) raw expr : array_prepend(1_u8, array(2_u8, 3_u8, NULL, 4_u8)) checked expr : array_prepend(CAST(1_u8 AS UInt8 NULL), array(CAST(2_u8 AS UInt8 NULL), CAST(3_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL), CAST(4_u8 AS UInt8 NULL))) -optimized expr : [1_u8, 2_u8, 3_u8, NULL, 4_u8] +optimized expr : [1, 2, 3, NULL, 4] output type : Array(UInt8 NULL) output domain : [{0..=4} ∪ {NULL}] -output : [1_u8, 2_u8, 3_u8, NULL, 4_u8] +output : [1, 2, 3, NULL, 4] ast : array_prepend('a', ['b', NULL, NULL, 'c', 'd']) @@ -690,15 +690,15 @@ ast : array_prepend(a, [b, c]) raw expr : array_prepend(a::Int16, array(b::Int16, c::Int16)) checked expr : array_prepend(a, array(b, c)) evaluation: -+--------+---------+---------+---------+-----------------------+ -| | a | b | c | Output | -+--------+---------+---------+---------+-----------------------+ -| Type | Int16 | Int16 | Int16 | Array(Int16) | -| Domain | {0..=2} | {3..=5} | {6..=8} | [{-32768..=32767}] | -| Row 0 | 0_i16 | 3_i16 | 6_i16 | [0_i16, 3_i16, 6_i16] | -| Row 1 | 1_i16 | 4_i16 | 7_i16 | [1_i16, 4_i16, 7_i16] | -| Row 2 | 2_i16 | 5_i16 | 8_i16 | [2_i16, 5_i16, 8_i16] | -+--------+---------+---------+---------+-----------------------+ ++--------+---------+---------+---------+--------------------+ +| | a | b | c | Output | ++--------+---------+---------+---------+--------------------+ +| Type | Int16 | Int16 | Int16 | Array(Int16) | +| Domain | {0..=2} | {3..=5} | {6..=8} | [{-32768..=32767}] | +| Row 0 | 0 | 3 | 6 | [0, 3, 6] | +| Row 1 | 1 | 4 | 7 | [1, 4, 7] | +| Row 2 | 2 | 5 | 8 | [2, 5, 8] | ++--------+---------+---------+---------+--------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------+ | Column | Data | @@ -713,19 +713,19 @@ evaluation (internal): ast : array_append([], 1) raw expr : array_append(array(), 1_u8) checked expr : array_append(CAST(array<>() AS Array(UInt8)), 1_u8) -optimized expr : [1_u8] +optimized expr : [1] output type : Array(UInt8) output domain : [{1..=1}] -output : [1_u8] +output : [1] ast : array_append([2, 3, NULL, 4], 5) raw expr : array_append(array(2_u8, 3_u8, NULL, 4_u8), 5_u8) checked expr : array_append(array(CAST(2_u8 AS UInt8 NULL), CAST(3_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL), CAST(4_u8 AS UInt8 NULL)), CAST(5_u8 AS UInt8 NULL)) -optimized expr : [2_u8, 3_u8, NULL, 4_u8, 5_u8] +optimized expr : [2, 3, NULL, 4, 5] output type : Array(UInt8 NULL) output domain : [{0..=5} ∪ {NULL}] -output : [2_u8, 3_u8, NULL, 4_u8, 5_u8] +output : [2, 3, NULL, 4, 5] ast : array_append(['b', NULL, NULL, 'c', 'd'], 'e') @@ -741,15 +741,15 @@ ast : array_append([b, c], a) raw expr : array_append(array(b::Int16, c::Int16), a::Int16) checked expr : array_append(array(b, c), a) evaluation: -+--------+---------+---------+---------+-----------------------+ -| | a | b | c | Output | -+--------+---------+---------+---------+-----------------------+ -| Type | Int16 | Int16 | Int16 | Array(Int16) | -| Domain | {0..=2} | {3..=5} | {6..=8} | [{-32768..=32767}] | -| Row 0 | 0_i16 | 3_i16 | 6_i16 | [3_i16, 6_i16, 0_i16] | -| Row 1 | 1_i16 | 4_i16 | 7_i16 | [4_i16, 7_i16, 1_i16] | -| Row 2 | 2_i16 | 5_i16 | 8_i16 | [5_i16, 8_i16, 2_i16] | -+--------+---------+---------+---------+-----------------------+ ++--------+---------+---------+---------+--------------------+ +| | a | b | c | Output | ++--------+---------+---------+---------+--------------------+ +| Type | Int16 | Int16 | Int16 | Array(Int16) | +| Domain | {0..=2} | {3..=5} | {6..=8} | [{-32768..=32767}] | +| Row 0 | 0 | 3 | 6 | [3, 6, 0] | +| Row 1 | 1 | 4 | 7 | [4, 7, 1] | +| Row 2 | 2 | 5 | 8 | [5, 8, 2] | ++--------+---------+---------+---------+--------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------+ | Column | Data | @@ -767,7 +767,7 @@ checked expr : array_indexof(CAST(array<>() AS Array(N optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 ast : array_indexof(NULL, NULL) @@ -785,7 +785,7 @@ checked expr : array_indexof(array(CAST(array<>() AS Arra optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 ast : array_indexof([false, true], null) @@ -803,7 +803,7 @@ checked expr : array_indexof(CAST(array(CAST(array optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 ast : array_indexof([1,2,3,'s'], 's') @@ -821,7 +821,7 @@ checked expr : array_indexof(array(array(CAST(array(CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(3_u8 AS UInt8 NULL), CAST(4_u8 AS UInt8 NULL), CAST(5_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL)) AS Array(Int64 NULL)), nullable_col) -optimized expr : array_indexof([1_i64, 2_i64, 3_i64, 4_i64, 5_i64, NULL], nullable_col) +optimized expr : array_indexof([1, 2, 3, 4, 5, NULL], nullable_col) evaluation: +--------+-------------------+----------------------------+ | | nullable_col | Output | +--------+-------------------+----------------------------+ | Type | Int64 NULL | UInt64 | | Domain | {9..=12} ∪ {NULL} | {0..=18446744073709551615} | -| Row 0 | 9_i64 | 0_u64 | -| Row 1 | 10_i64 | 0_u64 | -| Row 2 | NULL | 6_u64 | -| Row 3 | NULL | 6_u64 | +| Row 0 | 9 | 0 | +| Row 1 | 10 | 0 | +| Row 2 | NULL | 6 | +| Row 3 | NULL | 6 | +--------+-------------------+----------------------------+ evaluation (internal): +--------------+---------------------------------------------------------------------------+ @@ -860,17 +860,17 @@ evaluation (internal): ast : array_indexof([9,10,null], int8_col) raw expr : array_indexof(array(9_u8, 10_u8, NULL), int8_col::Int8) checked expr : array_indexof(CAST(array(CAST(9_u8 AS UInt8 NULL), CAST(10_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL)) AS Array(Int16 NULL)), CAST(int8_col AS Int16 NULL)) -optimized expr : array_indexof([9_i16, 10_i16, NULL], CAST(int8_col AS Int16 NULL)) +optimized expr : array_indexof([9, 10, NULL], CAST(int8_col AS Int16 NULL)) evaluation: +--------+----------+----------------------------+ | | int8_col | Output | +--------+----------+----------------------------+ | Type | Int8 | UInt64 | | Domain | {1..=8} | {0..=18446744073709551615} | -| Row 0 | 1_i8 | 0_u64 | -| Row 1 | 2_i8 | 0_u64 | -| Row 2 | 7_i8 | 0_u64 | -| Row 3 | 8_i8 | 0_u64 | +| Row 0 | 1 | 0 | +| Row 1 | 2 | 0 | +| Row 2 | 7 | 0 | +| Row 3 | 8 | 0 | +--------+----------+----------------------------+ evaluation (internal): +----------+----------------------+ @@ -887,7 +887,7 @@ checked expr : array_unique(array<>()) optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 ast : array_unique([1, 1, 2, 2, 3, NULL]) @@ -896,7 +896,7 @@ checked expr : array_unique(array(array(array(CAST(1_u8 AS UInt8 NULL), CAST(1_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(2_u8 AS UInt8 NULL), CAST(3_u8 AS UInt8 NULL), CAST(NULL AS UInt8 NULL))) -optimized expr : [1_u8, 2_u8, 3_u8] +optimized expr : [1, 2, 3] output type : Array(UInt8 NULL) output domain : [{1..=3}] -output : [1_u8, 2_u8, 3_u8] +output : [1, 2, 3] ast : array_distinct(['a', NULL, 'a', 'b', NULL, 'c', 'd']) @@ -965,16 +965,16 @@ ast : array_distinct([a, b, c, d]) raw expr : array_distinct(array(a::Int16, b::Int16, c::Int16, d::Int16)) checked expr : array_distinct(array(a, b, c, d)) evaluation: -+--------+---------+---------+---------+---------+------------------------------+ -| | a | b | c | d | Output | -+--------+---------+---------+---------+---------+------------------------------+ -| Type | Int16 | Int16 | Int16 | Int16 | Array(Int16) | -| Domain | {1..=4} | {1..=4} | {1..=4} | {2..=4} | [{-32768..=32767}] | -| Row 0 | 1_i16 | 2_i16 | 3_i16 | 4_i16 | [1_i16, 2_i16, 3_i16, 4_i16] | -| Row 1 | 1_i16 | 1_i16 | 1_i16 | 2_i16 | [1_i16, 2_i16] | -| Row 2 | 2_i16 | 2_i16 | 3_i16 | 3_i16 | [2_i16, 3_i16] | -| Row 3 | 4_i16 | 4_i16 | 4_i16 | 4_i16 | [4_i16] | -+--------+---------+---------+---------+---------+------------------------------+ ++--------+---------+---------+---------+---------+--------------------+ +| | a | b | c | d | Output | ++--------+---------+---------+---------+---------+--------------------+ +| Type | Int16 | Int16 | Int16 | Int16 | Array(Int16) | +| Domain | {1..=4} | {1..=4} | {1..=4} | {2..=4} | [{-32768..=32767}] | +| Row 0 | 1 | 2 | 3 | 4 | [1, 2, 3, 4] | +| Row 1 | 1 | 1 | 1 | 2 | [1, 2] | +| Row 2 | 2 | 2 | 3 | 3 | [2, 3] | +| Row 3 | 4 | 4 | 4 | 4 | [4] | ++--------+---------+---------+---------+---------+--------------------+ evaluation (internal): +--------+--------------------------------------------------------------------------------------+ | Column | Data | diff --git a/src/query/functions/tests/it/scalars/testdata/cast.txt b/src/query/functions/tests/it/scalars/testdata/cast.txt index 642783ed30f45..ac9bd4806e7d9 100644 --- a/src/query/functions/tests/it/scalars/testdata/cast.txt +++ b/src/query/functions/tests/it/scalars/testdata/cast.txt @@ -3,7 +3,7 @@ raw expr : CAST(0_u8 AS UInt8) checked expr : 0_u8 output type : UInt8 output domain : {0..=0} -output : 0_u8 +output : 0 ast : CAST(0 AS UINT8 NULL) @@ -12,7 +12,7 @@ checked expr : CAST(0_u8 AS UInt8 NULL) optimized expr : 0_u8 output type : UInt8 NULL output domain : {0..=0} -output : 0_u8 +output : 0 ast : CAST('str' AS STRING) @@ -70,7 +70,7 @@ error: --> SQL:1:1 | 1 | CAST(1024 AS UINT8) - | ^^^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint8(1024_u16)` + | ^^^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint8(1024)` @@ -78,7 +78,7 @@ error: --> SQL:1:1 | 1 | CAST(a AS UINT8) - | ^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint8(512_u16)` + | ^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint8(512)` @@ -86,7 +86,7 @@ error: --> SQL:1:1 | 1 | CAST(a AS UINT16) - | ^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint16(-4_i16)` + | ^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint16(-4)` @@ -99,11 +99,11 @@ evaluation: +--------+----------+----------+ | Type | Int16 | Int64 | | Domain | {-4..=3} | {-4..=3} | -| Row 0 | 0_i16 | 0_i64 | -| Row 1 | 1_i16 | 1_i64 | -| Row 2 | 2_i16 | 2_i64 | -| Row 3 | 3_i16 | 3_i64 | -| Row 4 | -4_i16 | -4_i64 | +| Row 0 | 0 | 0 | +| Row 1 | 1 | 1 | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | -4 | +--------+----------+----------+ evaluation (internal): +--------+-------------------------+ @@ -118,7 +118,7 @@ error: --> SQL:1:22 | 1 | (CAST(a AS FLOAT32), CAST(a AS INT32), CAST(b AS FLOAT32), CAST(b AS INT32)) - | ^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_int32(4294967295_u64)` + | ^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_int32(4294967295)` @@ -134,7 +134,7 @@ error: --> SQL:1:1 | 1 | CAST((a, b, NULL) AS TUPLE(Int8, UInt8, Boolean NULL)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_int8(256_i16)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_int8(256)` @@ -147,11 +147,11 @@ evaluation: +--------+--------------+----------+ | Type | Float64 | Int16 | | Domain | {-4.4..=3.3} | {-4..=3} | -| Row 0 | 0_f64 | 0_i16 | -| Row 1 | 1.1_f64 | 1_i16 | -| Row 2 | 2.2_f64 | 2_i16 | -| Row 3 | 3.3_f64 | 3_i16 | -| Row 4 | -4.4_f64 | -4_i16 | +| Row 0 | 0 | 0 | +| Row 1 | 1.1 | 1 | +| Row 2 | 2.2 | 2 | +| Row 3 | 3.3 | 3 | +| Row 4 | -4.4 | -4 | +--------+--------------+----------+ evaluation (internal): +--------+-----------------------------------+ @@ -171,11 +171,11 @@ evaluation: +--------+----------+----------+ | Type | Int8 | Int16 | | Domain | {-4..=3} | {-4..=3} | -| Row 0 | 0_i8 | 0_i16 | -| Row 1 | 1_i8 | 1_i16 | -| Row 2 | 2_i8 | 2_i16 | -| Row 3 | 3_i8 | 3_i16 | -| Row 4 | -4_i8 | -4_i16 | +| Row 0 | 0 | 0 | +| Row 1 | 1 | 1 | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | -4 | +--------+----------+----------+ evaluation (internal): +--------+-------------------------+ @@ -190,7 +190,7 @@ error: --> SQL:1:1 | 1 | CAST(a AS UINT16) - | ^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint16(-4_i16)` + | ^^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_uint16(-4)` @@ -198,7 +198,7 @@ error: --> SQL:1:1 | 1 | CAST(c AS INT16) - | ^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_int16(11111111111_i64)` + | ^^^^^^^^^^^^^^^^ number overflowed while evaluating function `to_int16(11111111111)` @@ -372,7 +372,7 @@ error: --> SQL:1:1 | 1 | CAST(-30610224000000001 AS TIMESTAMP) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(-30610224000000001_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(-30610224000000001)` @@ -452,7 +452,7 @@ error: --> SQL:1:1 | 1 | CAST(253402300800000000 AS TIMESTAMP) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(253402300800000000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(253402300800000000)` @@ -465,13 +465,13 @@ evaluation: +--------+--------------------------------------+--------------------------------------+ | Type | Int64 | Timestamp | | Domain | {-315360000000000..=315360000000000} | {-315360000000000..=315360000000000} | -| Row 0 | -315360000000000_i64 | 1960-01-04 00:00:00.000000 | -| Row 1 | -315360000000_i64 | 1960-01-04 00:00:00.000000 | -| Row 2 | -100_i64 | 1969-12-31 23:58:20.000000 | -| Row 3 | 0_i64 | 1970-01-01 00:00:00.000000 | -| Row 4 | 100_i64 | 1970-01-01 00:01:40.000000 | -| Row 5 | 315360000000_i64 | 1979-12-30 00:00:00.000000 | -| Row 6 | 315360000000000_i64 | 1979-12-30 00:00:00.000000 | +| Row 0 | -315360000000000 | 1960-01-04 00:00:00.000000 | +| Row 1 | -315360000000 | 1960-01-04 00:00:00.000000 | +| Row 2 | -100 | 1969-12-31 23:58:20.000000 | +| Row 3 | 0 | 1970-01-01 00:00:00.000000 | +| Row 4 | 100 | 1970-01-01 00:01:40.000000 | +| Row 5 | 315360000000 | 1979-12-30 00:00:00.000000 | +| Row 6 | 315360000000000 | 1979-12-30 00:00:00.000000 | +--------+--------------------------------------+--------------------------------------+ evaluation (internal): +--------+--------------------------------------------------------------------------------------------------+ @@ -488,7 +488,7 @@ checked expr : to_int64(to_timestamp(minus(315360000 optimized expr : -315360000000000_i64 output type : Int64 output domain : {-315360000000000..=-315360000000000} -output : -315360000000000_i64 +output : -315360000000000 ast : CAST(TO_TIMESTAMP(-315360000000) AS INT64) @@ -497,7 +497,7 @@ checked expr : to_int64(to_timestamp(minus(315360000 optimized expr : -315360000000000_i64 output type : Int64 output domain : {-315360000000000..=-315360000000000} -output : -315360000000000_i64 +output : -315360000000000 ast : CAST(TO_TIMESTAMP(-100) AS INT64) @@ -506,7 +506,7 @@ checked expr : to_int64(to_timestamp(to_int64(minus(to_timestamp(to_int64(minus(to_timestamp(to_int64(0_u8))) optimized expr : 0_i64 output type : Int64 output domain : {0..=0} -output : 0_i64 +output : 0 ast : CAST(TO_TIMESTAMP(100) AS INT64) @@ -533,7 +533,7 @@ checked expr : to_int64(to_timestamp(to_int64(100_u8) optimized expr : 100000000_i64 output type : Int64 output domain : {100000000..=100000000} -output : 100000000_i64 +output : 100000000 ast : CAST(TO_TIMESTAMP(315360000000) AS INT64) @@ -542,7 +542,7 @@ checked expr : to_int64(to_timestamp(to_int64(315360 optimized expr : 315360000000000_i64 output type : Int64 output domain : {315360000000000..=315360000000000} -output : 315360000000000_i64 +output : 315360000000000 ast : CAST(TO_TIMESTAMP(315360000000000) AS INT64) @@ -551,7 +551,7 @@ checked expr : to_int64(to_timestamp(to_int64(315360 optimized expr : 315360000000000_i64 output type : Int64 output domain : {315360000000000..=315360000000000} -output : 315360000000000_i64 +output : 315360000000000 ast : CAST(a AS INT64) @@ -563,13 +563,13 @@ evaluation: +--------+--------------------------------------+--------------------------------------+ | Type | Timestamp | Int64 | | Domain | {-315360000000000..=315360000000000} | {-315360000000000..=315360000000000} | -| Row 0 | 1960-01-04 00:00:00.000000 | -315360000000000_i64 | -| Row 1 | 1969-12-28 08:24:00.000000 | -315360000000_i64 | -| Row 2 | 1969-12-31 23:59:59.999900 | -100_i64 | -| Row 3 | 1970-01-01 00:00:00.000000 | 0_i64 | -| Row 4 | 1970-01-01 00:00:00.000100 | 100_i64 | -| Row 5 | 1970-01-04 15:36:00.000000 | 315360000000_i64 | -| Row 6 | 1979-12-30 00:00:00.000000 | 315360000000000_i64 | +| Row 0 | 1960-01-04 00:00:00.000000 | -315360000000000 | +| Row 1 | 1969-12-28 08:24:00.000000 | -315360000000 | +| Row 2 | 1969-12-31 23:59:59.999900 | -100 | +| Row 3 | 1970-01-01 00:00:00.000000 | 0 | +| Row 4 | 1970-01-01 00:00:00.000100 | 100 | +| Row 5 | 1970-01-04 15:36:00.000000 | 315360000000 | +| Row 6 | 1979-12-30 00:00:00.000000 | 315360000000000 | +--------+--------------------------------------+--------------------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------+ @@ -584,7 +584,7 @@ error: --> SQL:1:1 | 1 | CAST(-354286 AS DATE) - | ^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(-354286_i64)` + | ^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(-354286)` @@ -646,7 +646,7 @@ error: --> SQL:1:1 | 1 | CAST(2932897 AS DATE) - | ^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(2932897_i64)` + | ^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(2932897)` @@ -659,11 +659,11 @@ evaluation: +--------+---------------------+---------------------+ | Type | Int32 | Date | | Domain | {-354285..=2932896} | {-354285..=2932896} | -| Row 0 | -354285_i32 | 1000-01-01 | -| Row 1 | -100_i32 | 1969-09-23 | -| Row 2 | 0_i32 | 1970-01-01 | -| Row 3 | 100_i32 | 1970-04-11 | -| Row 4 | 2932896_i32 | 9999-12-31 | +| Row 0 | -354285 | 1000-01-01 | +| Row 1 | -100 | 1969-09-23 | +| Row 2 | 0 | 1970-01-01 | +| Row 3 | 100 | 1970-04-11 | +| Row 4 | 2932896 | 9999-12-31 | +--------+---------------------+---------------------+ evaluation (internal): +--------+-----------------------------------------+ @@ -680,7 +680,7 @@ checked expr : to_int64(to_date(minus(354285_u32))) optimized expr : -354285_i64 output type : Int64 output domain : {-354285..=-354285} -output : -354285_i64 +output : -354285 ast : CAST(TO_DATE(-100) AS INT64) @@ -689,7 +689,7 @@ checked expr : to_int64(to_date(to_int64(minus(100_ optimized expr : -100_i64 output type : Int64 output domain : {-100..=-100} -output : -100_i64 +output : -100 ast : CAST(TO_DATE(-0) AS INT64) @@ -698,7 +698,7 @@ checked expr : to_int64(to_date(to_int64(minus(0_u8 optimized expr : 0_i64 output type : Int64 output domain : {0..=0} -output : 0_i64 +output : 0 ast : CAST(TO_DATE(0) AS INT64) @@ -707,7 +707,7 @@ checked expr : to_int64(to_date(to_int64(0_u8))) optimized expr : 0_i64 output type : Int64 output domain : {0..=0} -output : 0_i64 +output : 0 ast : CAST(TO_DATE(100) AS INT64) @@ -716,7 +716,7 @@ checked expr : to_int64(to_date(to_int64(100_u8))) optimized expr : 100_i64 output type : Int64 output domain : {100..=100} -output : 100_i64 +output : 100 ast : CAST(TO_DATE(2932896) AS INT64) @@ -725,7 +725,7 @@ checked expr : to_int64(to_date(to_int64(2932896_u32))) optimized expr : 2932896_i64 output type : Int64 output domain : {2932896..=2932896} -output : 2932896_i64 +output : 2932896 ast : CAST(a AS INT64) @@ -737,11 +737,11 @@ evaluation: +--------+---------------------+---------------------+ | Type | Date | Int64 | | Domain | {-354285..=2932896} | {-354285..=2932896} | -| Row 0 | 1000-01-01 | -354285_i64 | -| Row 1 | 1969-09-23 | -100_i64 | -| Row 2 | 1970-01-01 | 0_i64 | -| Row 3 | 1970-04-11 | 100_i64 | -| Row 4 | 9999-12-31 | 2932896_i64 | +| Row 0 | 1000-01-01 | -354285 | +| Row 1 | 1969-09-23 | -100 | +| Row 2 | 1970-01-01 | 0 | +| Row 3 | 1970-04-11 | 100 | +| Row 4 | 9999-12-31 | 2932896 | +--------+---------------------+---------------------+ evaluation (internal): +--------+-----------------------------------------+ @@ -790,24 +790,24 @@ checked expr : to_uint64("1") optimized expr : 1_u64 output type : UInt64 output domain : {1..=1} -output : 1_u64 +output : 1 ast : CAST(str AS INT64) raw expr : CAST(str::String AS Int64) checked expr : to_int64(str) evaluation: -+--------+--------------------------------+--------------------------+ -| | str | Output | -+--------+--------------------------------+--------------------------+ -| Type | String | Int64 | -| Domain | {"-1"..="9223372036854775807"} | Unknown | -| Row 0 | "-9223372036854775808" | -9223372036854775808_i64 | -| Row 1 | "-1" | -1_i64 | -| Row 2 | "0" | 0_i64 | -| Row 3 | "1" | 1_i64 | -| Row 4 | "9223372036854775807" | 9223372036854775807_i64 | -+--------+--------------------------------+--------------------------+ ++--------+--------------------------------+----------------------+ +| | str | Output | ++--------+--------------------------------+----------------------+ +| Type | String | Int64 | +| Domain | {"-1"..="9223372036854775807"} | Unknown | +| Row 0 | "-9223372036854775808" | -9223372036854775808 | +| Row 1 | "-1" | -1 | +| Row 2 | "0" | 0 | +| Row 3 | "1" | 1 | +| Row 4 | "9223372036854775807" | 9223372036854775807 | ++--------+--------------------------------+----------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | Column | Data | @@ -826,11 +826,11 @@ evaluation: +--------+----------------------------------------------+------------------------+ | Type | Int64 | String | | Domain | {-9223372036854775808..=9223372036854775807} | {""..} | -| Row 0 | -9223372036854775808_i64 | "-9223372036854775808" | -| Row 1 | -1_i64 | "-1" | -| Row 2 | 0_i64 | "0" | -| Row 3 | 1_i64 | "1" | -| Row 4 | 9223372036854775807_i64 | "9223372036854775807" | +| Row 0 | -9223372036854775808 | "-9223372036854775808" | +| Row 1 | -1 | "-1" | +| Row 2 | 0 | "0" | +| Row 3 | 1 | "1" | +| Row 4 | 9223372036854775807 | "9223372036854775807" | +--------+----------------------------------------------+------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -850,9 +850,9 @@ evaluation: +--------+----------------------------+------------------------+ | Type | UInt64 | String | | Domain | {0..=18446744073709551615} | {""..} | -| Row 0 | 0_u64 | "0" | -| Row 1 | 1_u64 | "1" | -| Row 2 | 18446744073709551615_u64 | "18446744073709551615" | +| Row 0 | 0 | "0" | +| Row 1 | 1 | "1" | +| Row 2 | 18446744073709551615 | "18446744073709551615" | +--------+----------------------------+------------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------+ @@ -976,7 +976,7 @@ checked expr : to_uint64(false) optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 ast : CAST(true AS INT64) @@ -985,7 +985,7 @@ checked expr : to_int64(true) optimized expr : 1_i64 output type : Int64 output domain : {1..=1} -output : 1_i64 +output : 1 error: @@ -1029,10 +1029,10 @@ evaluation: +--------+----------+---------------+ | Type | Int64 | Boolean | | Domain | {-1..=2} | {FALSE, TRUE} | -| Row 0 | 0_i64 | false | -| Row 1 | -1_i64 | true | -| Row 2 | 1_i64 | true | -| Row 3 | 2_i64 | true | +| Row 0 | 0 | false | +| Row 1 | -1 | true | +| Row 2 | 1 | true | +| Row 3 | 2 | true | +--------+----------+---------------+ evaluation (internal): +--------+-----------------------+ @@ -1052,9 +1052,9 @@ evaluation: +--------+---------+---------------+ | Type | UInt64 | Boolean | | Domain | {0..=2} | {FALSE, TRUE} | -| Row 0 | 0_u64 | false | -| Row 1 | 1_u64 | true | -| Row 2 | 2_u64 | true | +| Row 0 | 0 | false | +| Row 1 | 1 | true | +| Row 2 | 2 | true | +--------+---------+---------------+ evaluation (internal): +--------+-----------------------+ @@ -1074,8 +1074,8 @@ evaluation: +--------+---------------+---------+ | Type | Boolean | UInt64 | | Domain | {FALSE, TRUE} | {0..=1} | -| Row 0 | false | 0_u64 | -| Row 1 | true | 1_u64 | +| Row 0 | false | 0 | +| Row 1 | true | 1 | +--------+---------------+---------+ evaluation (internal): +--------+-----------------------+ @@ -1095,8 +1095,8 @@ evaluation: +--------+---------------+---------+ | Type | Boolean | Int64 | | Domain | {FALSE, TRUE} | {0..=1} | -| Row 0 | false | 0_i64 | -| Row 1 | true | 1_i64 | +| Row 0 | false | 0 | +| Row 1 | true | 1 | +--------+---------------+---------+ evaluation (internal): +--------+-----------------------+ @@ -1184,11 +1184,11 @@ evaluation: +--------+---------------------+-------------------------------------------+ | Type | Int32 | Timestamp | | Domain | {-354285..=2932896} | {-30610224000000000..=253402214400000000} | -| Row 0 | -354285_i32 | 1000-01-01 00:00:00.000000 | -| Row 1 | -100_i32 | 1969-09-23 00:00:00.000000 | -| Row 2 | 0_i32 | 1970-01-01 00:00:00.000000 | -| Row 3 | 100_i32 | 1970-04-11 00:00:00.000000 | -| Row 4 | 2932896_i32 | 9999-12-31 00:00:00.000000 | +| Row 0 | -354285 | 1000-01-01 00:00:00.000000 | +| Row 1 | -100 | 1969-09-23 00:00:00.000000 | +| Row 2 | 0 | 1970-01-01 00:00:00.000000 | +| Row 3 | 100 | 1970-04-11 00:00:00.000000 | +| Row 4 | 2932896 | 9999-12-31 00:00:00.000000 | +--------+---------------------+-------------------------------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -1203,7 +1203,7 @@ error: --> SQL:1:1 | 1 | CAST(a AS TIMESTAMP) - | ^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(9223372036854775807_i64)` + | ^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(9223372036854775807)` @@ -1211,7 +1211,7 @@ error: --> SQL:1:1 | 1 | CAST(a AS DATE) - | ^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(9223372036854775807_i64)` + | ^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(9223372036854775807)` @@ -1617,7 +1617,7 @@ checked expr : CAST(tuple(tuple( optimized expr : ((1_i32, 1_i32), 1_i32) output type : Tuple(Tuple(Int32, Int32), Int32) output domain : (({1..=1}, {1..=1}), {1..=1}) -output : ((1_i32, 1_i32), 1_i32) +output : ((1, 1), 1) ast : CAST(TRY_CAST(1 AS INT32) AS INT32) @@ -1626,7 +1626,7 @@ checked expr : CAST(try_to_int32(1_u8) AS Int32) optimized expr : 1_i32 output type : Int32 output domain : {1..=1} -output : 1_i32 +output : 1 error: @@ -1648,10 +1648,10 @@ error: ast : CAST([(1,TRUE),(2,FALSE)] AS Array(Tuple(INT, INT))) raw expr : CAST(array(tuple(1_u8, true), tuple(2_u8, false)) AS Array(Tuple(Int32, Int32))) checked expr : CAST(array(tuple(1_u8, true), tuple(2_u8, false)) AS Array(Tuple(Int32, Int32))) -optimized expr : [(1_i32, 1_i32), (2_i32, 0_i32)] +optimized expr : [(1, 1), (2, 0)] output type : Array(Tuple(Int32, Int32)) output domain : [({1..=2}, {0..=1})] -output : [(1_i32, 1_i32), (2_i32, 0_i32)] +output : [(1, 1), (2, 0)] error: @@ -1673,10 +1673,10 @@ error: ast : CAST([[TRUE], [FALSE, TRUE]] AS Array(Array(INT))) raw expr : CAST(array(array(true), array(false, true)) AS Array(Array(Int32))) checked expr : CAST(array(array(true), array(false, true)) AS Array(Array(Int32))) -optimized expr : [[1_i32], [0_i32, 1_i32]] +optimized expr : [[1], [0, 1]] output type : Array(Array(Int32)) output domain : [[{0..=1}]] -output : [[1_i32], [0_i32, 1_i32]] +output : [[1], [0, 1]] error: @@ -1693,7 +1693,7 @@ checked expr : try_to_uint8(0_u8) optimized expr : 0_u8 output type : UInt8 NULL output domain : {0..=0} -output : 0_u8 +output : 0 ast : TRY_CAST(0 AS UINT8 NULL) @@ -1702,7 +1702,7 @@ checked expr : TRY_CAST(0_u8 AS UInt8 NULL) optimized expr : 0_u8 output type : UInt8 NULL output domain : {0..=0} -output : 0_u8 +output : 0 ast : TRY_CAST('str' AS STRING) @@ -1777,11 +1777,11 @@ evaluation: +--------+------------+--------------------+ | Type | UInt16 | UInt8 NULL | | Domain | {0..=1024} | {0..=255} ∪ {NULL} | -| Row 0 | 0_u16 | 0_u8 | -| Row 1 | 64_u16 | 64_u8 | -| Row 2 | 255_u16 | 255_u8 | -| Row 3 | 512_u16 | NULL | -| Row 4 | 1024_u16 | NULL | +| Row 0 | 0 | 0 | +| Row 1 | 64 | 64 | +| Row 2 | 255 | 255 | +| Row 3 | 512 | NULL | +| Row 4 | 1024 | NULL | +--------+------------+--------------------+ evaluation (internal): +--------+------------------------------------------------------------------------------+ @@ -1801,11 +1801,11 @@ evaluation: +--------+----------+------------------+ | Type | Int16 | UInt16 NULL | | Domain | {-4..=3} | {0..=3} ∪ {NULL} | -| Row 0 | 0_i16 | 0_u16 | -| Row 1 | 1_i16 | 1_u16 | -| Row 2 | 2_i16 | 2_u16 | -| Row 3 | 3_i16 | 3_u16 | -| Row 4 | -4_i16 | NULL | +| Row 0 | 0 | 0 | +| Row 1 | 1 | 1 | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | NULL | +--------+----------+------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -1825,11 +1825,11 @@ evaluation: +--------+----------+------------+ | Type | Int16 | Int64 NULL | | Domain | {-4..=3} | {-4..=3} | -| Row 0 | 0_i16 | 0_i64 | -| Row 1 | 1_i16 | 1_i64 | -| Row 2 | 2_i16 | 2_i64 | -| Row 3 | 3_i16 | 3_i64 | -| Row 4 | -4_i16 | -4_i64 | +| Row 0 | 0 | 0 | +| Row 1 | 1 | 1 | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | -4 | +--------+----------+------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -1849,12 +1849,12 @@ evaluation: +--------+----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ | Type | UInt64 | Float64 | Tuple(Float32 NULL, Int32 NULL, Float32 NULL, Int32 NULL) | | Domain | {0..=18446744073709551615} | {-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000..=inf} | ({0..=18446744073709551616}, {0..=2147483647} ∪ {NULL}, {-inf..=inf}, {-2147483648..=2147483647} ∪ {NULL}) | -| Row 0 | 0_u64 | 0_f64 | (0_f32, 0_i32, 0_f32, 0_i32) | -| Row 1 | 1_u64 | 4294967295_f64 | (1_f32, 1_i32, 4294967296_f32, NULL) | -| Row 2 | 255_u64 | 18446744073709551616_f64 | (255_f32, 255_i32, 18446744073709551616_f32, NULL) | -| Row 3 | 65535_u64 | -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_f64 | (65535_f32, 65535_i32, -inf_f32, NULL) | -| Row 4 | 4294967295_u64 | 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000_f64 | (4294967296_f32, NULL, inf_f32, NULL) | -| Row 5 | 18446744073709551615_u64 | inf_f64 | (18446744073709551616_f32, NULL, inf_f32, NULL) | +| Row 0 | 0 | 0 | (0, 0, 0, 0) | +| Row 1 | 1 | 4294967295 | (1, 1, 4294967296, NULL) | +| Row 2 | 255 | 18446744073709551616 | (255, 255, 18446744073709551616, NULL) | +| Row 3 | 65535 | -179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | (65535, 65535, -inf, NULL) | +| Row 4 | 4294967295 | 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 | (4294967296, NULL, inf, NULL) | +| Row 5 | 18446744073709551615 | inf | (18446744073709551616, NULL, inf, NULL) | +--------+----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1876,11 +1876,11 @@ evaluation: +--------+-----------+------------+------------------------------------+ | Type | Int16 | Int16 | Array(Array(Int8 NULL) NULL) NULL | | Domain | {0..=255} | {-129..=0} | [[{-128..=127} ∪ {NULL}] ∪ {NULL}] | -| Row 0 | 0_i16 | 0_i16 | [[0_i8, 0_i8], [], []] | -| Row 1 | 1_i16 | -1_i16 | [[1_i8, -1_i8], [], []] | -| Row 2 | 2_i16 | -127_i16 | [[2_i8, -127_i8], [], []] | -| Row 3 | 127_i16 | -128_i16 | [[127_i8, -128_i8], [], []] | -| Row 4 | 255_i16 | -129_i16 | [[NULL, NULL], [], []] | +| Row 0 | 0 | 0 | [[0, 0], [], []] | +| Row 1 | 1 | -1 | [[1, -1], [], []] | +| Row 2 | 2 | -127 | [[2, -127], [], []] | +| Row 3 | 127 | -128 | [[127, -128], [], []] | +| Row 4 | 255 | -129 | [[NULL, NULL], [], []] | +--------+-----------+------------+------------------------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1901,11 +1901,11 @@ evaluation: +--------+-----------+------------+-------------------------------------------------+ | Type | Int16 | Int16 | Tuple(Int8 NULL, UInt8 NULL, Boolean NULL) NULL | | Domain | {0..=256} | {-129..=1} | ({0..=127} ∪ {NULL}, {0..=1} ∪ {NULL}, {NULL}) | -| Row 0 | 0_i16 | 0_i16 | (0_i8, 0_u8, NULL) | -| Row 1 | 1_i16 | 1_i16 | (1_i8, 1_u8, NULL) | -| Row 2 | 2_i16 | -127_i16 | (2_i8, NULL, NULL) | -| Row 3 | 127_i16 | -128_i16 | (127_i8, NULL, NULL) | -| Row 4 | 256_i16 | -129_i16 | (NULL, NULL, NULL) | +| Row 0 | 0 | 0 | (0, 0, NULL) | +| Row 1 | 1 | 1 | (1, 1, NULL) | +| Row 2 | 2 | -127 | (2, NULL, NULL) | +| Row 3 | 127 | -128 | (127, NULL, NULL) | +| Row 4 | 256 | -129 | (NULL, NULL, NULL) | +--------+-----------+------------+-------------------------------------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1926,11 +1926,11 @@ evaluation: +--------+--------------+------------+ | Type | Float64 | Int16 NULL | | Domain | {-4.4..=3.3} | {-4..=3} | -| Row 0 | 0_f64 | 0_i16 | -| Row 1 | 1.1_f64 | 1_i16 | -| Row 2 | 2.2_f64 | 2_i16 | -| Row 3 | 3.3_f64 | 3_i16 | -| Row 4 | -4.4_f64 | -4_i16 | +| Row 0 | 0 | 0 | +| Row 1 | 1.1 | 1 | +| Row 2 | 2.2 | 2 | +| Row 3 | 3.3 | 3 | +| Row 4 | -4.4 | -4 | +--------+--------------+------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -1950,11 +1950,11 @@ evaluation: +--------+----------+------------+ | Type | Int8 | Int16 NULL | | Domain | {-4..=3} | {-4..=3} | -| Row 0 | 0_i8 | 0_i16 | -| Row 1 | 1_i8 | 1_i16 | -| Row 2 | 2_i8 | 2_i16 | -| Row 3 | 3_i8 | 3_i16 | -| Row 4 | -4_i8 | -4_i16 | +| Row 0 | 0 | 0 | +| Row 1 | 1 | 1 | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | -4 | +--------+----------+------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -1974,11 +1974,11 @@ evaluation: +--------+----------+------------------+ | Type | Int16 | UInt16 NULL | | Domain | {-4..=3} | {0..=3} ∪ {NULL} | -| Row 0 | 0_i16 | 0_u16 | -| Row 1 | 1_i16 | 1_u16 | -| Row 2 | 2_i16 | 2_u16 | -| Row 3 | 3_i16 | 3_u16 | -| Row 4 | -4_i16 | NULL | +| Row 0 | 0 | 0 | +| Row 1 | 1 | 1 | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | NULL | +--------+----------+------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -1998,11 +1998,11 @@ evaluation: +--------+--------------------+-----------------------+ | Type | Int64 | Int16 NULL | | Domain | {-4..=11111111111} | {-4..=32767} ∪ {NULL} | -| Row 0 | 0_i64 | 0_i16 | -| Row 1 | 11111111111_i64 | NULL | -| Row 2 | 2_i64 | 2_i16 | -| Row 3 | 3_i64 | 3_i16 | -| Row 4 | -4_i64 | -4_i16 | +| Row 0 | 0 | 0 | +| Row 1 | 11111111111 | NULL | +| Row 2 | 2 | 2 | +| Row 3 | 3 | 3 | +| Row 4 | -4 | -4 | +--------+--------------------+-----------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------+ @@ -2278,13 +2278,13 @@ evaluation: +--------+--------------------------------------+--------------------------------------+ | Type | Int64 | Timestamp NULL | | Domain | {-315360000000000..=315360000000000} | {-315360000000000..=315360000000000} | -| Row 0 | -315360000000000_i64 | 1960-01-04 00:00:00.000000 | -| Row 1 | -315360000000_i64 | 1960-01-04 00:00:00.000000 | -| Row 2 | -100_i64 | 1969-12-31 23:58:20.000000 | -| Row 3 | 0_i64 | 1970-01-01 00:00:00.000000 | -| Row 4 | 100_i64 | 1970-01-01 00:01:40.000000 | -| Row 5 | 315360000000_i64 | 1979-12-30 00:00:00.000000 | -| Row 6 | 315360000000000_i64 | 1979-12-30 00:00:00.000000 | +| Row 0 | -315360000000000 | 1960-01-04 00:00:00.000000 | +| Row 1 | -315360000000 | 1960-01-04 00:00:00.000000 | +| Row 2 | -100 | 1969-12-31 23:58:20.000000 | +| Row 3 | 0 | 1970-01-01 00:00:00.000000 | +| Row 4 | 100 | 1970-01-01 00:01:40.000000 | +| Row 5 | 315360000000 | 1979-12-30 00:00:00.000000 | +| Row 6 | 315360000000000 | 1979-12-30 00:00:00.000000 | +--------+--------------------------------------+--------------------------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2301,7 +2301,7 @@ checked expr : try_to_int64(to_timestamp(minus(31536 optimized expr : -315360000000000_i64 output type : Int64 NULL output domain : {-315360000000000..=-315360000000000} -output : -315360000000000_i64 +output : -315360000000000 ast : TRY_CAST(TO_TIMESTAMP(-315360000000) AS INT64) @@ -2310,7 +2310,7 @@ checked expr : try_to_int64(to_timestamp(minus(31536 optimized expr : -315360000000000_i64 output type : Int64 NULL output domain : {-315360000000000..=-315360000000000} -output : -315360000000000_i64 +output : -315360000000000 ast : TRY_CAST(TO_TIMESTAMP(-100) AS INT64) @@ -2319,7 +2319,7 @@ checked expr : try_to_int64(to_timestamp(to_int64(min optimized expr : -100000000_i64 output type : Int64 NULL output domain : {-100000000..=-100000000} -output : -100000000_i64 +output : -100000000 ast : TRY_CAST(TO_TIMESTAMP(-0) AS INT64) @@ -2328,7 +2328,7 @@ checked expr : try_to_int64(to_timestamp(to_int64(min optimized expr : 0_i64 output type : Int64 NULL output domain : {0..=0} -output : 0_i64 +output : 0 ast : TRY_CAST(TO_TIMESTAMP(0) AS INT64) @@ -2337,7 +2337,7 @@ checked expr : try_to_int64(to_timestamp(to_int64(0_u optimized expr : 0_i64 output type : Int64 NULL output domain : {0..=0} -output : 0_i64 +output : 0 ast : TRY_CAST(TO_TIMESTAMP(100) AS INT64) @@ -2346,7 +2346,7 @@ checked expr : try_to_int64(to_timestamp(to_int64(100 optimized expr : 100000000_i64 output type : Int64 NULL output domain : {100000000..=100000000} -output : 100000000_i64 +output : 100000000 ast : TRY_CAST(TO_TIMESTAMP(315360000000) AS INT64) @@ -2355,7 +2355,7 @@ checked expr : try_to_int64(to_timestamp(to_int64(31 optimized expr : 315360000000000_i64 output type : Int64 NULL output domain : {315360000000000..=315360000000000} -output : 315360000000000_i64 +output : 315360000000000 ast : TRY_CAST(TO_TIMESTAMP(315360000000000) AS INT64) @@ -2364,7 +2364,7 @@ checked expr : try_to_int64(to_timestamp(to_int64(31 optimized expr : 315360000000000_i64 output type : Int64 NULL output domain : {315360000000000..=315360000000000} -output : 315360000000000_i64 +output : 315360000000000 ast : TRY_CAST(a AS INT64) @@ -2376,13 +2376,13 @@ evaluation: +--------+--------------------------------------+--------------------------------------+ | Type | Timestamp | Int64 NULL | | Domain | {-315360000000000..=315360000000000} | {-315360000000000..=315360000000000} | -| Row 0 | 1960-01-04 00:00:00.000000 | -315360000000000_i64 | -| Row 1 | 1969-12-28 08:24:00.000000 | -315360000000_i64 | -| Row 2 | 1969-12-31 23:59:59.999900 | -100_i64 | -| Row 3 | 1970-01-01 00:00:00.000000 | 0_i64 | -| Row 4 | 1970-01-01 00:00:00.000100 | 100_i64 | -| Row 5 | 1970-01-04 15:36:00.000000 | 315360000000_i64 | -| Row 6 | 1979-12-30 00:00:00.000000 | 315360000000000_i64 | +| Row 0 | 1960-01-04 00:00:00.000000 | -315360000000000 | +| Row 1 | 1969-12-28 08:24:00.000000 | -315360000000 | +| Row 2 | 1969-12-31 23:59:59.999900 | -100 | +| Row 3 | 1970-01-01 00:00:00.000000 | 0 | +| Row 4 | 1970-01-01 00:00:00.000100 | 100 | +| Row 5 | 1970-01-04 15:36:00.000000 | 315360000000 | +| Row 6 | 1979-12-30 00:00:00.000000 | 315360000000000 | +--------+--------------------------------------+--------------------------------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2474,11 +2474,11 @@ evaluation: +--------+---------------------+---------------------+ | Type | Int32 | Date NULL | | Domain | {-354285..=2932896} | {-354285..=2932896} | -| Row 0 | -354285_i32 | 1000-01-01 | -| Row 1 | -100_i32 | 1969-09-23 | -| Row 2 | 0_i32 | 1970-01-01 | -| Row 3 | 100_i32 | 1970-04-11 | -| Row 4 | 2932896_i32 | 9999-12-31 | +| Row 0 | -354285 | 1000-01-01 | +| Row 1 | -100 | 1969-09-23 | +| Row 2 | 0 | 1970-01-01 | +| Row 3 | 100 | 1970-04-11 | +| Row 4 | 2932896 | 9999-12-31 | +--------+---------------------+---------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------+ @@ -2495,7 +2495,7 @@ checked expr : try_to_int64(to_date(minus(354285_u32))) optimized expr : -354285_i64 output type : Int64 NULL output domain : {-354285..=-354285} -output : -354285_i64 +output : -354285 ast : TRY_CAST(TO_DATE(-100) AS INT64) @@ -2504,7 +2504,7 @@ checked expr : try_to_int64(to_date(to_int64(minus( optimized expr : -100_i64 output type : Int64 NULL output domain : {-100..=-100} -output : -100_i64 +output : -100 ast : TRY_CAST(TO_DATE(-0) AS INT64) @@ -2513,7 +2513,7 @@ checked expr : try_to_int64(to_date(to_int64(minus( optimized expr : 0_i64 output type : Int64 NULL output domain : {0..=0} -output : 0_i64 +output : 0 ast : TRY_CAST(TO_DATE(0) AS INT64) @@ -2522,7 +2522,7 @@ checked expr : try_to_int64(to_date(to_int64(0_u8))) optimized expr : 0_i64 output type : Int64 NULL output domain : {0..=0} -output : 0_i64 +output : 0 ast : TRY_CAST(TO_DATE(100) AS INT64) @@ -2531,7 +2531,7 @@ checked expr : try_to_int64(to_date(to_int64(100_u8))) optimized expr : 100_i64 output type : Int64 NULL output domain : {100..=100} -output : 100_i64 +output : 100 ast : TRY_CAST(TO_DATE(2932896) AS INT64) @@ -2540,7 +2540,7 @@ checked expr : try_to_int64(to_date(to_int64(2932896_u32) optimized expr : 2932896_i64 output type : Int64 NULL output domain : {2932896..=2932896} -output : 2932896_i64 +output : 2932896 ast : TRY_CAST(a AS INT64) @@ -2552,11 +2552,11 @@ evaluation: +--------+---------------------+---------------------+ | Type | Date | Int64 NULL | | Domain | {-354285..=2932896} | {-354285..=2932896} | -| Row 0 | 1000-01-01 | -354285_i64 | -| Row 1 | 1969-09-23 | -100_i64 | -| Row 2 | 1970-01-01 | 0_i64 | -| Row 3 | 1970-04-11 | 100_i64 | -| Row 4 | 9999-12-31 | 2932896_i64 | +| Row 0 | 1000-01-01 | -354285 | +| Row 1 | 1969-09-23 | -100 | +| Row 2 | 1970-01-01 | 0 | +| Row 3 | 1970-04-11 | 100 | +| Row 4 | 9999-12-31 | 2932896 | +--------+---------------------+---------------------+ evaluation (internal): +--------+--------------------------------------------------------------------------------------------+ @@ -2609,7 +2609,7 @@ checked expr : try_to_uint64("1") optimized expr : 1_u64 output type : UInt64 NULL output domain : {1..=1} -output : 1_u64 +output : 1 ast : TRY_CAST(str AS INT64) @@ -2621,11 +2621,11 @@ evaluation: +--------+--------------------------------+-------------------------------------------------------+ | Type | String | Int64 NULL | | Domain | {"-1"..="9223372036854775807"} | {-9223372036854775808..=9223372036854775807} ∪ {NULL} | -| Row 0 | "-9223372036854775808" | -9223372036854775808_i64 | -| Row 1 | "-1" | -1_i64 | -| Row 2 | "0" | 0_i64 | -| Row 3 | "1" | 1_i64 | -| Row 4 | "9223372036854775807" | 9223372036854775807_i64 | +| Row 0 | "-9223372036854775808" | -9223372036854775808 | +| Row 1 | "-1" | -1 | +| Row 2 | "0" | 0 | +| Row 3 | "1" | 1 | +| Row 4 | "9223372036854775807" | 9223372036854775807 | +--------+--------------------------------+-------------------------------------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2645,11 +2645,11 @@ evaluation: +--------+----------------------------------------------+------------------------+ | Type | Int64 | String NULL | | Domain | {-9223372036854775808..=9223372036854775807} | {""..} ∪ {NULL} | -| Row 0 | -9223372036854775808_i64 | "-9223372036854775808" | -| Row 1 | -1_i64 | "-1" | -| Row 2 | 0_i64 | "0" | -| Row 3 | 1_i64 | "1" | -| Row 4 | 9223372036854775807_i64 | "9223372036854775807" | +| Row 0 | -9223372036854775808 | "-9223372036854775808" | +| Row 1 | -1 | "-1" | +| Row 2 | 0 | "0" | +| Row 3 | 1 | "1" | +| Row 4 | 9223372036854775807 | "9223372036854775807" | +--------+----------------------------------------------+------------------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2669,9 +2669,9 @@ evaluation: +--------+----------------------------+------------------------+ | Type | UInt64 | String NULL | | Domain | {0..=18446744073709551615} | {""..} ∪ {NULL} | -| Row 0 | 0_u64 | "0" | -| Row 1 | 1_u64 | "1" | -| Row 2 | 18446744073709551615_u64 | "18446744073709551615" | +| Row 0 | 0 | "0" | +| Row 1 | 1 | "1" | +| Row 2 | 18446744073709551615 | "18446744073709551615" | +--------+----------------------------+------------------------+ evaluation (internal): +--------+--------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2799,7 +2799,7 @@ checked expr : try_to_uint64(false) optimized expr : 0_u64 output type : UInt64 NULL output domain : {0..=0} -output : 0_u64 +output : 0 ast : TRY_CAST(true AS INT64) @@ -2808,7 +2808,7 @@ checked expr : try_to_int64(true) optimized expr : 1_i64 output type : Int64 NULL output domain : {1..=1} -output : 1_i64 +output : 1 ast : TRY_CAST(0.0 AS BOOLEAN) @@ -2856,10 +2856,10 @@ evaluation: +--------+----------+---------------+ | Type | Int64 | Boolean NULL | | Domain | {-1..=2} | {FALSE, TRUE} | -| Row 0 | 0_i64 | false | -| Row 1 | -1_i64 | true | -| Row 2 | 1_i64 | true | -| Row 3 | 2_i64 | true | +| Row 0 | 0 | false | +| Row 1 | -1 | true | +| Row 2 | 1 | true | +| Row 3 | 2 | true | +--------+----------+---------------+ evaluation (internal): +--------+--------------------------------------------------------------------------+ @@ -2879,9 +2879,9 @@ evaluation: +--------+---------+---------------+ | Type | UInt64 | Boolean NULL | | Domain | {0..=2} | {FALSE, TRUE} | -| Row 0 | 0_u64 | false | -| Row 1 | 1_u64 | true | -| Row 2 | 2_u64 | true | +| Row 0 | 0 | false | +| Row 1 | 1 | true | +| Row 2 | 2 | true | +--------+---------+---------------+ evaluation (internal): +--------+--------------------------------------------------------------------------+ @@ -2901,8 +2901,8 @@ evaluation: +--------+---------------+-------------+ | Type | Boolean | UInt64 NULL | | Domain | {FALSE, TRUE} | {0..=1} | -| Row 0 | false | 0_u64 | -| Row 1 | true | 1_u64 | +| Row 0 | false | 0 | +| Row 1 | true | 1 | +--------+---------------+-------------+ evaluation (internal): +--------+-------------------------------------------------------------------+ @@ -2922,8 +2922,8 @@ evaluation: +--------+---------------+------------+ | Type | Boolean | Int64 NULL | | Domain | {FALSE, TRUE} | {0..=1} | -| Row 0 | false | 0_i64 | -| Row 1 | true | 1_i64 | +| Row 0 | false | 0 | +| Row 1 | true | 1 | +--------+---------------+------------+ evaluation (internal): +--------+------------------------------------------------------------------+ @@ -3011,11 +3011,11 @@ evaluation: +--------+---------------------+-------------------------------------------+ | Type | Int32 | Timestamp NULL | | Domain | {-354285..=2932896} | {-30610224000000000..=253402214400000000} | -| Row 0 | -354285_i32 | 1000-01-01 00:00:00.000000 | -| Row 1 | -100_i32 | 1969-09-23 00:00:00.000000 | -| Row 2 | 0_i32 | 1970-01-01 00:00:00.000000 | -| Row 3 | 100_i32 | 1970-04-11 00:00:00.000000 | -| Row 4 | 2932896_i32 | 9999-12-31 00:00:00.000000 | +| Row 0 | -354285 | 1000-01-01 00:00:00.000000 | +| Row 1 | -100 | 1969-09-23 00:00:00.000000 | +| Row 2 | 0 | 1970-01-01 00:00:00.000000 | +| Row 3 | 100 | 1970-04-11 00:00:00.000000 | +| Row 4 | 2932896 | 9999-12-31 00:00:00.000000 | +--------+---------------------+-------------------------------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------------------------------------+ @@ -3036,7 +3036,7 @@ evaluation: +--------+---------------------------------------------+----------------+ | Type | Int64 | Timestamp NULL | | Domain | {9223372036854775807..=9223372036854775807} | {NULL} | -| Row 0 | 9223372036854775807_i64 | NULL | +| Row 0 | 9223372036854775807 | NULL | +--------+---------------------------------------------+----------------+ evaluation (internal): +--------+--------------------------------------------------------+ @@ -3057,7 +3057,7 @@ evaluation: +--------+---------------------------------------------+-----------+ | Type | Int64 | Date NULL | | Domain | {9223372036854775807..=9223372036854775807} | {NULL} | -| Row 0 | 9223372036854775807_i64 | NULL | +| Row 0 | 9223372036854775807 | NULL | +--------+---------------------------------------------+-----------+ evaluation (internal): +--------+--------------------------------------------------------+ @@ -3478,7 +3478,7 @@ checked expr : TRY_CAST(tuple(tuple(1_u8) optimized expr : 1_i32 output type : Int32 NULL output domain : {1..=1} -output : 1_i32 +output : 1 ast : TRY_CAST(((1, 'a'), 1) AS Tuple(Tuple(INT, INT NULL), INT)) @@ -3496,7 +3496,7 @@ checked expr : TRY_CAST(tuple(tuple(tuple(tuple(1_u8, true), tuple(2_u8, false)) AS Array(Tuple(Int32 NULL, Int32 NULL) NULL) NULL) -optimized expr : [(1_i32, 1_i32), (2_i32, 0_i32)] +optimized expr : [(1, 1), (2, 0)] output type : Array(Tuple(Int32 NULL, Int32 NULL) NULL) NULL output domain : [({1..=2}, {0..=1})] -output : [(1_i32, 1_i32), (2_i32, 0_i32)] +output : [(1, 1), (2, 0)] ast : TRY_CAST([(1,'a'),(2,'a')] AS Array(Tuple(INT, INT)) NULL) raw expr : TRY_CAST(array(tuple(1_u8, "a"), tuple(2_u8, "a")) AS Array(Tuple(Int32, Int32)) NULL) checked expr : TRY_CAST(array(tuple(1_u8, "a"), tuple(2_u8, "a")) AS Array(Tuple(Int32 NULL, Int32 NULL) NULL) NULL) -optimized expr : [(1_i32, NULL), (2_i32, NULL)] +optimized expr : [(1, NULL), (2, NULL)] output type : Array(Tuple(Int32 NULL, Int32 NULL) NULL) NULL output domain : [({1..=2}, {0..=0} ∪ {NULL})] -output : [(1_i32, NULL), (2_i32, NULL)] +output : [(1, NULL), (2, NULL)] ast : TRY_CAST([(1,'a'),(2,'a')] AS Array(Tuple(INT, INT NULL))) raw expr : TRY_CAST(array(tuple(1_u8, "a"), tuple(2_u8, "a")) AS Array(Tuple(Int32, Int32 NULL))) checked expr : TRY_CAST(array(tuple(1_u8, "a"), tuple(2_u8, "a")) AS Array(Tuple(Int32 NULL, Int32 NULL) NULL) NULL) -optimized expr : [(1_i32, NULL), (2_i32, NULL)] +optimized expr : [(1, NULL), (2, NULL)] output type : Array(Tuple(Int32 NULL, Int32 NULL) NULL) NULL output domain : [({1..=2}, {0..=0} ∪ {NULL})] -output : [(1_i32, NULL), (2_i32, NULL)] +output : [(1, NULL), (2, NULL)] ast : TRY_CAST([[TRUE], [FALSE, TRUE]] AS Array(Array(INT))) raw expr : TRY_CAST(array(array(true), array(false, true)) AS Array(Array(Int32))) checked expr : TRY_CAST(array(array(true), array(false, true)) AS Array(Array(Int32 NULL) NULL) NULL) -optimized expr : [[1_i32], [0_i32, 1_i32]] +optimized expr : [[1], [0, 1]] output type : Array(Array(Int32 NULL) NULL) NULL output domain : [[{0..=1}]] -output : [[1_i32], [0_i32, 1_i32]] +output : [[1], [0, 1]] ast : TRY_CAST([['a'], ['b', 'c']] AS Array(Array(INT) NULL)) diff --git a/src/query/functions/tests/it/scalars/testdata/comparison.txt b/src/query/functions/tests/it/scalars/testdata/comparison.txt index 92487c9adf837..c9e40aa2b0706 100644 --- a/src/query/functions/tests/it/scalars/testdata/comparison.txt +++ b/src/query/functions/tests/it/scalars/testdata/comparison.txt @@ -187,17 +187,17 @@ evaluation: +--------+----------+-----------+---------------+ | Type | UInt8 | Int64 | Boolean | | Domain | {0..=10} | {-1..=10} | {FALSE, TRUE} | -| Row 0 | 0_u8 | 0_i64 | true | -| Row 1 | 1_u8 | -1_i64 | false | -| Row 2 | 2_u8 | 2_i64 | true | -| Row 3 | 3_u8 | 3_i64 | true | -| Row 4 | 4_u8 | 4_i64 | true | -| Row 5 | 5_u8 | 5_i64 | true | -| Row 6 | 6_u8 | 6_i64 | true | -| Row 7 | 7_u8 | 7_i64 | true | -| Row 8 | 8_u8 | 8_i64 | true | -| Row 9 | 9_u8 | 9_i64 | true | -| Row 10 | 10_u8 | 10_i64 | true | +| Row 0 | 0 | 0 | true | +| Row 1 | 1 | -1 | false | +| Row 2 | 2 | 2 | true | +| Row 3 | 3 | 3 | true | +| Row 4 | 4 | 4 | true | +| Row 5 | 5 | 5 | true | +| Row 6 | 6 | 6 | true | +| Row 7 | 7 | 7 | true | +| Row 8 | 8 | 8 | true | +| Row 9 | 9 | 9 | true | +| Row 10 | 10 | 10 | true | +--------+----------+-----------+---------------+ evaluation (internal): +--------+--------------------------------------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/control.txt b/src/query/functions/tests/it/scalars/testdata/control.txt index acd4f4af54e1d..619100db69871 100644 --- a/src/query/functions/tests/it/scalars/testdata/control.txt +++ b/src/query/functions/tests/it/scalars/testdata/control.txt @@ -13,7 +13,7 @@ checked expr : multi_if optimized expr : 1_u8 output type : UInt8 NULL output domain : {1..=1} -output : 1_u8 +output : 1 ast : multi_if(false, 1, true, 2, NULL) @@ -22,7 +22,7 @@ checked expr : multi_if optimized expr : 2_u8 output type : UInt8 NULL output domain : {2..=2} -output : 2_u8 +output : 2 ast : multi_if(true, 1, true, 2, NULL) @@ -31,7 +31,7 @@ checked expr : multi_if optimized expr : 1_u8 output type : UInt8 NULL output domain : {1..=1} -output : 1_u8 +output : 1 ast : multi_if(true, 1, true, NULL, 2) @@ -40,7 +40,7 @@ checked expr : multi_if optimized expr : 1_u8 output type : UInt8 NULL output domain : {1..=1} -output : 1_u8 +output : 1 ast : multi_if(true, 1, NULL) @@ -49,7 +49,7 @@ checked expr : multi_if(CAST(true AS Bool optimized expr : 1_u8 output type : UInt8 NULL output domain : {1..=1} -output : 1_u8 +output : 1 ast : multi_if(false, 1, NULL) @@ -70,10 +70,10 @@ evaluation: +--------+---------------+-----------+------------------+------------------+ | Type | Boolean | Int64 | Int64 NULL | Int64 NULL | | Domain | {FALSE, TRUE} | {1..=4} | {5..=8} ∪ {NULL} | {1..=8} ∪ {NULL} | -| Row 0 | true | 1_i64 | 5_i64 | 1_i64 | -| Row 1 | true | 2_i64 | NULL | 2_i64 | -| Row 2 | false | 3_i64 | 7_i64 | 7_i64 | -| Row 3 | false | 4_i64 | NULL | NULL | +| Row 0 | true | 1 | 5 | 1 | +| Row 1 | true | 2 | NULL | 2 | +| Row 2 | false | 3 | 7 | 7 | +| Row 3 | false | 4 | NULL | NULL | +--------+---------------+-----------+------------------+------------------+ evaluation (internal): +-----------+------------------------------------------------------------------------+ @@ -95,10 +95,10 @@ evaluation: +--------+---------------+-----------+------------------+------------------+ | Type | Boolean | Int64 | Int64 NULL | Int64 NULL | | Domain | {FALSE, TRUE} | {1..=4} | {5..=8} ∪ {NULL} | {1..=8} ∪ {NULL} | -| Row 0 | false | 1_i64 | 5_i64 | 5_i64 | -| Row 1 | false | 2_i64 | 6_i64 | 6_i64 | -| Row 2 | true | 3_i64 | NULL | 3_i64 | -| Row 3 | true | 4_i64 | NULL | 4_i64 | +| Row 0 | false | 1 | 5 | 5 | +| Row 1 | false | 2 | 6 | 6 | +| Row 2 | true | 3 | NULL | 3 | +| Row 3 | true | 4 | NULL | 4 | +--------+---------------+-----------+------------------+------------------+ evaluation (internal): +-----------+------------------------------------------------------------------------+ @@ -120,10 +120,10 @@ evaluation: +--------+---------------+---------+-----------------+---------+-------------------+-------------------+ | Type | Boolean | Int64 | Boolean NULL | Int64 | Int64 NULL | Int64 NULL | | Domain | {FALSE, TRUE} | {1..=4} | {TRUE} ∪ {NULL} | {5..=8} | {9..=12} ∪ {NULL} | {1..=12} ∪ {NULL} | -| Row 0 | true | 1_i64 | NULL | 5_i64 | 9_i64 | 1_i64 | -| Row 1 | true | 2_i64 | true | 6_i64 | 10_i64 | 2_i64 | -| Row 2 | false | 3_i64 | NULL | 7_i64 | NULL | NULL | -| Row 3 | false | 4_i64 | true | 8_i64 | NULL | 8_i64 | +| Row 0 | true | 1 | NULL | 5 | 9 | 1 | +| Row 1 | true | 2 | true | 6 | 10 | 2 | +| Row 2 | false | 3 | NULL | 7 | NULL | NULL | +| Row 3 | false | 4 | true | 8 | NULL | 8 | +--------+---------------+---------+-----------------+---------+-------------------+-------------------+ evaluation (internal): +-----------+---------------------------------------------------------------------------+ @@ -147,10 +147,10 @@ evaluation: +--------+---------------+---------+---------------+---------+-----------+----------+ | Type | Boolean | Int64 | Boolean | Int64 | Int64 | Int64 | | Domain | {FALSE, TRUE} | {1..=4} | {FALSE, TRUE} | {5..=8} | {9..=12} | {1..=12} | -| Row 0 | true | 1_i64 | true | 5_i64 | 9_i64 | 1_i64 | -| Row 1 | true | 2_i64 | false | 6_i64 | 10_i64 | 2_i64 | -| Row 2 | false | 3_i64 | true | 7_i64 | 11_i64 | 7_i64 | -| Row 3 | false | 4_i64 | false | 8_i64 | 12_i64 | 12_i64 | +| Row 0 | true | 1 | true | 5 | 9 | 1 | +| Row 1 | true | 2 | false | 6 | 10 | 2 | +| Row 2 | false | 3 | true | 7 | 11 | 7 | +| Row 3 | false | 4 | false | 8 | 12 | 12 | +--------+---------------+---------+---------------+---------+-----------+----------+ evaluation (internal): +-----------+------------------------+ @@ -238,10 +238,10 @@ evaluation: +--------+-----------+---------+ | Type | Int64 | Boolean | | Domain | {5..=8} | {TRUE} | -| Row 0 | 5_i64 | true | -| Row 1 | 6_i64 | true | -| Row 2 | 7_i64 | true | -| Row 3 | 8_i64 | true | +| Row 0 | 5 | true | +| Row 1 | 6 | true | +| Row 2 | 7 | true | +| Row 3 | 8 | true | +--------+-----------+---------+ evaluation (internal): +-----------+-----------------------+ @@ -261,8 +261,8 @@ evaluation: +--------+-------------------+---------------+ | Type | Int64 NULL | Boolean | | Domain | {9..=12} ∪ {NULL} | {FALSE, TRUE} | -| Row 0 | 9_i64 | true | -| Row 1 | 10_i64 | true | +| Row 0 | 9 | true | +| Row 1 | 10 | true | | Row 2 | NULL | false | | Row 3 | NULL | false | +--------+-------------------+---------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/datetime.txt b/src/query/functions/tests/it/scalars/testdata/datetime.txt index eba1a61bff11c..df90ff6b5f92b 100644 --- a/src/query/functions/tests/it/scalars/testdata/datetime.txt +++ b/src/query/functions/tests/it/scalars/testdata/datetime.txt @@ -2,7 +2,7 @@ error: --> SQL:1:1 | 1 | to_timestamp(-30610224000000001) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(-30610224000000001_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(-30610224000000001)` @@ -82,7 +82,7 @@ error: --> SQL:1:1 | 1 | to_timestamp(253402300800000000) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(253402300800000000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(253402300800000000)` @@ -95,13 +95,13 @@ evaluation: +--------+--------------------------------------+--------------------------------------+ | Type | Int64 | Timestamp | | Domain | {-315360000000000..=315360000000000} | {-315360000000000..=315360000000000} | -| Row 0 | -315360000000000_i64 | 1960-01-04 00:00:00.000000 | -| Row 1 | 315360000000_i64 | 1979-12-30 00:00:00.000000 | -| Row 2 | -100_i64 | 1969-12-31 23:58:20.000000 | -| Row 3 | 0_i64 | 1970-01-01 00:00:00.000000 | -| Row 4 | 100_i64 | 1970-01-01 00:01:40.000000 | -| Row 5 | 315360000000_i64 | 1979-12-30 00:00:00.000000 | -| Row 6 | 315360000000000_i64 | 1979-12-30 00:00:00.000000 | +| Row 0 | -315360000000000 | 1960-01-04 00:00:00.000000 | +| Row 1 | 315360000000 | 1979-12-30 00:00:00.000000 | +| Row 2 | -100 | 1969-12-31 23:58:20.000000 | +| Row 3 | 0 | 1970-01-01 00:00:00.000000 | +| Row 4 | 100 | 1970-01-01 00:01:40.000000 | +| Row 5 | 315360000000 | 1979-12-30 00:00:00.000000 | +| Row 6 | 315360000000000 | 1979-12-30 00:00:00.000000 | +--------+--------------------------------------+--------------------------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------+ @@ -116,7 +116,7 @@ error: --> SQL:1:1 | 1 | to_datetime(-30610224000000001) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(-30610224000000001_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(-30610224000000001)` @@ -196,7 +196,7 @@ error: --> SQL:1:1 | 1 | to_datetime(253402300800000000) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(253402300800000000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `to_timestamp(253402300800000000)` @@ -209,13 +209,13 @@ evaluation: +--------+--------------------------------------+--------------------------------------+ | Type | Int64 | Timestamp | | Domain | {-315360000000000..=315360000000000} | {-315360000000000..=315360000000000} | -| Row 0 | -315360000000000_i64 | 1960-01-04 00:00:00.000000 | -| Row 1 | 315360000000_i64 | 1979-12-30 00:00:00.000000 | -| Row 2 | -100_i64 | 1969-12-31 23:58:20.000000 | -| Row 3 | 0_i64 | 1970-01-01 00:00:00.000000 | -| Row 4 | 100_i64 | 1970-01-01 00:01:40.000000 | -| Row 5 | 315360000000_i64 | 1979-12-30 00:00:00.000000 | -| Row 6 | 315360000000000_i64 | 1979-12-30 00:00:00.000000 | +| Row 0 | -315360000000000 | 1960-01-04 00:00:00.000000 | +| Row 1 | 315360000000 | 1979-12-30 00:00:00.000000 | +| Row 2 | -100 | 1969-12-31 23:58:20.000000 | +| Row 3 | 0 | 1970-01-01 00:00:00.000000 | +| Row 4 | 100 | 1970-01-01 00:01:40.000000 | +| Row 5 | 315360000000 | 1979-12-30 00:00:00.000000 | +| Row 6 | 315360000000000 | 1979-12-30 00:00:00.000000 | +--------+--------------------------------------+--------------------------------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------+ @@ -230,7 +230,7 @@ error: --> SQL:1:1 | 1 | to_date(-354286) - | ^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(-354286_i64)` + | ^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(-354286)` @@ -292,7 +292,7 @@ error: --> SQL:1:1 | 1 | to_date(2932897) - | ^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(2932897_i64)` + | ^^^^^^^^^^^^^^^^ date is out of range while evaluating function `to_date(2932897)` @@ -305,11 +305,11 @@ evaluation: +--------+---------------------+---------------------+ | Type | Int32 | Date | | Domain | {-354285..=2932896} | {-354285..=2932896} | -| Row 0 | -354285_i32 | 1000-01-01 | -| Row 1 | -100_i32 | 1969-09-23 | -| Row 2 | 0_i32 | 1970-01-01 | -| Row 3 | 100_i32 | 1970-04-11 | -| Row 4 | 2932896_i32 | 9999-12-31 | +| Row 0 | -354285 | 1000-01-01 | +| Row 1 | -100 | 1969-09-23 | +| Row 2 | 0 | 1970-01-01 | +| Row 3 | 100 | 1970-04-11 | +| Row 4 | 2932896 | 9999-12-31 | +--------+---------------------+---------------------+ evaluation (internal): +--------+-----------------------------------------+ @@ -324,7 +324,7 @@ error: --> SQL:1:1 | 1 | add_years(to_date(0), 10000) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `add_years(1970-01-01, 10000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `add_years(1970-01-01, 10000)` @@ -400,9 +400,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1970-09-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1972-01-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1973-04-11 | +| Row 0 | 1969-09-23 | 1 | 1970-09-23 | +| Row 1 | 1970-01-01 | 2 | 1972-01-01 | +| Row 2 | 1970-04-11 | 3 | 1973-04-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -423,9 +423,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-12-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-07-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1971-01-11 | +| Row 0 | 1969-09-23 | 1 | 1969-12-23 | +| Row 1 | 1970-01-01 | 2 | 1970-07-01 | +| Row 2 | 1970-04-11 | 3 | 1971-01-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -446,9 +446,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-10-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-03-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-07-11 | +| Row 0 | 1969-09-23 | 1 | 1969-10-23 | +| Row 1 | 1970-01-01 | 2 | 1970-03-01 | +| Row 2 | 1970-04-11 | 3 | 1970-07-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -469,9 +469,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-09-24 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-01-03 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-04-14 | +| Row 0 | 1969-09-23 | 1 | 1969-09-24 | +| Row 1 | 1970-01-01 | 2 | 1970-01-03 | +| Row 2 | 1970-04-11 | 3 | 1970-04-14 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -492,9 +492,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1968-09-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1968-01-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1967-04-11 | +| Row 0 | 1969-09-23 | 1 | 1968-09-23 | +| Row 1 | 1970-01-01 | 2 | 1968-01-01 | +| Row 2 | 1970-04-11 | 3 | 1967-04-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+--------------------+ @@ -515,9 +515,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-06-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-07-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1969-07-11 | +| Row 0 | 1969-09-23 | 1 | 1969-06-23 | +| Row 1 | 1970-01-01 | 2 | 1969-07-01 | +| Row 2 | 1970-04-11 | 3 | 1969-07-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+--------------------+ @@ -538,9 +538,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-08-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-11-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-01-11 | +| Row 0 | 1969-09-23 | 1 | 1969-08-23 | +| Row 1 | 1970-01-01 | 2 | 1969-11-01 | +| Row 2 | 1970-04-11 | 3 | 1970-01-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -561,9 +561,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-09-22 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-12-30 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-04-08 | +| Row 0 | 1969-09-23 | 1 | 1969-09-22 | +| Row 1 | 1970-01-01 | 2 | 1969-12-30 | +| Row 2 | 1970-04-11 | 3 | 1970-04-08 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -579,7 +579,7 @@ error: --> SQL:1:1 | 1 | add_years(to_timestamp(0), 10000) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `add_years(1970-01-01 00:00:00.000000, 10000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `add_years(1970-01-01 00:00:00.000000, 10000)` @@ -718,9 +718,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-12-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1972-01-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1973-01-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-12-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1972-01-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1973-01-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------------------------+ @@ -741,9 +741,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-03-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-07-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-10-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-03-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-07-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-10-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------------------+ @@ -764,9 +764,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-03-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-04-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-03-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-04-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-----------------------------------------------+ @@ -787,9 +787,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-03 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-04 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-03 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-04 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------------+ @@ -810,9 +810,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 02:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 03:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 02:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 03:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+---------------------------------------+ @@ -833,9 +833,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:00:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 00:02:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 00:03:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:00:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 00:02:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 00:03:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------+ @@ -856,9 +856,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:00:00.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 00:00:02.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 00:00:03.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:00:00.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 00:00:02.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 00:00:03.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------+ @@ -879,9 +879,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1968-12-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1968-01-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1967-01-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1968-12-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1968-01-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1967-01-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-----------------------------------------------------+ @@ -902,9 +902,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-09-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-07-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-04-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-09-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-07-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-04-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------+ @@ -925,9 +925,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-11-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-11-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-10-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-11-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-11-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-10-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------------------------+ @@ -948,9 +948,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-30 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-29 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-30 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-29 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------------------+ @@ -971,9 +971,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 22:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 22:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 21:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 22:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 22:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 21:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+------------------------------------------+ @@ -994,9 +994,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 23:58:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 23:58:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 23:57:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 23:58:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 23:58:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 23:57:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------+ @@ -1017,9 +1017,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 23:59:58.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 23:59:58.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 23:59:57.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 23:59:58.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 23:59:58.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 23:59:57.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------+ @@ -1035,7 +1035,7 @@ error: --> SQL:1:1 | 1 | date_add(year, 10000, to_date(0)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `add_years(1970-01-01, 10000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ date is out of range while evaluating function `add_years(1970-01-01, 10000)` @@ -1120,9 +1120,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1970-09-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1972-01-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1973-04-11 | +| Row 0 | 1969-09-23 | 1 | 1970-09-23 | +| Row 1 | 1970-01-01 | 2 | 1972-01-01 | +| Row 2 | 1970-04-11 | 3 | 1973-04-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1143,9 +1143,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-12-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-07-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1971-01-11 | +| Row 0 | 1969-09-23 | 1 | 1969-12-23 | +| Row 1 | 1970-01-01 | 2 | 1970-07-01 | +| Row 2 | 1970-04-11 | 3 | 1971-01-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1166,9 +1166,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-10-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-03-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-07-11 | +| Row 0 | 1969-09-23 | 1 | 1969-10-23 | +| Row 1 | 1970-01-01 | 2 | 1970-03-01 | +| Row 2 | 1970-04-11 | 3 | 1970-07-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1189,9 +1189,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-09-24 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-01-03 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-04-14 | +| Row 0 | 1969-09-23 | 1 | 1969-09-24 | +| Row 1 | 1970-01-01 | 2 | 1970-01-03 | +| Row 2 | 1970-04-11 | 3 | 1970-04-14 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1212,9 +1212,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1968-09-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1968-01-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1967-04-11 | +| Row 0 | 1969-09-23 | 1 | 1968-09-23 | +| Row 1 | 1970-01-01 | 2 | 1968-01-01 | +| Row 2 | 1970-04-11 | 3 | 1967-04-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+--------------------+ @@ -1235,9 +1235,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-06-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-07-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1969-07-11 | +| Row 0 | 1969-09-23 | 1 | 1969-06-23 | +| Row 1 | 1970-01-01 | 2 | 1969-07-01 | +| Row 2 | 1970-04-11 | 3 | 1969-07-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+--------------------+ @@ -1258,9 +1258,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-08-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-11-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-01-11 | +| Row 0 | 1969-09-23 | 1 | 1969-08-23 | +| Row 1 | 1970-01-01 | 2 | 1969-11-01 | +| Row 2 | 1970-04-11 | 3 | 1970-01-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1281,9 +1281,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-09-22 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-12-30 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-04-08 | +| Row 0 | 1969-09-23 | 1 | 1969-09-22 | +| Row 1 | 1970-01-01 | 2 | 1969-12-30 | +| Row 2 | 1970-04-11 | 3 | 1970-04-08 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1299,7 +1299,7 @@ error: --> SQL:1:1 | 1 | date_add(year, 10000, to_timestamp(0)) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `add_years(1970-01-01 00:00:00.000000, 10000_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ timestamp is out of range while evaluating function `add_years(1970-01-01 00:00:00.000000, 10000)` @@ -1438,9 +1438,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-12-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1972-01-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1973-01-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-12-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1972-01-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1973-01-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------------------------+ @@ -1461,9 +1461,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-03-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-07-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-10-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-03-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-07-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-10-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------------------+ @@ -1484,9 +1484,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-03-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-04-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-03-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-04-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-----------------------------------------------+ @@ -1507,9 +1507,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-03 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-04 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-03 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-04 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------------+ @@ -1530,9 +1530,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 02:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 03:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 02:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 03:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+---------------------------------------+ @@ -1553,9 +1553,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:00:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 00:02:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 00:03:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:00:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 00:02:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 00:03:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------+ @@ -1576,9 +1576,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:00:00.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 00:00:02.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 00:00:03.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:00:00.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 00:00:02.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 00:00:03.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------+ @@ -1599,9 +1599,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1968-12-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1968-01-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1967-01-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1968-12-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1968-01-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1967-01-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-----------------------------------------------------+ @@ -1622,9 +1622,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-09-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-07-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-04-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-09-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-07-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-04-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------+ @@ -1645,9 +1645,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-11-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-11-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-10-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-11-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-11-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-10-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------------------------+ @@ -1668,9 +1668,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-30 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-29 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-30 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-29 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------------------+ @@ -1691,9 +1691,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 22:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 22:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 21:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 22:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 22:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 21:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+------------------------------------------+ @@ -1714,9 +1714,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 23:58:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 23:58:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 23:57:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 23:58:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 23:58:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 23:57:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------+ @@ -1737,9 +1737,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 23:59:58.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 23:59:58.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 23:59:57.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 23:59:58.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 23:59:58.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 23:59:57.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------+ @@ -1755,7 +1755,7 @@ error: --> SQL:1:12 | 1 | to_date(0) + interval 10000 year - | ^ date is out of range while evaluating function `add_years(1970-01-01, 10000_i64)` + | ^ date is out of range while evaluating function `add_years(1970-01-01, 10000)` @@ -1840,9 +1840,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1970-09-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1972-01-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1973-04-11 | +| Row 0 | 1969-09-23 | 1 | 1970-09-23 | +| Row 1 | 1970-01-01 | 2 | 1972-01-01 | +| Row 2 | 1970-04-11 | 3 | 1973-04-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1863,9 +1863,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-12-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-07-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1971-01-11 | +| Row 0 | 1969-09-23 | 1 | 1969-12-23 | +| Row 1 | 1970-01-01 | 2 | 1970-07-01 | +| Row 2 | 1970-04-11 | 3 | 1971-01-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1886,9 +1886,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-10-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-03-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-07-11 | +| Row 0 | 1969-09-23 | 1 | 1969-10-23 | +| Row 1 | 1970-01-01 | 2 | 1970-03-01 | +| Row 2 | 1970-04-11 | 3 | 1970-07-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1909,9 +1909,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-09-24 | -| Row 1 | 1970-01-01 | 2_i32 | 1970-01-03 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-04-14 | +| Row 0 | 1969-09-23 | 1 | 1969-09-24 | +| Row 1 | 1970-01-01 | 2 | 1970-01-03 | +| Row 2 | 1970-04-11 | 3 | 1970-04-14 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -1932,9 +1932,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1968-09-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1968-01-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1967-04-11 | +| Row 0 | 1969-09-23 | 1 | 1968-09-23 | +| Row 1 | 1970-01-01 | 2 | 1968-01-01 | +| Row 2 | 1970-04-11 | 3 | 1967-04-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+--------------------+ @@ -1955,9 +1955,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-06-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-07-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1969-07-11 | +| Row 0 | 1969-09-23 | 1 | 1969-06-23 | +| Row 1 | 1970-01-01 | 2 | 1969-07-01 | +| Row 2 | 1970-04-11 | 3 | 1969-07-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+--------------------+ @@ -1978,9 +1978,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-08-23 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-11-01 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-01-11 | +| Row 0 | 1969-09-23 | 1 | 1969-08-23 | +| Row 1 | 1970-01-01 | 2 | 1969-11-01 | +| Row 2 | 1970-04-11 | 3 | 1970-01-11 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -2001,9 +2001,9 @@ evaluation: +--------+--------------+---------+------------+ | Type | Date | Int32 | Date | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-09-23 | 1_i32 | 1969-09-22 | -| Row 1 | 1970-01-01 | 2_i32 | 1969-12-30 | -| Row 2 | 1970-04-11 | 3_i32 | 1970-04-08 | +| Row 0 | 1969-09-23 | 1 | 1969-09-22 | +| Row 1 | 1970-01-01 | 2 | 1969-12-30 | +| Row 2 | 1970-04-11 | 3 | 1970-04-08 | +--------+--------------+---------+------------+ evaluation (internal): +--------+------------------+ @@ -2019,7 +2019,7 @@ error: --> SQL:1:17 | 1 | to_timestamp(0) + interval 10000 year - | ^ timestamp is out of range while evaluating function `add_years(1970-01-01 00:00:00.000000, 10000_i64)` + | ^ timestamp is out of range while evaluating function `add_years(1970-01-01 00:00:00.000000, 10000)` @@ -2158,9 +2158,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-12-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1972-01-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1973-01-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-12-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1972-01-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1973-01-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------------------------+ @@ -2181,9 +2181,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-03-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-07-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-10-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-03-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-07-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-10-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------------------+ @@ -2204,9 +2204,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-03-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-04-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-03-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-04-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-----------------------------------------------+ @@ -2227,9 +2227,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-03 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-04 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-03 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-04 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------------+ @@ -2250,9 +2250,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 02:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 03:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 02:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 03:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+---------------------------------------+ @@ -2273,9 +2273,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:00:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 00:02:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 00:03:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:00:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 00:02:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 00:03:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------+ @@ -2296,9 +2296,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1970-01-01 00:00:00.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1970-01-01 00:00:02.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1970-01-01 00:00:03.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1970-01-01 00:00:00.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1970-01-01 00:00:02.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1970-01-01 00:00:03.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------+ @@ -2319,9 +2319,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1968-12-31 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1968-01-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1967-01-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1968-12-31 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1968-01-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1967-01-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-----------------------------------------------------+ @@ -2342,9 +2342,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-09-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-07-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-04-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-09-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-07-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-04-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------+ @@ -2365,9 +2365,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-11-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-11-01 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-10-01 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-11-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-11-01 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-10-01 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------------------------+ @@ -2388,9 +2388,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-30 23:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-30 00:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-29 00:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-30 23:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-30 00:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-29 00:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+----------------------------------------------+ @@ -2411,9 +2411,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 22:59:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 22:00:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 21:00:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 22:59:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 22:00:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 21:00:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+------------------------------------------+ @@ -2434,9 +2434,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 23:58:59.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 23:58:00.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 23:57:00.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 23:58:59.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 23:58:00.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 23:57:00.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+-------------------------------------+ @@ -2457,9 +2457,9 @@ evaluation: +--------+----------------------------+---------+----------------------------+ | Type | Timestamp | Int32 | Timestamp | | Domain | {-100..=100} | {1..=3} | Unknown | -| Row 0 | 1969-12-31 23:59:59.999900 | 1_i32 | 1969-12-31 23:59:58.999900 | -| Row 1 | 1970-01-01 00:00:00.000000 | 2_i32 | 1969-12-31 23:59:58.000000 | -| Row 2 | 1970-01-01 00:00:00.000100 | 3_i32 | 1969-12-31 23:59:57.000100 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1 | 1969-12-31 23:59:58.999900 | +| Row 1 | 1970-01-01 00:00:00.000000 | 2 | 1969-12-31 23:59:58.000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 3 | 1969-12-31 23:59:57.000100 | +--------+----------------------------+---------+----------------------------+ evaluation (internal): +--------+--------------------------------+ @@ -2477,7 +2477,7 @@ checked expr : to_yyyymm(to_date(to_int64(18875_u16))) optimized expr : 202109_u32 output type : UInt32 output domain : {202109..=202109} -output : 202109_u32 +output : 202109 ast : to_yyyymmdd(to_date(18875)) @@ -2486,7 +2486,7 @@ checked expr : to_yyyymmdd(to_date(to_int64(18875_u16))) optimized expr : 20210905_u32 output type : UInt32 output domain : {20210905..=20210905} -output : 20210905_u32 +output : 20210905 ast : to_yyyymmddhhmmss(to_date(18875)) @@ -2495,7 +2495,7 @@ checked expr : to_yyyymmddhhmmss(to_date(to_int64(18875_u optimized expr : 20210905000000_u64 output type : UInt64 output domain : {20210905000000..=20210905000000} -output : 20210905000000_u64 +output : 20210905000000 ast : to_year(to_date(18875)) @@ -2504,7 +2504,7 @@ checked expr : to_year(to_date(to_int64(18875_u16))) optimized expr : 2021_u16 output type : UInt16 output domain : {2021..=2021} -output : 2021_u16 +output : 2021 ast : to_month(to_date(18875)) @@ -2513,7 +2513,7 @@ checked expr : to_month(to_date(to_int64(18875_u16))) optimized expr : 9_u8 output type : UInt8 output domain : {9..=9} -output : 9_u8 +output : 9 ast : to_day_of_year(to_date(18875)) @@ -2522,7 +2522,7 @@ checked expr : to_day_of_year(to_date(to_int64(18875_u16) optimized expr : 248_u16 output type : UInt16 output domain : {248..=248} -output : 248_u16 +output : 248 ast : to_day_of_month(to_date(18875)) @@ -2531,7 +2531,7 @@ checked expr : to_day_of_month(to_date(to_int64(18875_u16 optimized expr : 5_u8 output type : UInt8 output domain : {5..=5} -output : 5_u8 +output : 5 ast : to_day_of_week(to_date(18875)) @@ -2540,7 +2540,7 @@ checked expr : to_day_of_week(to_date(to_int64(18875_u16) optimized expr : 7_u8 output type : UInt8 output domain : {7..=7} -output : 7_u8 +output : 7 ast : to_yyyymm(a) @@ -2552,9 +2552,9 @@ evaluation: +--------+--------------+------------------+ | Type | Date | UInt32 | | Domain | {-100..=100} | {0..=4294967295} | -| Row 0 | 1969-09-23 | 196909_u32 | -| Row 1 | 1970-01-01 | 197001_u32 | -| Row 2 | 1970-04-11 | 197004_u32 | +| Row 0 | 1969-09-23 | 196909 | +| Row 1 | 1970-01-01 | 197001 | +| Row 2 | 1970-04-11 | 197004 | +--------+--------------+------------------+ evaluation (internal): +--------+----------------------------------+ @@ -2574,9 +2574,9 @@ evaluation: +--------+--------------+------------------+ | Type | Date | UInt32 | | Domain | {-100..=100} | {0..=4294967295} | -| Row 0 | 1969-09-23 | 19690923_u32 | -| Row 1 | 1970-01-01 | 19700101_u32 | -| Row 2 | 1970-04-11 | 19700411_u32 | +| Row 0 | 1969-09-23 | 19690923 | +| Row 1 | 1970-01-01 | 19700101 | +| Row 2 | 1970-04-11 | 19700411 | +--------+--------------+------------------+ evaluation (internal): +--------+----------------------------------------+ @@ -2596,9 +2596,9 @@ evaluation: +--------+--------------+----------------------------+ | Type | Date | UInt64 | | Domain | {-100..=100} | {0..=18446744073709551615} | -| Row 0 | 1969-09-23 | 19690923000000_u64 | -| Row 1 | 1970-01-01 | 19700101000000_u64 | -| Row 2 | 1970-04-11 | 19700411000000_u64 | +| Row 0 | 1969-09-23 | 19690923000000 | +| Row 1 | 1970-01-01 | 19700101000000 | +| Row 2 | 1970-04-11 | 19700411000000 | +--------+--------------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------------+ @@ -2618,9 +2618,9 @@ evaluation: +--------+--------------+-------------+ | Type | Date | UInt16 | | Domain | {-100..=100} | {0..=65535} | -| Row 0 | 1969-09-23 | 1969_u16 | -| Row 1 | 1970-01-01 | 1970_u16 | -| Row 2 | 1970-04-11 | 1970_u16 | +| Row 0 | 1969-09-23 | 1969 | +| Row 1 | 1970-01-01 | 1970 | +| Row 2 | 1970-04-11 | 1970 | +--------+--------------+-------------+ evaluation (internal): +--------+----------------------------+ @@ -2640,9 +2640,9 @@ evaluation: +--------+--------------+-----------+ | Type | Date | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-09-23 | 9_u8 | -| Row 1 | 1970-01-01 | 1_u8 | -| Row 2 | 1970-04-11 | 4_u8 | +| Row 0 | 1969-09-23 | 9 | +| Row 1 | 1970-01-01 | 1 | +| Row 2 | 1970-04-11 | 4 | +--------+--------------+-----------+ evaluation (internal): +--------+------------------+ @@ -2662,9 +2662,9 @@ evaluation: +--------+--------------+-------------+ | Type | Date | UInt16 | | Domain | {-100..=100} | {0..=65535} | -| Row 0 | 1969-09-23 | 266_u16 | -| Row 1 | 1970-01-01 | 1_u16 | -| Row 2 | 1970-04-11 | 101_u16 | +| Row 0 | 1969-09-23 | 266 | +| Row 1 | 1970-01-01 | 1 | +| Row 2 | 1970-04-11 | 101 | +--------+--------------+-------------+ evaluation (internal): +--------+-----------------------+ @@ -2684,9 +2684,9 @@ evaluation: +--------+--------------+-----------+ | Type | Date | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-09-23 | 23_u8 | -| Row 1 | 1970-01-01 | 1_u8 | -| Row 2 | 1970-04-11 | 11_u8 | +| Row 0 | 1969-09-23 | 23 | +| Row 1 | 1970-01-01 | 1 | +| Row 2 | 1970-04-11 | 11 | +--------+--------------+-----------+ evaluation (internal): +--------+--------------------+ @@ -2706,9 +2706,9 @@ evaluation: +--------+--------------+-----------+ | Type | Date | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-09-23 | 2_u8 | -| Row 1 | 1970-01-01 | 4_u8 | -| Row 2 | 1970-04-11 | 6_u8 | +| Row 0 | 1969-09-23 | 2 | +| Row 1 | 1970-01-01 | 4 | +| Row 2 | 1970-04-11 | 6 | +--------+--------------+-----------+ evaluation (internal): +--------+------------------+ @@ -2725,7 +2725,7 @@ checked expr : to_yyyymm(to_timestamp(to_int64(16308 optimized expr : 202109_u32 output type : UInt32 output domain : {202109..=202109} -output : 202109_u32 +output : 202109 ast : to_yyyymmdd(to_timestamp(1630812366)) @@ -2734,7 +2734,7 @@ checked expr : to_yyyymmdd(to_timestamp(to_int64(163 optimized expr : 20210905_u32 output type : UInt32 output domain : {20210905..=20210905} -output : 20210905_u32 +output : 20210905 ast : to_yyyymmddhhmmss(to_timestamp(1630812366)) @@ -2743,7 +2743,7 @@ checked expr : to_yyyymmddhhmmss(to_timestamp(to_int64(to_timestamp(to_int64(1630812 optimized expr : 2021_u16 output type : UInt16 output domain : {2021..=2021} -output : 2021_u16 +output : 2021 ast : to_month(to_timestamp(1630812366)) @@ -2761,7 +2761,7 @@ checked expr : to_month(to_timestamp(to_int64(163081 optimized expr : 9_u8 output type : UInt8 output domain : {9..=9} -output : 9_u8 +output : 9 ast : to_day_of_year(to_timestamp(1630812366)) @@ -2770,7 +2770,7 @@ checked expr : to_day_of_year(to_timestamp(to_int64( optimized expr : 248_u16 output type : UInt16 output domain : {248..=248} -output : 248_u16 +output : 248 ast : to_day_of_month(to_timestamp(1630812366)) @@ -2779,7 +2779,7 @@ checked expr : to_day_of_month(to_timestamp(to_int64 optimized expr : 5_u8 output type : UInt8 output domain : {5..=5} -output : 5_u8 +output : 5 ast : to_day_of_week(to_timestamp(1630812366)) @@ -2788,7 +2788,7 @@ checked expr : to_day_of_week(to_timestamp(to_int64( optimized expr : 7_u8 output type : UInt8 output domain : {7..=7} -output : 7_u8 +output : 7 ast : to_hour(to_timestamp(1630812366)) @@ -2797,7 +2797,7 @@ checked expr : to_hour(to_timestamp(to_int64(1630812 optimized expr : 3_u8 output type : UInt8 output domain : {3..=3} -output : 3_u8 +output : 3 ast : to_minute(to_timestamp(1630812366)) @@ -2806,7 +2806,7 @@ checked expr : to_minute(to_timestamp(to_int64(16308 optimized expr : 26_u8 output type : UInt8 output domain : {26..=26} -output : 26_u8 +output : 26 ast : to_second(to_timestamp(1630812366)) @@ -2815,7 +2815,7 @@ checked expr : to_second(to_timestamp(to_int64(16308 optimized expr : 6_u8 output type : UInt8 output domain : {6..=6} -output : 6_u8 +output : 6 ast : to_yyyymm(a) @@ -2827,9 +2827,9 @@ evaluation: +--------+----------------------------+------------------+ | Type | Timestamp | UInt32 | | Domain | {-100..=100} | {0..=4294967295} | -| Row 0 | 1969-12-31 23:59:59.999900 | 196912_u32 | -| Row 1 | 1970-01-01 00:00:00.000000 | 197001_u32 | -| Row 2 | 1970-01-01 00:00:00.000100 | 197001_u32 | +| Row 0 | 1969-12-31 23:59:59.999900 | 196912 | +| Row 1 | 1970-01-01 00:00:00.000000 | 197001 | +| Row 2 | 1970-01-01 00:00:00.000100 | 197001 | +--------+----------------------------+------------------+ evaluation (internal): +--------+----------------------------------+ @@ -2849,9 +2849,9 @@ evaluation: +--------+----------------------------+------------------+ | Type | Timestamp | UInt32 | | Domain | {-100..=100} | {0..=4294967295} | -| Row 0 | 1969-12-31 23:59:59.999900 | 19691231_u32 | -| Row 1 | 1970-01-01 00:00:00.000000 | 19700101_u32 | -| Row 2 | 1970-01-01 00:00:00.000100 | 19700101_u32 | +| Row 0 | 1969-12-31 23:59:59.999900 | 19691231 | +| Row 1 | 1970-01-01 00:00:00.000000 | 19700101 | +| Row 2 | 1970-01-01 00:00:00.000100 | 19700101 | +--------+----------------------------+------------------+ evaluation (internal): +--------+----------------------------------------+ @@ -2871,9 +2871,9 @@ evaluation: +--------+----------------------------+----------------------------+ | Type | Timestamp | UInt64 | | Domain | {-100..=100} | {0..=18446744073709551615} | -| Row 0 | 1969-12-31 23:59:59.999900 | 19691231235959_u64 | -| Row 1 | 1970-01-01 00:00:00.000000 | 19700101000000_u64 | -| Row 2 | 1970-01-01 00:00:00.000100 | 19700101000000_u64 | +| Row 0 | 1969-12-31 23:59:59.999900 | 19691231235959 | +| Row 1 | 1970-01-01 00:00:00.000000 | 19700101000000 | +| Row 2 | 1970-01-01 00:00:00.000100 | 19700101000000 | +--------+----------------------------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------------+ @@ -2893,9 +2893,9 @@ evaluation: +--------+----------------------------+-------------+ | Type | Timestamp | UInt16 | | Domain | {-100..=100} | {0..=65535} | -| Row 0 | 1969-12-31 23:59:59.999900 | 1969_u16 | -| Row 1 | 1970-01-01 00:00:00.000000 | 1970_u16 | -| Row 2 | 1970-01-01 00:00:00.000100 | 1970_u16 | +| Row 0 | 1969-12-31 23:59:59.999900 | 1969 | +| Row 1 | 1970-01-01 00:00:00.000000 | 1970 | +| Row 2 | 1970-01-01 00:00:00.000100 | 1970 | +--------+----------------------------+-------------+ evaluation (internal): +--------+----------------------------+ @@ -2915,9 +2915,9 @@ evaluation: +--------+----------------------------+-----------+ | Type | Timestamp | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-12-31 23:59:59.999900 | 12_u8 | -| Row 1 | 1970-01-01 00:00:00.000000 | 1_u8 | -| Row 2 | 1970-01-01 00:00:00.000100 | 1_u8 | +| Row 0 | 1969-12-31 23:59:59.999900 | 12 | +| Row 1 | 1970-01-01 00:00:00.000000 | 1 | +| Row 2 | 1970-01-01 00:00:00.000100 | 1 | +--------+----------------------------+-----------+ evaluation (internal): +--------+-------------------+ @@ -2937,9 +2937,9 @@ evaluation: +--------+----------------------------+-------------+ | Type | Timestamp | UInt16 | | Domain | {-100..=100} | {0..=65535} | -| Row 0 | 1969-12-31 23:59:59.999900 | 365_u16 | -| Row 1 | 1970-01-01 00:00:00.000000 | 1_u16 | -| Row 2 | 1970-01-01 00:00:00.000100 | 1_u16 | +| Row 0 | 1969-12-31 23:59:59.999900 | 365 | +| Row 1 | 1970-01-01 00:00:00.000000 | 1 | +| Row 2 | 1970-01-01 00:00:00.000100 | 1 | +--------+----------------------------+-------------+ evaluation (internal): +--------+---------------------+ @@ -2959,9 +2959,9 @@ evaluation: +--------+----------------------------+-----------+ | Type | Timestamp | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-12-31 23:59:59.999900 | 31_u8 | -| Row 1 | 1970-01-01 00:00:00.000000 | 1_u8 | -| Row 2 | 1970-01-01 00:00:00.000100 | 1_u8 | +| Row 0 | 1969-12-31 23:59:59.999900 | 31 | +| Row 1 | 1970-01-01 00:00:00.000000 | 1 | +| Row 2 | 1970-01-01 00:00:00.000100 | 1 | +--------+----------------------------+-----------+ evaluation (internal): +--------+-------------------+ @@ -2981,9 +2981,9 @@ evaluation: +--------+----------------------------+-----------+ | Type | Timestamp | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-12-31 23:59:59.999900 | 3_u8 | -| Row 1 | 1970-01-01 00:00:00.000000 | 4_u8 | -| Row 2 | 1970-01-01 00:00:00.000100 | 4_u8 | +| Row 0 | 1969-12-31 23:59:59.999900 | 3 | +| Row 1 | 1970-01-01 00:00:00.000000 | 4 | +| Row 2 | 1970-01-01 00:00:00.000100 | 4 | +--------+----------------------------+-----------+ evaluation (internal): +--------+------------------+ @@ -3003,9 +3003,9 @@ evaluation: +--------+----------------------------+-----------+ | Type | Timestamp | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-12-31 23:59:59.999900 | 23_u8 | -| Row 1 | 1970-01-01 00:00:00.000000 | 0_u8 | -| Row 2 | 1970-01-01 00:00:00.000100 | 0_u8 | +| Row 0 | 1969-12-31 23:59:59.999900 | 23 | +| Row 1 | 1970-01-01 00:00:00.000000 | 0 | +| Row 2 | 1970-01-01 00:00:00.000100 | 0 | +--------+----------------------------+-----------+ evaluation (internal): +--------+-------------------+ @@ -3025,9 +3025,9 @@ evaluation: +--------+----------------------------+-----------+ | Type | Timestamp | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-12-31 23:59:59.999900 | 59_u8 | -| Row 1 | 1970-01-01 00:00:00.000000 | 0_u8 | -| Row 2 | 1970-01-01 00:00:00.000100 | 0_u8 | +| Row 0 | 1969-12-31 23:59:59.999900 | 59 | +| Row 1 | 1970-01-01 00:00:00.000000 | 0 | +| Row 2 | 1970-01-01 00:00:00.000100 | 0 | +--------+----------------------------+-----------+ evaluation (internal): +--------+-------------------+ @@ -3047,9 +3047,9 @@ evaluation: +--------+----------------------------+-----------+ | Type | Timestamp | UInt8 | | Domain | {-100..=100} | {0..=255} | -| Row 0 | 1969-12-31 23:59:59.999900 | 59_u8 | -| Row 1 | 1970-01-01 00:00:00.000000 | 0_u8 | -| Row 2 | 1970-01-01 00:00:00.000100 | 0_u8 | +| Row 0 | 1969-12-31 23:59:59.999900 | 59 | +| Row 1 | 1970-01-01 00:00:00.000000 | 0 | +| Row 2 | 1970-01-01 00:00:00.000100 | 0 | +--------+----------------------------+-----------+ evaluation (internal): +--------+-------------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/function_list.txt b/src/query/functions/tests/it/scalars/testdata/function_list.txt index dc5d05a60d48d..87c5d0b240cd6 100644 --- a/src/query/functions/tests/it/scalars/testdata/function_list.txt +++ b/src/query/functions/tests/it/scalars/testdata/function_list.txt @@ -115,28 +115,6 @@ char_length(String) :: UInt64 char_length(String NULL) :: UInt64 NULL check_json(String) :: String NULL check_json(String NULL) :: String NULL -check_json(Boolean) :: String NULL -check_json(Boolean NULL) :: String NULL -check_json(UInt8) :: String NULL -check_json(UInt8 NULL) :: String NULL -check_json(UInt16) :: String NULL -check_json(UInt16 NULL) :: String NULL -check_json(UInt32) :: String NULL -check_json(UInt32 NULL) :: String NULL -check_json(UInt64) :: String NULL -check_json(UInt64 NULL) :: String NULL -check_json(Int8) :: String NULL -check_json(Int8 NULL) :: String NULL -check_json(Int16) :: String NULL -check_json(Int16 NULL) :: String NULL -check_json(Int32) :: String NULL -check_json(Int32 NULL) :: String NULL -check_json(Int64) :: String NULL -check_json(Int64 NULL) :: String NULL -check_json(Float32) :: String NULL -check_json(Float32 NULL) :: String NULL -check_json(Float64) :: String NULL -check_json(Float64 NULL) :: String NULL city64withseed(String, UInt8) :: UInt64 city64withseed(String NULL, UInt8 NULL) :: UInt64 NULL city64withseed(String, UInt16) :: UInt64 @@ -1909,28 +1887,6 @@ ord(String) :: UInt64 ord(String NULL) :: UInt64 NULL parse_json(String) :: Variant parse_json(String NULL) :: Variant NULL -parse_json(Boolean) :: Variant -parse_json(Boolean NULL) :: Variant NULL -parse_json(UInt8) :: Variant -parse_json(UInt8 NULL) :: Variant NULL -parse_json(UInt16) :: Variant -parse_json(UInt16 NULL) :: Variant NULL -parse_json(UInt32) :: Variant -parse_json(UInt32 NULL) :: Variant NULL -parse_json(UInt64) :: Variant -parse_json(UInt64 NULL) :: Variant NULL -parse_json(Int8) :: Variant -parse_json(Int8 NULL) :: Variant NULL -parse_json(Int16) :: Variant -parse_json(Int16 NULL) :: Variant NULL -parse_json(Int32) :: Variant -parse_json(Int32 NULL) :: Variant NULL -parse_json(Int64) :: Variant -parse_json(Int64 NULL) :: Variant NULL -parse_json(Float32) :: Variant -parse_json(Float32 NULL) :: Variant NULL -parse_json(Float64) :: Variant -parse_json(Float64 NULL) :: Variant NULL pi() :: Float64 plus(UInt8, UInt8) :: UInt16 plus(UInt8 NULL, UInt8 NULL) :: UInt16 NULL @@ -2788,28 +2744,6 @@ try_inet_ntoa(Int64) :: String NULL try_inet_ntoa(Int64 NULL) :: String NULL try_parse_json(String) :: Variant NULL try_parse_json(String NULL) :: Variant NULL -try_parse_json(Boolean) :: Variant NULL -try_parse_json(Boolean NULL) :: Variant NULL -try_parse_json(UInt8) :: Variant NULL -try_parse_json(UInt8 NULL) :: Variant NULL -try_parse_json(UInt16) :: Variant NULL -try_parse_json(UInt16 NULL) :: Variant NULL -try_parse_json(UInt32) :: Variant NULL -try_parse_json(UInt32 NULL) :: Variant NULL -try_parse_json(UInt64) :: Variant NULL -try_parse_json(UInt64 NULL) :: Variant NULL -try_parse_json(Int8) :: Variant NULL -try_parse_json(Int8 NULL) :: Variant NULL -try_parse_json(Int16) :: Variant NULL -try_parse_json(Int16 NULL) :: Variant NULL -try_parse_json(Int32) :: Variant NULL -try_parse_json(Int32 NULL) :: Variant NULL -try_parse_json(Int64) :: Variant NULL -try_parse_json(Int64 NULL) :: Variant NULL -try_parse_json(Float32) :: Variant NULL -try_parse_json(Float32 NULL) :: Variant NULL -try_parse_json(Float64) :: Variant NULL -try_parse_json(Float64 NULL) :: Variant NULL try_to_boolean(UInt8) :: Boolean NULL try_to_boolean(UInt8 NULL) :: Boolean NULL try_to_boolean(UInt16) :: Boolean NULL diff --git a/src/query/functions/tests/it/scalars/testdata/geo.txt b/src/query/functions/tests/it/scalars/testdata/geo.txt index 82ad2ef87f99e..3e94b1ce1b266 100644 --- a/src/query/functions/tests/it/scalars/testdata/geo.txt +++ b/src/query/functions/tests/it/scalars/testdata/geo.txt @@ -4,7 +4,7 @@ checked expr : geo_to_h3(37.79506683_f64, 55.71290588 optimized expr : 644325524701193974_u64 output type : UInt64 output domain : {644325524701193974..=644325524701193974} -output : 644325524701193974_u64 +output : 644325524701193974 ast : geo_to_h3(lon, lat, 15) @@ -16,9 +16,9 @@ evaluation: +--------+-------------------------+---------------------------+----------------------------+ | Type | Float64 | Float64 | UInt64 | | Domain | {37.598135..=37.660183} | {55.720762..=55.77922738} | {0..=18446744073709551615} | -| Row 0 | 37.63098076_f64 | 55.77922738_f64 | 644325529094369568_u64 | -| Row 1 | 37.660183_f64 | 55.763241_f64 | 644325528627451570_u64 | -| Row 2 | 37.598135_f64 | 55.720762_f64 | 644325528491955313_u64 | +| Row 0 | 37.63098076 | 55.77922738 | 644325529094369568 | +| Row 1 | 37.660183 | 55.763241 | 644325528627451570 | +| Row 2 | 37.598135 | 55.720762 | 644325528491955313 | +--------+-------------------------+---------------------------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------------------------+ @@ -36,7 +36,7 @@ checked expr : great_circle_distance(55.75 optimized expr : 14128353_f32 output type : Float32 output domain : {14128353..=14128353} -output : 14128353_f32 +output : 14128353 ast : great_circle_distance(lon1, lat1, lon2, lat2) @@ -48,9 +48,9 @@ evaluation: +--------+-------------------------+-------------------------+---------------------------+---------------------------+--------------+ | Type | Float64 | Float64 | Float64 | Float64 | Float32 | | Domain | {55.755831..=57.755831} | {37.617673..=39.617673} | {-57.755831..=-55.755831} | {-39.617673..=-37.617673} | {-inf..=NaN} | -| Row 0 | 55.755831_f64 | 37.617673_f64 | -55.755831_f64 | -37.617673_f64 | 14128353_f32 | -| Row 1 | 56.755831_f64 | 38.617673_f64 | -56.755831_f64 | -38.617673_f64 | 14374804_f32 | -| Row 2 | 57.755831_f64 | 39.617673_f64 | -57.755831_f64 | -39.617673_f64 | 14618267_f32 | +| Row 0 | 55.755831 | 37.617673 | -55.755831 | -37.617673 | 14128353 | +| Row 1 | 56.755831 | 38.617673 | -56.755831 | -38.617673 | 14374804 | +| Row 2 | 57.755831 | 39.617673 | -57.755831 | -39.617673 | 14618267 | +--------+-------------------------+-------------------------+---------------------------+---------------------------+--------------+ evaluation (internal): +--------+-----------------------------------------------+ @@ -70,7 +70,7 @@ checked expr : geo_distance(55.755831_f64, optimized expr : 14128353_f32 output type : Float32 output domain : {14128353..=14128353} -output : 14128353_f32 +output : 14128353 ast : geo_distance(lon1, lat1, lon2, lat2) @@ -82,9 +82,9 @@ evaluation: +--------+-------------------------+-------------------------+---------------------------+---------------------------+--------------+ | Type | Float64 | Float64 | Float64 | Float64 | Float32 | | Domain | {55.755831..=57.755831} | {37.617673..=39.617673} | {-57.755831..=-55.755831} | {-39.617673..=-37.617673} | {-inf..=NaN} | -| Row 0 | 55.755831_f64 | 37.617673_f64 | -55.755831_f64 | -37.617673_f64 | 14128353_f32 | -| Row 1 | 56.755831_f64 | 38.617673_f64 | -56.755831_f64 | -38.617673_f64 | 14374804_f32 | -| Row 2 | 57.755831_f64 | 39.617673_f64 | -57.755831_f64 | -39.617673_f64 | 14618267_f32 | +| Row 0 | 55.755831 | 37.617673 | -55.755831 | -37.617673 | 14128353 | +| Row 1 | 56.755831 | 38.617673 | -56.755831 | -38.617673 | 14374804 | +| Row 2 | 57.755831 | 39.617673 | -57.755831 | -39.617673 | 14618267 | +--------+-------------------------+-------------------------+---------------------------+---------------------------+--------------+ evaluation (internal): +--------+-----------------------------------------------+ @@ -104,7 +104,7 @@ checked expr : great_circle_angle(to_float optimized expr : 44.99998_f32 output type : Float32 output domain : {44.99998..=44.99998} -output : 44.99998_f32 +output : 44.99998 ast : great_circle_angle(0, 0, a, 0) @@ -117,9 +117,9 @@ evaluation: +--------+-----------+--------------+ | Type | Float64 | Float32 | | Domain | {45..=47} | {-inf..=NaN} | -| Row 0 | 45_f64 | 44.99998_f32 | -| Row 1 | 46_f64 | 45.99966_f32 | -| Row 2 | 47_f64 | 46.99969_f32 | +| Row 0 | 45 | 44.99998 | +| Row 1 | 46 | 45.99966 | +| Row 2 | 47 | 46.99969 | +--------+-----------+--------------+ evaluation (internal): +--------+-----------------------------------------+ @@ -136,7 +136,7 @@ checked expr : point_in_ellipses(tuple(a, b), CAST(array(tuple(6_u8, 0_u8), tuple(8_u8, 4_u8), tuple(5_u8, 8_u8), tuple(0_u8, 2_u8)) AS Array(Tuple(Float64, Float64)))) -optimized expr : point_in_polygon(tuple(a, b), [(6_f64, 0_f64), (8_f64, 4_f64), (5_f64, 8_f64), (0_f64, 2_f64)]) +optimized expr : point_in_polygon(tuple(a, b), [(6, 0), (8, 4), (5, 8), (0, 2)]) evaluation: +--------+-----------+-----------+-----------+ | | a | b | Output | +--------+-----------+-----------+-----------+ | Type | Float64 | Float64 | UInt8 | | Domain | {3..=3.2} | {3..=3.2} | {0..=255} | -| Row 0 | 3_f64 | 3_f64 | 1_u8 | -| Row 1 | 3.1_f64 | 3.1_f64 | 1_u8 | -| Row 2 | 3.2_f64 | 3.2_f64 | 1_u8 | +| Row 0 | 3 | 3 | 1 | +| Row 1 | 3.1 | 3.1 | 1 | +| Row 2 | 3.2 | 3.2 | 1 | +--------+-----------+-----------+-----------+ evaluation (internal): +--------+------------------------+ @@ -201,7 +201,7 @@ checked expr : point_in_polygon(tuple(2.5_f64, 2.5_f64), array(array(tuple(4_f64, 0_f64), tuple(8_f64, 4_f64), tuple(4_f64, 8_f64), tuple(0_f64, 4_f64)), array(tuple(3_f64, 3_f64), tuple(a, b), tuple(5_f64, 5_f64), tuple(5_f64, 3_f64)))) -optimized expr : point_in_polygon((2.5_f64, 2.5_f64), array([(4_f64, 0_f64), (8_f64, 4_f64), (4_f64, 8_f64), (0_f64, 4_f64)], array((3_f64, 3_f64), tuple(a, 5_f64), (5_f64, 5_f64), (5_f64, 3_f64)))) +optimized expr : point_in_polygon((2.5_f64, 2.5_f64), array([(4, 0), (8, 4), (4, 8), (0, 4)], array((3_f64, 3_f64), tuple(a, 5_f64), (5_f64, 5_f64), (5_f64, 3_f64)))) evaluation: +--------+-----------+---------+-----------+ | | a | b | Output | +--------+-----------+---------+-----------+ | Type | Float64 | Float64 | UInt8 | | Domain | {3..=3.1} | {5..=5} | {0..=255} | -| Row 0 | 3_f64 | 5_f64 | 1_u8 | -| Row 1 | 3.1_f64 | 5_f64 | 1_u8 | +| Row 0 | 3 | 5 | 1 | +| Row 1 | 3.1 | 5 | 1 | +--------+-----------+---------+-----------+ evaluation (internal): +--------+-------------------+ @@ -242,7 +242,7 @@ checked expr : point_in_polygon("ezs42") optimized expr : (-5.6030273437_f64, 42.6049804687_f64) output type : Tuple(Float64, Float64) output domain : ({-5.6030273437..=-5.6030273437}, {42.6049804687..=42.6049804687}) -output : (-5.6030273437_f64, 42.6049804687_f64) +output : (-5.6030273437, 42.6049804687) diff --git a/src/query/functions/tests/it/scalars/testdata/hash.txt b/src/query/functions/tests/it/scalars/testdata/hash.txt index 42716530fd59c..a1b1f593220a4 100644 --- a/src/query/functions/tests/it/scalars/testdata/hash.txt +++ b/src/query/functions/tests/it/scalars/testdata/hash.txt @@ -154,9 +154,9 @@ evaluation: +--------+-------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------+ | Type | String | UInt16 | String | | Domain | {"Abc"..="ß😀山"} | {224..=512} | Unknown | -| Row 0 | "Abc" | 224_u16 | "11d86770f501294c6b395942a39f60fe286a15e06282abcb2294cfa0" | -| Row 1 | "Dobrý den" | 384_u16 | "1a5c66c918718c627e360e56833d2f6c638fd1a67086792606cfefe50089289ca34b52a72a833e6f2661b64417068846" | -| Row 2 | "ß😀山" | 512_u16 | "3bd4ca36a66c0675e695f3fc44af703cd6c110085adf105138ef56e6768a639f16a9c27b651a0c64f685b24be835e0a62485575477e06d530574865bf1670d30" | +| Row 0 | "Abc" | 224 | "11d86770f501294c6b395942a39f60fe286a15e06282abcb2294cfa0" | +| Row 1 | "Dobrý den" | 384 | "1a5c66c918718c627e360e56833d2f6c638fd1a67086792606cfefe50089289ca34b52a72a833e6f2661b64417068846" | +| Row 2 | "ß😀山" | 512 | "3bd4ca36a66c0675e695f3fc44af703cd6c110085adf105138ef56e6768a639f16a9c27b651a0c64f685b24be835e0a62485575477e06d530574865bf1670d30" | +--------+-------------------+-------------+------------------------------------------------------------------------------------------------------------------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -174,7 +174,7 @@ checked expr : city64withseed("Abc", 0_u8) optimized expr : 8309941215813243361_u64 output type : UInt64 output domain : {8309941215813243361..=8309941215813243361} -output : 8309941215813243361_u64 +output : 8309941215813243361 ast : city64withseed('Abc',256) @@ -183,7 +183,7 @@ checked expr : city64withseed("Abc", 256_u16) optimized expr : 10246934130793054423_u64 output type : UInt64 output domain : {10246934130793054423..=10246934130793054423} -output : 10246934130793054423_u64 +output : 10246934130793054423 ast : city64withseed('Abc',256.3) @@ -192,7 +192,7 @@ checked expr : city64withseed("Abc", 256.3_f64) optimized expr : 10246934130793054423_u64 output type : UInt64 output domain : {10246934130793054423..=10246934130793054423} -output : 10246934130793054423_u64 +output : 10246934130793054423 ast : city64withseed(to_datetime(100000), 1234) @@ -201,7 +201,7 @@ checked expr : city64withseed(to_timestamp(to_int64< optimized expr : 4538088127563444061_u64 output type : UInt64 output domain : {4538088127563444061..=4538088127563444061} -output : 4538088127563444061_u64 +output : 4538088127563444061 ast : city64withseed(1234567890, 12) @@ -210,7 +210,7 @@ checked expr : city64withseed(1234567890_u32, 12_u8) optimized expr : 2939704650099116301_u64 output type : UInt64 output domain : {2939704650099116301..=2939704650099116301} -output : 2939704650099116301_u64 +output : 2939704650099116301 ast : city64withseed(1.1, 12) @@ -219,7 +219,7 @@ checked expr : city64withseed(1.1_f64, 12_u8) optimized expr : 10046394896202388363_u64 output type : UInt64 output domain : {10046394896202388363..=10046394896202388363} -output : 10046394896202388363_u64 +output : 10046394896202388363 ast : city64withseed('1234567890', 12.12) @@ -228,7 +228,7 @@ checked expr : city64withseed("1234567890", 12.12_f64) optimized expr : 10660895976650300430_u64 output type : UInt64 output domain : {10660895976650300430..=10660895976650300430} -output : 10660895976650300430_u64 +output : 10660895976650300430 ast : city64withseed(1234567890, 12.12) @@ -237,7 +237,7 @@ checked expr : city64withseed(1234567890_u32, 12.12_f64) optimized expr : 2939704650099116301_u64 output type : UInt64 output domain : {2939704650099116301..=2939704650099116301} -output : 2939704650099116301_u64 +output : 2939704650099116301 ast : city64withseed(to_date(100000), 1234) @@ -246,7 +246,7 @@ checked expr : city64withseed(to_date(to_int64(10 optimized expr : 8535774936754559738_u64 output type : UInt64 output domain : {8535774936754559738..=8535774936754559738} -output : 8535774936754559738_u64 +output : 8535774936754559738 ast : city64withseed(NULL,0) @@ -267,9 +267,9 @@ evaluation: +--------+-------------------+-----------+----------------------------+ | Type | String | UInt16 | UInt64 | | Domain | {"Abc"..="ß😀山"} | {10..=12} | {0..=18446744073709551615} | -| Row 0 | "Abc" | 10_u16 | 10385767944629066306_u64 | -| Row 1 | "Dobrý den" | 11_u16 | 12123249488783690377_u64 | -| Row 2 | "ß😀山" | 12_u16 | 14631005279260459058_u64 | +| Row 0 | "Abc" | 10 | 10385767944629066306 | +| Row 1 | "Dobrý den" | 11 | 12123249488783690377 | +| Row 2 | "ß😀山" | 12 | 14631005279260459058 | +--------+-------------------+-----------+----------------------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------+ @@ -287,7 +287,7 @@ checked expr : siphash64("Abc") optimized expr : 17684958587550623602_u64 output type : UInt64 output domain : {17684958587550623602..=17684958587550623602} -output : 17684958587550623602_u64 +output : 17684958587550623602 ast : siphash64(to_datetime(100000)) @@ -296,7 +296,7 @@ checked expr : siphash64(to_timestamp(to_int64(10000 optimized expr : 6710305768027137259_u64 output type : UInt64 output domain : {6710305768027137259..=6710305768027137259} -output : 6710305768027137259_u64 +output : 6710305768027137259 ast : siphash64(1234567890) @@ -305,7 +305,7 @@ checked expr : siphash64(1234567890_u32) optimized expr : 12447382539015599056_u64 output type : UInt64 output domain : {12447382539015599056..=12447382539015599056} -output : 12447382539015599056_u64 +output : 12447382539015599056 ast : siphash64(1.1) @@ -314,7 +314,7 @@ checked expr : siphash64(1.1_f64) optimized expr : 14856193058643670405_u64 output type : UInt64 output domain : {14856193058643670405..=14856193058643670405} -output : 14856193058643670405_u64 +output : 14856193058643670405 ast : siphash64(to_date(100000)) @@ -323,7 +323,7 @@ checked expr : siphash64(to_date(to_int64(100000_u32))) optimized expr : 17230848539826186862_u64 output type : UInt64 output domain : {17230848539826186862..=17230848539826186862} -output : 17230848539826186862_u64 +output : 17230848539826186862 ast : siphash64(NULL) @@ -341,7 +341,7 @@ checked expr : siphash64(parse_json("{\"a\":1}")) optimized expr : 10266916306474055689_u64 output type : UInt64 output domain : {10266916306474055689..=10266916306474055689} -output : 10266916306474055689_u64 +output : 10266916306474055689 ast : siphash(true) @@ -350,7 +350,7 @@ checked expr : siphash64(true) optimized expr : 4952851536318644461_u64 output type : UInt64 output domain : {4952851536318644461..=4952851536318644461} -output : 4952851536318644461_u64 +output : 4952851536318644461 ast : siphash64(a) @@ -362,8 +362,8 @@ evaluation: +--------+-------------------------+----------------------------+ | Type | String | UInt64 | | Domain | {"Dobrý den"..="ß😀山"} | {0..=18446744073709551615} | -| Row 0 | "Dobrý den" | 5782510256878119795_u64 | -| Row 1 | "ß😀山" | 1354619631122873228_u64 | +| Row 0 | "Dobrý den" | 5782510256878119795 | +| Row 1 | "ß😀山" | 1354619631122873228 | +--------+-------------------------+----------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------+ @@ -380,7 +380,7 @@ checked expr : xxhash64("Abc") optimized expr : 11989503812394966078_u64 output type : UInt64 output domain : {11989503812394966078..=11989503812394966078} -output : 11989503812394966078_u64 +output : 11989503812394966078 ast : xxhash64(to_datetime(100000)) @@ -389,7 +389,7 @@ checked expr : xxhash64(to_timestamp(to_int64(100000 optimized expr : 14455582462593060490_u64 output type : UInt64 output domain : {14455582462593060490..=14455582462593060490} -output : 14455582462593060490_u64 +output : 14455582462593060490 ast : xxhash64(1234567890) @@ -398,7 +398,7 @@ checked expr : xxhash64(1234567890_u32) optimized expr : 14922725725041217620_u64 output type : UInt64 output domain : {14922725725041217620..=14922725725041217620} -output : 14922725725041217620_u64 +output : 14922725725041217620 ast : xxhash64(1.1) @@ -407,7 +407,7 @@ checked expr : xxhash64(1.1_f64) optimized expr : 18307966283998289030_u64 output type : UInt64 output domain : {18307966283998289030..=18307966283998289030} -output : 18307966283998289030_u64 +output : 18307966283998289030 ast : xxhash64(to_date(100000)) @@ -416,7 +416,7 @@ checked expr : xxhash64(to_date(to_int64(100000_u32))) optimized expr : 8691527656253933431_u64 output type : UInt64 output domain : {8691527656253933431..=8691527656253933431} -output : 8691527656253933431_u64 +output : 8691527656253933431 ast : xxhash64(NULL) @@ -434,7 +434,7 @@ checked expr : xxhash64(parse_json("{\"a\":1}")) optimized expr : 13558435650847720346_u64 output type : UInt64 output domain : {13558435650847720346..=13558435650847720346} -output : 13558435650847720346_u64 +output : 13558435650847720346 ast : xxhash64(true) @@ -443,7 +443,7 @@ checked expr : xxhash64(true) optimized expr : 9962287286179718960_u64 output type : UInt64 output domain : {9962287286179718960..=9962287286179718960} -output : 9962287286179718960_u64 +output : 9962287286179718960 ast : xxhash64(a) @@ -455,8 +455,8 @@ evaluation: +--------+-------------------------+----------------------------+ | Type | String | UInt64 | | Domain | {"Dobrý den"..="ß😀山"} | {0..=18446744073709551615} | -| Row 0 | "Dobrý den" | 314761032262035578_u64 | -| Row 1 | "ß😀山" | 656695431091154575_u64 | +| Row 0 | "Dobrý den" | 314761032262035578 | +| Row 1 | "ß😀山" | 656695431091154575 | +--------+-------------------------+----------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------+ @@ -473,7 +473,7 @@ checked expr : xxhash32("Abc") optimized expr : 3980406955_u32 output type : UInt32 output domain : {3980406955..=3980406955} -output : 3980406955_u32 +output : 3980406955 ast : xxhash32(to_datetime(100000)) @@ -482,7 +482,7 @@ checked expr : xxhash32(to_timestamp(to_int64(100000 optimized expr : 680734338_u32 output type : UInt32 output domain : {680734338..=680734338} -output : 680734338_u32 +output : 680734338 ast : xxhash32(1234567890) @@ -491,7 +491,7 @@ checked expr : xxhash32(1234567890_u32) optimized expr : 2833116583_u32 output type : UInt32 output domain : {2833116583..=2833116583} -output : 2833116583_u32 +output : 2833116583 ast : xxhash32(1.1) @@ -500,7 +500,7 @@ checked expr : xxhash32(1.1_f64) optimized expr : 3252916525_u32 output type : UInt32 output domain : {3252916525..=3252916525} -output : 3252916525_u32 +output : 3252916525 ast : xxhash32(to_date(100000)) @@ -509,7 +509,7 @@ checked expr : xxhash32(to_date(to_int64(100000_u32))) optimized expr : 2518126785_u32 output type : UInt32 output domain : {2518126785..=2518126785} -output : 2518126785_u32 +output : 2518126785 ast : xxhash32(NULL) @@ -527,7 +527,7 @@ checked expr : xxhash32(parse_json("{\"a\":1}")) optimized expr : 3886246173_u32 output type : UInt32 output domain : {3886246173..=3886246173} -output : 3886246173_u32 +output : 3886246173 ast : xxhash32(true) @@ -536,7 +536,7 @@ checked expr : xxhash32(true) optimized expr : 949155633_u32 output type : UInt32 output domain : {949155633..=949155633} -output : 949155633_u32 +output : 949155633 ast : xxhash32(a) @@ -548,8 +548,8 @@ evaluation: +--------+-------------------------+------------------+ | Type | String | UInt32 | | Domain | {"Dobrý den"..="ß😀山"} | {0..=4294967295} | -| Row 0 | "Dobrý den" | 19285785_u32 | -| Row 1 | "ß😀山" | 1401072642_u32 | +| Row 0 | "Dobrý den" | 19285785 | +| Row 1 | "ß😀山" | 1401072642 | +--------+-------------------------+------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/math.txt b/src/query/functions/tests/it/scalars/testdata/math.txt index 6a06ee643f882..21063cc6d1249 100644 --- a/src/query/functions/tests/it/scalars/testdata/math.txt +++ b/src/query/functions/tests/it/scalars/testdata/math.txt @@ -4,7 +4,7 @@ checked expr : abs(to_uint64(1_u8)) optimized expr : 1_u64 output type : UInt64 output domain : {1..=1} -output : 1_u64 +output : 1 ast : abs(-1) @@ -13,7 +13,7 @@ checked expr : abs(to_int64(minus(1_u8))) optimized expr : 1_u64 output type : UInt64 output domain : {1..=1} -output : 1_u64 +output : 1 ast : abs(null) @@ -34,9 +34,9 @@ evaluation: +--------+--------------+------------+ | Type | Int64 | UInt64 | | Domain | {-30..=1024} | {0..=1024} | -| Row 0 | 1_i64 | 1_u64 | -| Row 1 | -30_i64 | 30_u64 | -| Row 2 | 1024_i64 | 1024_u64 | +| Row 0 | 1 | 1 | +| Row 1 | -30 | 30 | +| Row 2 | 1024 | 1024 | +--------+--------------+------------+ evaluation (internal): +--------+-----------------------+ @@ -53,7 +53,7 @@ checked expr : sign(to_float64(1_u8)) optimized expr : 1_i8 output type : Int8 output domain : {1..=1} -output : 1_i8 +output : 1 ast : sign(-1) @@ -62,7 +62,7 @@ checked expr : sign(to_float64(minus(1_u8))) optimized expr : -1_i8 output type : Int8 output domain : {-1..=-1} -output : -1_i8 +output : -1 ast : sign(null) @@ -83,9 +83,9 @@ evaluation: +--------+--------------+----------+ | Type | Int64 | Int8 | | Domain | {-30..=1024} | {-1..=1} | -| Row 0 | 1_i64 | 1_i8 | -| Row 1 | -30_i64 | -1_i8 | -| Row 2 | 1024_i64 | 1_i8 | +| Row 0 | 1 | 1 | +| Row 1 | -30 | -1 | +| Row 2 | 1024 | 1 | +--------+--------------+----------+ evaluation (internal): +--------+-----------------------+ @@ -102,7 +102,7 @@ checked expr : sin(to_float64(1_u8)) optimized expr : 0.8414709848_f64 output type : Float64 output domain : {0.8414709848..=0.8414709848} -output : 0.8414709848_f64 +output : 0.8414709848 ast : cos(1) @@ -111,7 +111,7 @@ checked expr : cos(to_float64(1_u8)) optimized expr : 0.5403023058_f64 output type : Float64 output domain : {0.5403023058..=0.5403023058} -output : 0.5403023058_f64 +output : 0.5403023058 ast : tan(1) @@ -120,7 +120,7 @@ checked expr : tan(to_float64(1_u8)) optimized expr : 1.5574077246_f64 output type : Float64 output domain : {1.5574077246..=1.5574077246} -output : 1.5574077246_f64 +output : 1.5574077246 ast : atan(0.5) @@ -129,7 +129,7 @@ checked expr : atan(0.5_f64) optimized expr : 0.463647609_f64 output type : Float64 output domain : {0.463647609..=0.463647609} -output : 0.463647609_f64 +output : 0.463647609 ast : cot(-1.0) @@ -138,7 +138,7 @@ checked expr : cot(minus(1_f64)) optimized expr : -0.6420926159_f64 output type : Float64 output domain : {-0.6420926159..=-0.6420926159} -output : -0.6420926159_f64 +output : -0.6420926159 ast : asin(1) @@ -147,7 +147,7 @@ checked expr : asin(to_float64(1_u8)) optimized expr : 1.5707963267_f64 output type : Float64 output domain : {1.5707963267..=1.5707963267} -output : 1.5707963267_f64 +output : 1.5707963267 ast : acos(0) @@ -156,7 +156,7 @@ checked expr : acos(to_float64(0_u8)) optimized expr : 1.5707963267_f64 output type : Float64 output domain : {1.5707963267..=1.5707963267} -output : 1.5707963267_f64 +output : 1.5707963267 ast : atan(null) @@ -178,9 +178,9 @@ evaluation: +--------+-------------+--------------------------------+ | Type | Int64 | Float64 | | Domain | {-1..=1024} | {-3.1415926535..=3.1415926535} | -| Row 0 | 1_i64 | 0.2449786631_f64 | -| Row 1 | -1_i64 | -0.2449786631_f64 | -| Row 2 | 1024_i64 | 1.5668900966_f64 | +| Row 0 | 1 | 0.2449786631 | +| Row 1 | -1 | -0.2449786631 | +| Row 2 | 1024 | 1.5668900966 | +--------+-------------+--------------------------------+ evaluation (internal): +--------+------------------------------------------------------+ @@ -197,7 +197,7 @@ checked expr : ceil(5_u8) optimized expr : 5_u8 output type : UInt8 output domain : {5..=5} -output : 5_u8 +output : 5 ast : ceil(5.6) @@ -206,7 +206,7 @@ checked expr : ceil(5.6_f64) optimized expr : 6_f64 output type : Float64 output domain : {6..=6} -output : 6_f64 +output : 6 ast : ceil(a) @@ -218,8 +218,8 @@ evaluation: +--------+----------------+--------------+ | Type | Float64 | Float64 | | Domain | {-1.23..=1.23} | {-inf..=NaN} | -| Row 0 | 1.23_f64 | 2_f64 | -| Row 1 | -1.23_f64 | -1_f64 | +| Row 0 | 1.23 | 2 | +| Row 1 | -1.23 | -1 | +--------+----------------+--------------+ evaluation (internal): +--------+------------------------+ @@ -236,7 +236,7 @@ checked expr : exp(2_u8) optimized expr : 7.3890560989_f64 output type : Float64 output domain : {7.3890560989..=7.3890560989} -output : 7.3890560989_f64 +output : 7.3890560989 ast : exp(-2) @@ -245,7 +245,7 @@ checked expr : exp(minus(2_u8)) optimized expr : 0.1353352832_f64 output type : Float64 output domain : {0.1353352832..=0.1353352832} -output : 0.1353352832_f64 +output : 0.1353352832 ast : exp(0) @@ -254,22 +254,22 @@ checked expr : exp(0_u8) optimized expr : 1_f64 output type : Float64 output domain : {1..=1} -output : 1_f64 +output : 1 ast : exp(a) raw expr : exp(a::Int64) checked expr : exp(a) evaluation: -+--------+-----------+----------------------+ -| | a | Output | -+--------+-----------+----------------------+ -| Type | Int64 | Float64 | -| Domain | {-2..=10} | {-inf..=NaN} | -| Row 0 | 4_i64 | 54.5981500331_f64 | -| Row 1 | -2_i64 | 0.1353352832_f64 | -| Row 2 | 10_i64 | 22026.4657948067_f64 | -+--------+-----------+----------------------+ ++--------+-----------+------------------+ +| | a | Output | ++--------+-----------+------------------+ +| Type | Int64 | Float64 | +| Domain | {-2..=10} | {-inf..=NaN} | +| Row 0 | 4 | 54.5981500331 | +| Row 1 | -2 | 0.1353352832 | +| Row 2 | 10 | 22026.4657948067 | ++--------+-----------+------------------+ evaluation (internal): +--------+----------------------------------------------------------+ | Column | Data | @@ -285,7 +285,7 @@ checked expr : round(minus(1.23_f64)) optimized expr : -1_f64 output type : Float64 output domain : {-1..=-1} -output : -1_f64 +output : -1 ast : round(1.298, 1) @@ -294,7 +294,7 @@ checked expr : round(1.298_f64, to_int64(1_u8)) optimized expr : 1.3_f64 output type : Float64 output domain : {1.3..=1.3} -output : 1.3_f64 +output : 1.3 ast : round(1.298, 0) @@ -303,7 +303,7 @@ checked expr : round(1.298_f64, to_int64(0_u8)) optimized expr : 1_f64 output type : Float64 output domain : {1..=1} -output : 1_f64 +output : 1 ast : round(23.298, -1) @@ -312,7 +312,7 @@ checked expr : round(23.298_f64, to_int64(minus( optimized expr : 20_f64 output type : Float64 output domain : {20..=20} -output : 20_f64 +output : 20 ast : round(0.12345678901234567890123456789012345, 35) @@ -321,7 +321,7 @@ checked expr : round(0.123456789_f64, to_int64(35_u8)) optimized expr : 0.123456789_f64 output type : Float64 output domain : {0.123456789..=0.123456789} -output : 0.123456789_f64 +output : 0.123456789 ast : round(a) @@ -333,9 +333,9 @@ evaluation: +--------+------------------+--------------+ | Type | Float64 | Float64 | | Domain | {-22.23..=22.22} | {-inf..=NaN} | -| Row 0 | 22.22_f64 | 22_f64 | -| Row 1 | -22.23_f64 | -22_f64 | -| Row 2 | 10_f64 | 10_f64 | +| Row 0 | 22.22 | 22 | +| Row 1 | -22.23 | -22 | +| Row 2 | 10 | 10 | +--------+------------------+--------------+ evaluation (internal): +--------+------------------------------+ @@ -352,22 +352,22 @@ checked expr : sqrt(4_u8) optimized expr : 2_f64 output type : Float64 output domain : {2..=2} -output : 2_f64 +output : 2 ast : sqrt(a) raw expr : sqrt(a::Int64) checked expr : sqrt(a) evaluation: -+--------+-------------+------------------+ -| | a | Output | -+--------+-------------+------------------+ -| Type | Int64 | Float64 | -| Domain | {10..=1024} | {-inf..=NaN} | -| Row 0 | 22_i64 | 4.6904157598_f64 | -| Row 1 | 1024_i64 | 32_f64 | -| Row 2 | 10_i64 | 3.1622776601_f64 | -+--------+-------------+------------------+ ++--------+-------------+--------------+ +| | a | Output | ++--------+-------------+--------------+ +| Type | Int64 | Float64 | +| Domain | {10..=1024} | {-inf..=NaN} | +| Row 0 | 22 | 4.6904157598 | +| Row 1 | 1024 | 32 | +| Row 2 | 10 | 3.1622776601 | ++--------+-------------+--------------+ evaluation (internal): +--------+-------------------------------------------+ | Column | Data | @@ -383,7 +383,7 @@ checked expr : truncate(1.223_f64, to_int64(1_u8)) optimized expr : 1.2_f64 output type : Float64 output domain : {1.2..=1.2} -output : 1.2_f64 +output : 1.2 ast : truncate(1.999) @@ -392,7 +392,7 @@ checked expr : truncate(1.999_f64) optimized expr : 1_f64 output type : Float64 output domain : {1..=1} -output : 1_f64 +output : 1 ast : truncate(1.999, 1) @@ -401,7 +401,7 @@ checked expr : truncate(1.999_f64, to_int64(1_u8)) optimized expr : 1.9_f64 output type : Float64 output domain : {1.9..=1.9} -output : 1.9_f64 +output : 1.9 ast : truncate(122, -2) @@ -410,7 +410,7 @@ checked expr : truncate(122_u8, to_int64(minus(2_u optimized expr : 100_f64 output type : Float64 output domain : {100..=100} -output : 100_f64 +output : 100 ast : truncate(10.28*100, 0) @@ -419,7 +419,7 @@ checked expr : truncate(multiply(10.28_f64, 10 optimized expr : 1028_f64 output type : Float64 output domain : {1028..=1028} -output : 1028_f64 +output : 1028 ast : truncate(a, 1) @@ -432,9 +432,9 @@ evaluation: +--------+------------------+--------------+ | Type | Float64 | Float64 | | Domain | {-22.23..=22.22} | {-inf..=NaN} | -| Row 0 | 22.22_f64 | 22.2_f64 | -| Row 1 | -22.23_f64 | -22.2_f64 | -| Row 2 | 10_f64 | 10_f64 | +| Row 0 | 22.22 | 22.2 | +| Row 1 | -22.23 | -22.2 | +| Row 2 | 10 | 10 | +--------+------------------+--------------+ evaluation (internal): +--------+------------------------------+ @@ -451,7 +451,7 @@ checked expr : log(2_u8) optimized expr : 0.6931471805_f64 output type : Float64 output domain : {0.6931471805..=0.6931471805} -output : 0.6931471805_f64 +output : 0.6931471805 ast : log(2, 65536) @@ -460,7 +460,7 @@ checked expr : log(2_u8, to_float64(65536_u32)) optimized expr : 16_f64 output type : Float64 output domain : {16..=16} -output : 16_f64 +output : 16 ast : log2(65536) @@ -469,7 +469,7 @@ checked expr : log2(65536_u32) optimized expr : 16_f64 output type : Float64 output domain : {16..=16} -output : 16_f64 +output : 16 ast : log10(100) @@ -478,7 +478,7 @@ checked expr : log10(100_u8) optimized expr : 2_f64 output type : Float64 output domain : {2..=2} -output : 2_f64 +output : 2 ast : ln(2) @@ -487,7 +487,7 @@ checked expr : ln(2_u8) optimized expr : 0.6931471805_f64 output type : Float64 output domain : {0.6931471805..=0.6931471805} -output : 0.6931471805_f64 +output : 0.6931471805 ast : round(2, a) @@ -499,9 +499,9 @@ evaluation: +--------+--------------+--------------+ | Type | Int64 | Float64 | | Domain | {10..=65536} | {-inf..=NaN} | -| Row 0 | 22_i64 | 2_f64 | -| Row 1 | 65536_i64 | 2_f64 | -| Row 2 | 10_i64 | 2_f64 | +| Row 0 | 22 | 2 | +| Row 1 | 65536 | 2 | +| Row 2 | 10 | 2 | +--------+--------------+--------------+ evaluation (internal): +--------+------------------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/other.txt b/src/query/functions/tests/it/scalars/testdata/other.txt index ae9c7448e07fb..d42704accf45a 100644 --- a/src/query/functions/tests/it/scalars/testdata/other.txt +++ b/src/query/functions/tests/it/scalars/testdata/other.txt @@ -4,7 +4,7 @@ checked expr : running_difference(to_int64(minus(1_u8))) optimized expr : 0_i64 output type : Int64 output domain : {0..=0} -output : 0_i64 +output : 0 ast : running_difference(0.2) @@ -13,7 +13,7 @@ checked expr : running_difference(0.2_f64) optimized expr : 0_f64 output type : Float64 output domain : {0..=0} -output : 0_f64 +output : 0 ast : running_difference(to_datetime(10000)) @@ -22,7 +22,7 @@ checked expr : running_difference(to_timestamp(to_int64(to_date(to_int64(10000_ optimized expr : 0_i32 output type : Int32 output domain : {0..=0} -output : 0_i32 +output : 0 ast : running_difference(a) @@ -43,9 +43,9 @@ evaluation: +--------+-------------+---------+ | Type | UInt16 | Int64 | | Domain | {224..=512} | Unknown | -| Row 0 | 224_u16 | 0_i64 | -| Row 1 | 384_u16 | 160_i64 | -| Row 2 | 512_u16 | 128_i64 | +| Row 0 | 224 | 0 | +| Row 1 | 384 | 160 | +| Row 2 | 512 | 128 | +--------+-------------+---------+ evaluation (internal): +--------+-------------------------+ @@ -65,9 +65,9 @@ evaluation: +--------+-------------------------+---------+ | Type | Float64 | Float64 | | Domain | {37.617673..=39.617673} | Unknown | -| Row 0 | 37.617673_f64 | 0_f64 | -| Row 1 | 38.617673_f64 | 1_f64 | -| Row 2 | 39.617673_f64 | 1_f64 | +| Row 0 | 37.617673 | 0 | +| Row 1 | 38.617673 | 1 | +| Row 2 | 39.617673 | 1 | +--------+-------------------------+---------+ evaluation (internal): +--------+--------------------------------------------+ @@ -137,14 +137,14 @@ checked expr : sleep(to_float64(2_u8)) optimized expr : 1_u8 output type : UInt8 output domain : {1..=1} -output : 1_u8 +output : 1 error: --> SQL:1:1 | 1 | sleep(300.2) - | ^^^^^^^^^^^^ The maximum sleep time is 300 seconds. Requested: 300.2s while evaluating function `sleep(300.2_f64)` + | ^^^^^^^^^^^^ The maximum sleep time is 300 seconds. Requested: 300.2s while evaluating function `sleep(300.2)` @@ -184,9 +184,9 @@ evaluation: +--------+------------------+---------+ | Type | UInt8 NULL | UInt8 | | Domain | {1..=3} ∪ {NULL} | {1..=3} | -| Row 0 | 1_u8 | 1_u8 | -| Row 1 | 2_u8 | 2_u8 | -| Row 2 | NULL | 3_u8 | +| Row 0 | 1 | 1 | +| Row 1 | 2 | 2 | +| Row 2 | NULL | 3 | +--------+------------------+---------+ evaluation (internal): +--------+---------------------------------------------------------------------+ @@ -203,7 +203,7 @@ checked expr : inet_aton("1.2.3.4") optimized expr : 16909060_u32 output type : UInt32 output domain : {16909060..=16909060} -output : 16909060_u32 +output : 16909060 ast : try_inet_aton('10.0.5.9000') @@ -221,7 +221,7 @@ checked expr : try_inet_aton("10.0.5.9") optimized expr : 167773449_u32 output type : UInt32 NULL output domain : {167773449..=167773449} -output : 167773449_u32 +output : 167773449 ast : inet_ntoa(16909060) diff --git a/src/query/functions/tests/it/scalars/testdata/regexp.txt b/src/query/functions/tests/it/scalars/testdata/regexp.txt index a6063245f73f7..c9b290dc16d42 100644 --- a/src/query/functions/tests/it/scalars/testdata/regexp.txt +++ b/src/query/functions/tests/it/scalars/testdata/regexp.txt @@ -4,7 +4,7 @@ checked expr : regexp_instr("dog cat dog", "dog", to_in optimized expr : 1_u64 output type : UInt64 output domain : {1..=1} -output : 1_u64 +output : 1 ast : regexp_instr('aa aaa aaaa aa aaa aaaa', 'a{2}', 1) @@ -13,7 +13,7 @@ checked expr : regexp_instr("aa aaa aaaa aa aaa aaaa", optimized expr : 1_u64 output type : UInt64 output domain : {1..=1} -output : 1_u64 +output : 1 ast : regexp_instr('aa aaa aaaa aa aaa aaaa', NULL, 2) @@ -31,14 +31,14 @@ checked expr : regexp_instr("", "", to_int64(1_u optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 error: --> SQL:1:1 | 1 | regexp_instr('', '', 0) - | ^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr: position must be positive, but got 0 while evaluating function `regexp_instr("", "", 0_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr: position must be positive, but got 0 while evaluating function `regexp_instr("", "", 0)` @@ -51,9 +51,9 @@ evaluation: +--------+---------------------------+--------------+---------+ | Type | String | String | UInt64 | | Domain | {""..="dog cat dog"} | {""..="dog"} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 1_u64 | -| Row 2 | "" | "" | 0_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 1 | +| Row 2 | "" | "" | 0 | +--------+---------------------------+--------------+---------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------------------------------+ @@ -74,9 +74,9 @@ evaluation: +--------+---------------------------+--------------+---------+---------+ | Type | String | String | Int64 | UInt64 | | Domain | {""..="dog cat dog"} | {""..="dog"} | {1..=2} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_i64 | 1_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 2_i64 | 4_u64 | -| Row 2 | "" | "" | 1_i64 | 0_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | 1 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 2 | 4 | +| Row 2 | "" | "" | 1 | 0 | +--------+---------------------------+--------------+---------+---------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------------------------------+ @@ -98,9 +98,9 @@ evaluation: +--------+---------------------------------------------+------------------+---------+---------+---------+ | Type | String | String | Int64 | Int64 | UInt64 | | Domain | {"aa aa aa aaaa aaaa aaaa"..="dog cat dog"} | {"a{2}"..="dog"} | {1..=9} | {2..=3} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_i64 | 2_i64 | 9_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 1_i64 | 3_i64 | 8_u64 | -| Row 2 | "aa aa aa aaaa aaaa aaaa" | "a{4}" | 9_i64 | 2_i64 | 15_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | 2 | 9 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 1 | 3 | 8 | +| Row 2 | "aa aa aa aaaa aaaa aaaa" | "a{4}" | 9 | 2 | 15 | +--------+---------------------------------------------+------------------+---------+---------+---------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -124,9 +124,9 @@ evaluation: +--------+---------------------------------------------+------------------+---------+---------+---------+---------+ | Type | String | String | Int64 | Int64 | Int64 | UInt64 | | Domain | {"aa aa aa aaaa aaaa aaaa"..="dog cat dog"} | {"a{2}"..="dog"} | {1..=2} | {2..=2} | {0..=1} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_i64 | 2_i64 | 0_i64 | 9_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 2_i64 | 2_i64 | 1_i64 | 10_u64 | -| Row 2 | "aa aa aa aaaa aaaa aaaa" | "a{4}" | 1_i64 | 2_i64 | 1_i64 | 19_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | 2 | 0 | 9 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | "a{2}" | 2 | 2 | 1 | 10 | +| Row 2 | "aa aa aa aaaa aaaa aaaa" | "a{4}" | 1 | 2 | 1 | 19 | +--------+---------------------------------------------+------------------+---------+---------+---------+---------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -151,9 +151,9 @@ evaluation: +--------+---------------------------------------------+------------------+---------+---------+---------+-------------+---------+ | Type | String | String | Int64 | Int64 | Int64 | String | UInt64 | | Domain | {"aa aa aa aaaa aaaa aaaa"..="dog cat dog"} | {"A{2}"..="dog"} | {1..=2} | {2..=2} | {0..=1} | {"c"..="i"} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_i64 | 2_i64 | 0_i64 | "i" | 9_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | "A{2}" | 2_i64 | 2_i64 | 1_i64 | "c" | 0_u64 | -| Row 2 | "aa aa aa aaaa aaaa aaaa" | "A{4}" | 1_i64 | 2_i64 | 1_i64 | "i" | 19_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | 2 | 0 | "i" | 9 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | "A{2}" | 2 | 2 | 1 | "c" | 0 | +| Row 2 | "aa aa aa aaaa aaaa aaaa" | "A{4}" | 1 | 2 | 1 | "i" | 19 | +--------+---------------------------------------------+------------------+---------+---------+---------+-------------+---------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -178,10 +178,10 @@ evaluation: +--------+-------------------------------+-----------------------+---------+---------+---------+-------------+ | Type | String NULL | String NULL | Int64 | Int64 | Int64 | UInt64 NULL | | Domain | {""..="dog cat dog"} ∪ {NULL} | {""..="dog"} ∪ {NULL} | {1..=2} | {1..=2} | {0..=1} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_i64 | 2_i64 | 0_i64 | 9_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | NULL | 2_i64 | 2_i64 | 1_i64 | NULL | -| Row 2 | NULL | NULL | 1_i64 | 2_i64 | 1_i64 | NULL | -| Row 3 | "aa aa aa aaaa aaaa aaaa" | "A{4}" | 1_i64 | 1_i64 | 1_i64 | 14_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | 2 | 0 | 9 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | NULL | 2 | 2 | 1 | NULL | +| Row 2 | NULL | NULL | 1 | 2 | 1 | NULL | +| Row 3 | "aa aa aa aaaa aaaa aaaa" | "A{4}" | 1 | 1 | 1 | 14 | +--------+-------------------------------+-----------------------+---------+---------+---------+-------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -205,10 +205,10 @@ evaluation: +--------+-------------------------------+-----------------------+---------+---------+---------+-------------+-------------+ | Type | String NULL | String NULL | Int64 | Int64 | Int64 | String | UInt64 NULL | | Domain | {""..="dog cat dog"} ∪ {NULL} | {""..="dog"} ∪ {NULL} | {1..=2} | {1..=2} | {0..=1} | {"c"..="i"} | Unknown | -| Row 0 | "dog cat dog" | "dog" | 1_i64 | 2_i64 | 0_i64 | "i" | 9_u64 | -| Row 1 | "aa aaa aaaa aa aaa aaaa" | NULL | 2_i64 | 2_i64 | 1_i64 | "c" | NULL | -| Row 2 | NULL | NULL | 1_i64 | 2_i64 | 1_i64 | "i" | NULL | -| Row 3 | "aa aa aa aaaa aaaa aaaa" | "A{4}" | 1_i64 | 1_i64 | 1_i64 | "i" | 14_u64 | +| Row 0 | "dog cat dog" | "dog" | 1 | 2 | 0 | "i" | 9 | +| Row 1 | "aa aaa aaaa aa aaa aaaa" | NULL | 2 | 2 | 1 | "c" | NULL | +| Row 2 | NULL | NULL | 1 | 2 | 1 | "i" | NULL | +| Row 3 | "aa aa aa aaaa aaaa aaaa" | "A{4}" | 1 | 1 | 1 | "i" | 14 | +--------+-------------------------------+-----------------------+---------+---------+---------+-------------+-------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -234,10 +234,10 @@ evaluation: +--------+---------------------------------------------------------+-----------------+---------+---------+---------+---------+ | Type | String | String | Int64 | Int64 | Int64 | UInt64 | | Domain | {"周 周周 周周周 周周周周"..="周 周周 周周周 周周周周"} | {"周+"..="周+"} | {1..=5} | {1..=3} | {0..=1} | Unknown | -| Row 0 | "周 周周 周周周 周周周周" | "周+" | 1_i64 | 2_i64 | 0_i64 | 3_u64 | -| Row 1 | "周 周周 周周周 周周周周" | "周+" | 2_i64 | 2_i64 | 1_i64 | 9_u64 | -| Row 2 | "周 周周 周周周 周周周周" | "周+" | 3_i64 | 3_i64 | 1_i64 | 14_u64 | -| Row 3 | "周 周周 周周周 周周周周" | "周+" | 5_i64 | 1_i64 | 1_i64 | 9_u64 | +| Row 0 | "周 周周 周周周 周周周周" | "周+" | 1 | 2 | 0 | 3 | +| Row 1 | "周 周周 周周周 周周周周" | "周+" | 2 | 2 | 1 | 9 | +| Row 2 | "周 周周 周周周 周周周周" | "周+" | 3 | 3 | 1 | 14 | +| Row 3 | "周 周周 周周周 周周周周" | "周+" | 5 | 1 | 1 | 9 | +--------+---------------------------------------------------------+-----------------+---------+---------+---------+---------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -256,7 +256,7 @@ error: --> SQL:1:1 | 1 | regexp_instr(source, pat, pos, occur, ro) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr: position must be positive, but got 0 while evaluating function `regexp_instr("dog cat dog", "dog", 0_i64, 1_i64, 0_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr: position must be positive, but got 0 while evaluating function `regexp_instr("dog cat dog", "dog", 0, 1, 0)` @@ -264,7 +264,7 @@ error: --> SQL:1:1 | 1 | regexp_instr(source, pat, pos, occur, ro) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr: return_option must be 1 or 0, but got 2 while evaluating function `regexp_instr("aa aaa aaaa aa aaa aaaa", "A{2}", 2_i64, 2_i64, 2_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr: return_option must be 1 or 0, but got 2 while evaluating function `regexp_instr("aa aaa aaaa aa aaa aaaa", "A{2}", 2, 2, 2)` @@ -272,7 +272,7 @@ error: --> SQL:1:1 | 1 | regexp_instr(source, pat, pos, occur, ro, mt) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr match type: - while evaluating function `regexp_instr("aa aaa aaaa aa aaa aaaa", "A{4}", 1_i64, 1_i64, 1_i64, "-i")` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_instr match type: - while evaluating function `regexp_instr("aa aaa aaaa aa aaa aaaa", "A{4}", 1, 1, 1, "-i")` @@ -533,10 +533,10 @@ evaluation: +--------+---------------------------------+-----------------------+-------------+----------+---------------+ | Type | String | String | String | Int64 | String | | Domain | {"abc def ghi"..="abc def ghi"} | {"[a-z]+"..="[a-z]+"} | {"X"..="X"} | {1..=12} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1_i64 | "X X X" | -| Row 1 | "abc def ghi" | "[a-z]+" | "X" | 4_i64 | "abc X X" | -| Row 2 | "abc def ghi" | "[a-z]+" | "X" | 8_i64 | "abc def X" | -| Row 3 | "abc def ghi" | "[a-z]+" | "X" | 12_i64 | "abc def ghi" | +| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1 | "X X X" | +| Row 1 | "abc def ghi" | "[a-z]+" | "X" | 4 | "abc X X" | +| Row 2 | "abc def ghi" | "[a-z]+" | "X" | 8 | "abc def X" | +| Row 3 | "abc def ghi" | "[a-z]+" | "X" | 12 | "abc def ghi" | +--------+---------------------------------+-----------------------+-------------+----------+---------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -560,10 +560,10 @@ evaluation: +--------+---------------------------------+-----------------------+-------------+---------+---------+---------------+ | Type | String | String | String | Int64 | Int64 | String | | Domain | {"abc def ghi"..="abc def ghi"} | {"[a-z]+"..="[a-z]+"} | {"X"..="X"} | {1..=4} | {0..=3} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1_i64 | 0_i64 | "X X X" | -| Row 1 | "abc def ghi" | "[a-z]+" | "X" | 1_i64 | 1_i64 | "X def ghi" | -| Row 2 | "abc def ghi" | "[a-z]+" | "X" | 4_i64 | 2_i64 | "abc def X" | -| Row 3 | "abc def ghi" | "[a-z]+" | "X" | 4_i64 | 3_i64 | "abc def ghi" | +| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1 | 0 | "X X X" | +| Row 1 | "abc def ghi" | "[a-z]+" | "X" | 1 | 1 | "X def ghi" | +| Row 2 | "abc def ghi" | "[a-z]+" | "X" | 4 | 2 | "abc def X" | +| Row 3 | "abc def ghi" | "[a-z]+" | "X" | 4 | 3 | "abc def ghi" | +--------+---------------------------------+-----------------------+-------------+---------+---------+---------------+ evaluation (internal): +--------+-------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -588,9 +588,9 @@ evaluation: +--------+---------------------------------+-----------------------+-------------+---------+---------+------------+-------------+ | Type | String | String | String | Int64 | Int64 | String | String | | Domain | {"abc DEF ghi"..="abc def ghi"} | {"[a-z]+"..="[a-z]+"} | {"X"..="X"} | {1..=4} | {0..=2} | {""..="i"} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1_i64 | 0_i64 | "" | "X X X" | -| Row 1 | "abc DEF ghi" | "[a-z]+" | "X" | 1_i64 | 2_i64 | "c" | "abc DEF X" | -| Row 2 | "abc DEF ghi" | "[a-z]+" | "X" | 4_i64 | 1_i64 | "i" | "abc X ghi" | +| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1 | 0 | "" | "X X X" | +| Row 1 | "abc DEF ghi" | "[a-z]+" | "X" | 1 | 2 | "c" | "abc DEF X" | +| Row 2 | "abc DEF ghi" | "[a-z]+" | "X" | 4 | 1 | "i" | "abc X ghi" | +--------+---------------------------------+-----------------------+-------------+---------+---------+------------+-------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------+ @@ -616,10 +616,10 @@ evaluation: +--------+-------------------------------+--------------------------+-------------+---------+---------+-------------+ | Type | String NULL | String NULL | String | Int64 | Int64 | String NULL | | Domain | {""..="abc def ghi"} ∪ {NULL} | {""..="[a-z]+"} ∪ {NULL} | {"X"..="X"} | {1..=4} | {0..=2} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1_i64 | 0_i64 | "X X X" | -| Row 1 | "abc DEF ghi" | NULL | "X" | 1_i64 | 2_i64 | NULL | -| Row 2 | NULL | NULL | "X" | 4_i64 | 1_i64 | NULL | -| Row 3 | "abc DEF ghi" | "[a-z]+" | "X" | 4_i64 | 1_i64 | "abc X ghi" | +| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1 | 0 | "X X X" | +| Row 1 | "abc DEF ghi" | NULL | "X" | 1 | 2 | NULL | +| Row 2 | NULL | NULL | "X" | 4 | 1 | NULL | +| Row 3 | "abc DEF ghi" | "[a-z]+" | "X" | 4 | 1 | "abc X ghi" | +--------+-------------------------------+--------------------------+-------------+---------+---------+-------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -644,10 +644,10 @@ evaluation: +--------+-------------------------------+--------------------------+-------------+---------+---------+------------+-------------+ | Type | String NULL | String NULL | String | Int64 | Int64 | String | String NULL | | Domain | {""..="abc def ghi"} ∪ {NULL} | {""..="[a-z]+"} ∪ {NULL} | {"X"..="X"} | {1..=4} | {0..=2} | {""..="i"} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1_i64 | 0_i64 | "" | "X X X" | -| Row 1 | "abc DEF ghi" | NULL | "X" | 1_i64 | 2_i64 | "c" | NULL | -| Row 2 | NULL | NULL | "X" | 4_i64 | 1_i64 | "i" | NULL | -| Row 3 | "abc DEF ghi" | "[a-z]+" | "X" | 4_i64 | 1_i64 | "i" | "abc X ghi" | +| Row 0 | "abc def ghi" | "[a-z]+" | "X" | 1 | 0 | "" | "X X X" | +| Row 1 | "abc DEF ghi" | NULL | "X" | 1 | 2 | "c" | NULL | +| Row 2 | NULL | NULL | "X" | 4 | 1 | "i" | NULL | +| Row 3 | "abc DEF ghi" | "[a-z]+" | "X" | 4 | 1 | "i" | "abc X ghi" | +--------+-------------------------------+--------------------------+-------------+---------+---------+------------+-------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -673,10 +673,10 @@ evaluation: +--------+---------------------------------------------------------+-----------------+---------------+---------+---------+-------------------------+ | Type | String | String | String | Int64 | Int64 | String | | Domain | {"周 周周 周周周 周周周周"..="周 周周 周周周 周周周周"} | {"周+"..="周+"} | {"唐"..="唐"} | {1..=5} | {0..=3} | Unknown | -| Row 0 | "周 周周 周周周 周周周周" | "周+" | "唐" | 1_i64 | 0_i64 | "唐 唐 唐 唐" | -| Row 1 | "周 周周 周周周 周周周周" | "周+" | "唐" | 2_i64 | 1_i64 | "周 唐 周周周 周周周周" | -| Row 2 | "周 周周 周周周 周周周周" | "周+" | "唐" | 3_i64 | 3_i64 | "周 周周 周周周 唐" | -| Row 3 | "周 周周 周周周 周周周周" | "周+" | "唐" | 5_i64 | 1_i64 | "周 周周 唐 周周周周" | +| Row 0 | "周 周周 周周周 周周周周" | "周+" | "唐" | 1 | 0 | "唐 唐 唐 唐" | +| Row 1 | "周 周周 周周周 周周周周" | "周+" | "唐" | 2 | 1 | "周 唐 周周周 周周周周" | +| Row 2 | "周 周周 周周周 周周周周" | "周+" | "唐" | 3 | 3 | "周 周周 周周周 唐" | +| Row 3 | "周 周周 周周周 周周周周" | "周+" | "唐" | 5 | 1 | "周 周周 唐 周周周周" | +--------+---------------------------------------------------------+-----------------+---------------+---------+---------+-------------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -695,7 +695,7 @@ error: --> SQL:1:1 | 1 | regexp_replace(source, pat, repl, pos) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_replace: position must be positive, but got 0 while evaluating function `regexp_replace("abc", "b", "X", 0_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_replace: position must be positive, but got 0 while evaluating function `regexp_replace("abc", "b", "X", 0)` @@ -703,7 +703,7 @@ error: --> SQL:1:1 | 1 | regexp_replace(source, pat, repl, pos, occur) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_replace: occurrence must not be negative, but got -1 while evaluating function `regexp_replace("a b c", "b", "X", 1_i64, -1_i64)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_replace: occurrence must not be negative, but got -1 while evaluating function `regexp_replace("a b c", "b", "X", 1, -1)` @@ -711,7 +711,7 @@ error: --> SQL:1:1 | 1 | regexp_replace(source, pat, repl, pos, occur, mt) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_replace match type: - while evaluating function `regexp_replace("a b c", "b", "X", 1_i64, 0_i64, "-c")` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_replace match type: - while evaluating function `regexp_replace("a b c", "b", "X", 1, 0, "-c")` @@ -802,9 +802,9 @@ evaluation: +--------+---------------------------------+-----------------------+----------+-------------+ | Type | String | String | Int64 | String NULL | | Domain | {"abc def ghi"..="abc def ghi"} | {"[a-z]+"..="[a-z]+"} | {1..=12} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | 1_i64 | "abc" | -| Row 1 | "abc def ghi" | "[a-z]+" | 4_i64 | "def" | -| Row 2 | "abc def ghi" | "[a-z]+" | 12_i64 | NULL | +| Row 0 | "abc def ghi" | "[a-z]+" | 1 | "abc" | +| Row 1 | "abc def ghi" | "[a-z]+" | 4 | "def" | +| Row 2 | "abc def ghi" | "[a-z]+" | 12 | NULL | +--------+---------------------------------+-----------------------+----------+-------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------+ @@ -827,9 +827,9 @@ evaluation: +--------+---------------------------------+-----------------------+----------+---------+-------------+ | Type | String | String | Int64 | Int64 | String NULL | | Domain | {"abc def ghi"..="abc def ghi"} | {"[a-z]+"..="[a-z]+"} | {1..=12} | {2..=3} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | 1_i64 | 3_i64 | "ghi" | -| Row 1 | "abc def ghi" | "[a-z]+" | 4_i64 | 2_i64 | "ghi" | -| Row 2 | "abc def ghi" | "[a-z]+" | 12_i64 | 3_i64 | NULL | +| Row 0 | "abc def ghi" | "[a-z]+" | 1 | 3 | "ghi" | +| Row 1 | "abc def ghi" | "[a-z]+" | 4 | 2 | "ghi" | +| Row 2 | "abc def ghi" | "[a-z]+" | 12 | 3 | NULL | +--------+---------------------------------+-----------------------+----------+---------+-------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------+ @@ -853,9 +853,9 @@ evaluation: +--------+---------------------------------+-----------------------+----------+---------+-------------+-------------+ | Type | String | String | Int64 | Int64 | String | String NULL | | Domain | {"ABC def ghi"..="abc def GHI"} | {"[a-z]+"..="[a-z]+"} | {1..=12} | {2..=3} | {"c"..="i"} | Unknown | -| Row 0 | "ABC def ghi" | "[a-z]+" | 1_i64 | 3_i64 | "c" | NULL | -| Row 1 | "abc def GHI" | "[a-z]+" | 4_i64 | 2_i64 | "i" | "GHI" | -| Row 2 | "abc DEF ghi" | "[a-z]+" | 12_i64 | 3_i64 | "i" | NULL | +| Row 0 | "ABC def ghi" | "[a-z]+" | 1 | 3 | "c" | NULL | +| Row 1 | "abc def GHI" | "[a-z]+" | 4 | 2 | "i" | "GHI" | +| Row 2 | "abc DEF ghi" | "[a-z]+" | 12 | 3 | "i" | NULL | +--------+---------------------------------+-----------------------+----------+---------+-------------+-------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------+ @@ -879,10 +879,10 @@ evaluation: +--------+-------------------------------+--------------------------+---------+---------+------------+-------------+ | Type | String NULL | String NULL | Int64 | Int64 | String | String NULL | | Domain | {""..="abc def ghi"} ∪ {NULL} | {""..="[a-z]+"} ∪ {NULL} | {1..=4} | {1..=2} | {""..="i"} | Unknown | -| Row 0 | "abc def ghi" | "[a-z]+" | 1_i64 | 1_i64 | "" | "abc" | -| Row 1 | "abc DEF ghi" | NULL | 1_i64 | 2_i64 | "c" | NULL | -| Row 2 | NULL | NULL | 4_i64 | 1_i64 | "i" | NULL | -| Row 3 | "abc DEF ghi" | "[a-z]+" | 4_i64 | 1_i64 | "i" | "DEF" | +| Row 0 | "abc def ghi" | "[a-z]+" | 1 | 1 | "" | "abc" | +| Row 1 | "abc DEF ghi" | NULL | 1 | 2 | "c" | NULL | +| Row 2 | NULL | NULL | 4 | 1 | "i" | NULL | +| Row 3 | "abc DEF ghi" | "[a-z]+" | 4 | 1 | "i" | "DEF" | +--------+-------------------------------+--------------------------+---------+---------+------------+-------------+ evaluation (internal): +--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -907,9 +907,9 @@ evaluation: +--------+---------------------------------------------------------+-----------------+----------+---------+-------------+ | Type | String | String | Int64 | Int64 | String NULL | | Domain | {"周 周周 周周周 周周周周"..="周 周周 周周周 周周周周"} | {"周+"..="周+"} | {1..=14} | {1..=2} | Unknown | -| Row 0 | "周 周周 周周周 周周周周" | "周+" | 1_i64 | 1_i64 | "周" | -| Row 1 | "周 周周 周周周 周周周周" | "周+" | 2_i64 | 2_i64 | "周周周" | -| Row 2 | "周 周周 周周周 周周周周" | "周+" | 14_i64 | 1_i64 | NULL | +| Row 0 | "周 周周 周周周 周周周周" | "周+" | 1 | 1 | "周" | +| Row 1 | "周 周周 周周周 周周周周" | "周+" | 2 | 2 | "周周周" | +| Row 2 | "周 周周 周周周 周周周周" | "周+" | 14 | 1 | NULL | +--------+---------------------------------------------------------+-----------------+----------+---------+-------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -927,7 +927,7 @@ error: --> SQL:1:1 | 1 | regexp_substr(source, pat, pos, occur, mt) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_substr: occurrence must be positive, but got 0 while evaluating function `regexp_substr("a b c", "b", 1_i64, 0_i64, "-c")` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Incorrect arguments to regexp_substr: occurrence must be positive, but got 0 while evaluating function `regexp_substr("a b c", "b", 1, 0, "-c")` diff --git a/src/query/functions/tests/it/scalars/testdata/string.txt b/src/query/functions/tests/it/scalars/testdata/string.txt index a1d1330a37613..5d2ce4a9df0ba 100644 --- a/src/query/functions/tests/it/scalars/testdata/string.txt +++ b/src/query/functions/tests/it/scalars/testdata/string.txt @@ -120,7 +120,7 @@ checked expr : bit_length("latin") optimized expr : 40_u64 output type : UInt64 output domain : {40..=40} -output : 40_u64 +output : 40 ast : bit_length(NULL) @@ -141,9 +141,9 @@ evaluation: +--------+-----------------------------------+----------------------------+ | Type | String | UInt64 | | Domain | {"latin"..="кириллица and latin"} | {0..=18446744073709551615} | -| Row 0 | "latin" | 40_u64 | -| Row 1 | "кириллица" | 144_u64 | -| Row 2 | "кириллица and latin" | 224_u64 | +| Row 0 | "latin" | 40 | +| Row 1 | "кириллица" | 144 | +| Row 2 | "кириллица and latin" | 224 | +--------+-----------------------------------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -160,7 +160,7 @@ checked expr : length("latin") optimized expr : 5_u64 output type : UInt64 output domain : {5..=5} -output : 5_u64 +output : 5 ast : octet_length(NULL) @@ -181,9 +181,9 @@ evaluation: +--------+-----------------------------------+----------------------------+ | Type | String | UInt64 | | Domain | {"latin"..="кириллица and latin"} | {0..=18446744073709551615} | -| Row 0 | "latin" | 5_u64 | -| Row 1 | "кириллица" | 18_u64 | -| Row 2 | "кириллица and latin" | 28_u64 | +| Row 0 | "latin" | 5 | +| Row 1 | "кириллица" | 18 | +| Row 2 | "кириллица and latin" | 28 | +--------+-----------------------------------+----------------------------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -200,7 +200,7 @@ checked expr : char_length("latin") optimized expr : 5_u64 output type : UInt64 output domain : {5..=5} -output : 5_u64 +output : 5 ast : char_length(NULL) @@ -221,9 +221,9 @@ evaluation: +--------+-----------------------------------+---------+ | Type | String | UInt64 | | Domain | {"latin"..="кириллица and latin"} | Unknown | -| Row 0 | "latin" | 5_u64 | -| Row 1 | "кириллица" | 9_u64 | -| Row 2 | "кириллица and latin" | 19_u64 | +| Row 0 | "latin" | 5 | +| Row 1 | "кириллица" | 9 | +| Row 2 | "кириллица and latin" | 19 | +--------+-----------------------------------+---------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -498,28 +498,28 @@ output : "" ast : reverse('你好') raw expr : reverse("你好") checked expr : reverse("你好") -optimized expr : "��堽�" +optimized expr : 0xbda5e5a0bde4 output type : String output domain : {"��堽�"..="��堽�"} -output : "��堽�" +output : 0xbda5e5a0bde4 ast : reverse('ß😀山') raw expr : reverse("ß😀山") checked expr : reverse("ß😀山") -optimized expr : "��倘���" +optimized expr : 0xb1b1e580989ff09fc3 output type : String output domain : {"��倘���"..="��倘���"} -output : "��倘���" +output : 0xb1b1e580989ff09fc3 ast : reverse('Dobrý den') raw expr : reverse("Dobrý den") checked expr : reverse("Dobrý den") -optimized expr : "ned ��rboD" +optimized expr : 0x6e656420bdc372626f44 output type : String output domain : {"ned ��rboD"..="ned ��rboD"} -output : "ned ��rboD" +output : 0x6e656420bdc372626f44 ast : reverse(Null) @@ -559,7 +559,7 @@ checked expr : ascii("1") optimized expr : 49_u8 output type : UInt8 output domain : {49..=49} -output : 49_u8 +output : 49 ast : ascii('123') @@ -568,7 +568,7 @@ checked expr : ascii("123") optimized expr : 49_u8 output type : UInt8 output domain : {49..=49} -output : 49_u8 +output : 49 ast : ascii('-1') @@ -577,7 +577,7 @@ checked expr : ascii("-1") optimized expr : 45_u8 output type : UInt8 output domain : {45..=45} -output : 45_u8 +output : 45 ast : ascii('') @@ -586,7 +586,7 @@ checked expr : ascii("") optimized expr : 0_u8 output type : UInt8 output domain : {0..=0} -output : 0_u8 +output : 0 ast : ascii('你好') @@ -595,7 +595,7 @@ checked expr : ascii("你好") optimized expr : 228_u8 output type : UInt8 output domain : {228..=228} -output : 228_u8 +output : 228 ast : ascii('😀123') @@ -604,7 +604,7 @@ checked expr : ascii("😀123") optimized expr : 240_u8 output type : UInt8 output domain : {240..=240} -output : 240_u8 +output : 240 ast : ascii(Null) @@ -625,10 +625,10 @@ evaluation: +--------+-----------------+------------+ | Type | String | UInt8 | | Domain | {"-1"..="你好"} | {45..=228} | -| Row 0 | "1" | 49_u8 | -| Row 1 | "123" | 49_u8 | -| Row 2 | "-1" | 45_u8 | -| Row 3 | "你好" | 228_u8 | +| Row 0 | "1" | 49 | +| Row 1 | "123" | 49 | +| Row 2 | "-1" | 45 | +| Row 3 | "你好" | 228 | +--------+-----------------+------------+ evaluation (internal): +--------+------------------------------------------------------------------------------+ @@ -649,7 +649,7 @@ evaluation: +--------+-----------+---------+ | Type | String | UInt8 | | Domain | {""..=""} | {0..=0} | -| Row 0 | "" | 0_u8 | +| Row 0 | "" | 0 | +--------+-----------+---------+ evaluation (internal): +--------+--------------------------------------------+ @@ -1777,9 +1777,9 @@ evaluation: +--------+----------+--------------------------------------------------------------------+ | Type | Int8 | String | | Domain | {-1..=3} | {""..} | -| Row 0 | -1_i8 | "1111111111111111111111111111111111111111111111111111111111111111" | -| Row 1 | 2_i8 | "10" | -| Row 2 | 3_i8 | "11" | +| Row 0 | -1 | "1111111111111111111111111111111111111111111111111111111111111111" | +| Row 1 | 2 | "10" | +| Row 2 | 3 | "11" | +--------+----------+--------------------------------------------------------------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -1799,8 +1799,8 @@ evaluation: +--------+------------------+-----------------+ | Type | UInt8 NULL | String NULL | | Domain | {1..=3} ∪ {NULL} | {""..} ∪ {NULL} | -| Row 0 | 1_u8 | "1" | -| Row 1 | 2_u8 | "10" | +| Row 0 | 1 | "1" | +| Row 1 | 2 | "10" | | Row 2 | NULL | NULL | +--------+------------------+-----------------+ evaluation (internal): @@ -1821,9 +1821,9 @@ evaluation: +--------+---------+--------+ | Type | Int16 | String | | Domain | {2..=6} | {""..} | -| Row 0 | 2_i16 | "10" | -| Row 1 | 4_i16 | "100" | -| Row 2 | 6_i16 | "110" | +| Row 0 | 2 | "10" | +| Row 1 | 4 | "100" | +| Row 2 | 6 | "110" | +--------+---------+--------+ evaluation (internal): +--------+------------------------------------------------------------------+ @@ -1843,9 +1843,9 @@ evaluation: +--------+-----------+---------+ | Type | UInt32 | String | | Domain | {10..=30} | {""..} | -| Row 0 | 10_u32 | "1010" | -| Row 1 | 20_u32 | "10100" | -| Row 2 | 30_u32 | "11110" | +| Row 0 | 10 | "1010" | +| Row 1 | 20 | "10100" | +| Row 2 | 30 | "11110" | +--------+-----------+---------+ evaluation (internal): +--------+-------------------------------------------------------------------------------+ @@ -1889,9 +1889,9 @@ evaluation: +--------+----------+--------------------------+ | Type | Int8 | String | | Domain | {-1..=3} | {""..} | -| Row 0 | -1_i8 | "1777777777777777777777" | -| Row 1 | 2_i8 | "2" | -| Row 2 | 3_i8 | "3" | +| Row 0 | -1 | "1777777777777777777777" | +| Row 1 | 2 | "2" | +| Row 2 | 3 | "3" | +--------+----------+--------------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------+ @@ -1911,8 +1911,8 @@ evaluation: +--------+------------------+-----------------+ | Type | UInt8 NULL | String NULL | | Domain | {1..=3} ∪ {NULL} | {""..} ∪ {NULL} | -| Row 0 | 1_u8 | "1" | -| Row 1 | 2_u8 | "2" | +| Row 0 | 1 | "1" | +| Row 1 | 2 | "2" | | Row 2 | NULL | NULL | +--------+------------------+-----------------+ evaluation (internal): @@ -1933,9 +1933,9 @@ evaluation: +--------+---------+--------+ | Type | Int16 | String | | Domain | {2..=6} | {""..} | -| Row 0 | 2_i16 | "2" | -| Row 1 | 4_i16 | "4" | -| Row 2 | 6_i16 | "6" | +| Row 0 | 2 | "2" | +| Row 1 | 4 | "4" | +| Row 2 | 6 | "6" | +--------+---------+--------+ evaluation (internal): +--------+--------------------------------------------------------+ @@ -1955,9 +1955,9 @@ evaluation: +--------+-----------+--------+ | Type | UInt32 | String | | Domain | {10..=30} | {""..} | -| Row 0 | 10_u32 | "12" | -| Row 1 | 20_u32 | "24" | -| Row 2 | 30_u32 | "36" | +| Row 0 | 10 | "12" | +| Row 1 | 20 | "24" | +| Row 2 | 30 | "36" | +--------+-----------+--------+ evaluation (internal): +--------+--------------------------------------------------------------+ @@ -2001,9 +2001,9 @@ evaluation: +--------+----------+--------------------+ | Type | Int8 | String | | Domain | {-1..=3} | {""..} | -| Row 0 | -1_i8 | "ffffffffffffffff" | -| Row 1 | 2_i8 | "2" | -| Row 2 | 3_i8 | "3" | +| Row 0 | -1 | "ffffffffffffffff" | +| Row 1 | 2 | "2" | +| Row 2 | 3 | "3" | +--------+----------+--------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------+ @@ -2023,8 +2023,8 @@ evaluation: +--------+------------------+-----------------+ | Type | UInt8 NULL | String NULL | | Domain | {1..=3} ∪ {NULL} | {""..} ∪ {NULL} | -| Row 0 | 1_u8 | "1" | -| Row 1 | 2_u8 | "2" | +| Row 0 | 1 | "1" | +| Row 1 | 2 | "2" | | Row 2 | NULL | NULL | +--------+------------------+-----------------+ evaluation (internal): @@ -2045,9 +2045,9 @@ evaluation: +--------+---------+--------+ | Type | Int16 | String | | Domain | {2..=6} | {""..} | -| Row 0 | 2_i16 | "2" | -| Row 1 | 4_i16 | "4" | -| Row 2 | 6_i16 | "6" | +| Row 0 | 2 | "2" | +| Row 1 | 4 | "4" | +| Row 2 | 6 | "6" | +--------+---------+--------+ evaluation (internal): +--------+--------------------------------------------------------+ @@ -2067,9 +2067,9 @@ evaluation: +--------+-----------+--------+ | Type | UInt32 | String | | Domain | {10..=30} | {""..} | -| Row 0 | 10_u32 | "a" | -| Row 1 | 20_u32 | "14" | -| Row 2 | 30_u32 | "1e" | +| Row 0 | 10 | "a" | +| Row 1 | 20 | "14" | +| Row 2 | 30 | "1e" | +--------+-----------+--------+ evaluation (internal): +--------+------------------------------------------------------------+ @@ -2226,9 +2226,9 @@ evaluation: +--------+-----------------+---------+-------------+---------+ | Type | String | UInt8 | String | String | | Domain | {"cc"..="test"} | {0..=5} | {"?"..="x"} | {""..} | -| Row 0 | "hi" | 0_u8 | "?" | "" | -| Row 1 | "test" | 3_u8 | "x" | "tes" | -| Row 2 | "cc" | 5_u8 | "bb" | "bbbcc" | +| Row 0 | "hi" | 0 | "?" | "" | +| Row 1 | "test" | 3 | "x" | "tes" | +| Row 2 | "cc" | 5 | "bb" | "bbbcc" | +--------+-----------------+---------+-------------+---------+ evaluation (internal): +--------+------------------------------------------------------------------+ @@ -2298,9 +2298,9 @@ evaluation: +--------+-----------------+---------+-------------+---------+ | Type | String | UInt8 | String | String | | Domain | {"cc"..="test"} | {0..=5} | {"?"..="x"} | {""..} | -| Row 0 | "hi" | 0_u8 | "?" | "" | -| Row 1 | "test" | 3_u8 | "x" | "tes" | -| Row 2 | "cc" | 5_u8 | "bb" | "ccbbb" | +| Row 0 | "hi" | 0 | "?" | "" | +| Row 1 | "test" | 3 | "x" | "tes" | +| Row 2 | "cc" | 5 | "bb" | "ccbbb" | +--------+-----------------+---------+-------------+---------+ evaluation (internal): +--------+------------------------------------------------------------------+ @@ -2380,7 +2380,7 @@ checked expr : strcmp("text", "text2") optimized expr : -1_i8 output type : Int8 output domain : {-1..=-1} -output : -1_i8 +output : -1 ast : strcmp('text2', 'text') @@ -2389,7 +2389,7 @@ checked expr : strcmp("text2", "text") optimized expr : 1_i8 output type : Int8 output domain : {1..=1} -output : 1_i8 +output : 1 ast : strcmp('hii', 'hii') @@ -2398,7 +2398,7 @@ checked expr : strcmp("hii", "hii") optimized expr : 0_i8 output type : Int8 output domain : {0..=0} -output : 0_i8 +output : 0 ast : strcmp(a, b) @@ -2410,9 +2410,9 @@ evaluation: +--------+-----------------+------------------+--------------+ | Type | String | String | Int8 | | Domain | {"cc"..="test"} | {"ccb"..="test"} | {-128..=127} | -| Row 0 | "hi" | "i" | 1_i8 | -| Row 1 | "test" | "test" | 0_i8 | -| Row 2 | "cc" | "ccb" | -1_i8 | +| Row 0 | "hi" | "i" | 1 | +| Row 1 | "test" | "test" | 0 | +| Row 2 | "cc" | "ccb" | -1 | +--------+-----------------+------------------+--------------+ evaluation (internal): +--------+------------------------------------------------------------------+ @@ -2430,7 +2430,7 @@ checked expr : locate("bar", "foobarbar") optimized expr : 4_u64 output type : UInt64 output domain : {4..=4} -output : 4_u64 +output : 4 ast : instr('foobarbar', 'bar') @@ -2439,7 +2439,7 @@ checked expr : instr("foobarbar", "bar") optimized expr : 4_u64 output type : UInt64 output domain : {4..=4} -output : 4_u64 +output : 4 ast : position('bar' IN 'foobarbar') @@ -2448,7 +2448,7 @@ checked expr : position("bar", "foobarbar") optimized expr : 4_u64 output type : UInt64 output domain : {4..=4} -output : 4_u64 +output : 4 ast : position('foobarbar' IN 'bar') @@ -2457,7 +2457,7 @@ checked expr : position("foobarbar", "bar") optimized expr : 0_u64 output type : UInt64 output domain : {0..=0} -output : 0_u64 +output : 0 ast : locate('bar', 'foobarbar', 5) @@ -2466,7 +2466,7 @@ checked expr : locate("bar", "foobarbar", to_uint64("и") optimized expr : 53432_u64 output type : UInt64 output domain : {53432..=53432} -output : 53432_u64 +output : 53432 ast : ord('早ab') @@ -2663,7 +2663,7 @@ checked expr : ord("早ab") optimized expr : 15112105_u64 output type : UInt64 output domain : {15112105..=15112105} -output : 15112105_u64 +output : 15112105 ast : ord('💖') @@ -2672,7 +2672,7 @@ checked expr : ord("💖") optimized expr : 4036989590_u64 output type : UInt64 output domain : {4036989590..=4036989590} -output : 4036989590_u64 +output : 4036989590 ast : repeat('3', NULL) @@ -2697,7 +2697,7 @@ error: --> SQL:1:1 | 1 | repeat('3', 1000001) - | ^^^^^^^^^^^^^^^^^^^^ Too many times to repeat: (1000001), maximum is: 1000000 while evaluating function `repeat("3", 1000001_u64)` + | ^^^^^^^^^^^^^^^^^^^^ Too many times to repeat: (1000001), maximum is: 1000000 while evaluating function `repeat("3", 1000001)` @@ -2812,10 +2812,10 @@ evaluation: +--------+-----------------+---------+---------+---------------+---------+ | Type | String | UInt8 | UInt8 | String | String | | Domain | {"cc"..="test"} | {1..=4} | {1..=5} | {"12"..="zc"} | {""..} | -| Row 0 | "hi" | 1_u8 | 3_u8 | "xx" | "xx" | -| Row 1 | "test" | 4_u8 | 5_u8 | "zc" | "teszc" | -| Row 2 | "cc" | 1_u8 | 1_u8 | "12" | "12c" | -| Row 3 | "q" | 1_u8 | 1_u8 | "56" | "56" | +| Row 0 | "hi" | 1 | 3 | "xx" | "xx" | +| Row 1 | "test" | 4 | 5 | "zc" | "teszc" | +| Row 2 | "cc" | 1 | 1 | "12" | "12c" | +| Row 3 | "q" | 1 | 1 | "56" | "56" | +--------+-----------------+---------+---------+---------------+---------+ evaluation (internal): +--------+-------------------------------------------------------------------------------+ @@ -2838,10 +2838,10 @@ evaluation: +--------+--------------------------+------------------+------------------+------------------------+-----------------+ | Type | String NULL | UInt8 NULL | UInt8 NULL | String NULL | String NULL | | Domain | {"cc"..="test"} ∪ {NULL} | {1..=4} ∪ {NULL} | {1..=5} ∪ {NULL} | {"12"..="zc"} ∪ {NULL} | {""..} ∪ {NULL} | -| Row 0 | NULL | 1_u8 | 3_u8 | NULL | NULL | -| Row 1 | "test" | 4_u8 | NULL | "zc" | NULL | -| Row 2 | "cc" | NULL | 1_u8 | "12" | NULL | -| Row 3 | "q" | 1_u8 | 1_u8 | "56" | "56" | +| Row 0 | NULL | 1 | 3 | NULL | NULL | +| Row 1 | "test" | 4 | NULL | "zc" | NULL | +| Row 2 | "cc" | NULL | 1 | "12" | NULL | +| Row 3 | "q" | 1 | 1 | "56" | "56" | +--------+--------------------------+------------------+------------------+------------------------+-----------------+ evaluation (internal): +--------+----------------------------------------------------------------------------------------------------------------------------------+ @@ -2882,16 +2882,16 @@ evaluation: +--------+---------+--------------------+ | Type | UInt8 | String | | Domain | {0..=9} | {""..=" "} | -| Row 0 | 0_u8 | "" | -| Row 1 | 1_u8 | " " | -| Row 2 | 2_u8 | " " | -| Row 3 | 3_u8 | " " | -| Row 4 | 4_u8 | " " | -| Row 5 | 5_u8 | " " | -| Row 6 | 6_u8 | " " | -| Row 7 | 7_u8 | " " | -| Row 8 | 8_u8 | " " | -| Row 9 | 9_u8 | " " | +| Row 0 | 0 | "" | +| Row 1 | 1 | " " | +| Row 2 | 2 | " " | +| Row 3 | 3 | " " | +| Row 4 | 4 | " " | +| Row 5 | 5 | " " | +| Row 6 | 6 | " " | +| Row 7 | 7 | " " | +| Row 8 | 8 | " " | +| Row 9 | 9 | " " | +--------+---------+--------------------+ evaluation (internal): +--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2929,17 +2929,17 @@ evaluation: +--------+----------+-------------+ | Type | UInt8 | String | | Domain | {0..=10} | {""..} | -| Row 0 | 0_u8 | "" | -| Row 1 | 1_u8 | "1" | -| Row 2 | 2_u8 | "12" | -| Row 3 | 3_u8 | "123" | -| Row 4 | 4_u8 | "1234" | -| Row 5 | 5_u8 | "12345" | -| Row 6 | 6_u8 | "123456" | -| Row 7 | 7_u8 | "1234567" | -| Row 8 | 8_u8 | "12345678" | -| Row 9 | 9_u8 | "123456789" | -| Row 10 | 10_u8 | "123456789" | +| Row 0 | 0 | "" | +| Row 1 | 1 | "1" | +| Row 2 | 2 | "12" | +| Row 3 | 3 | "123" | +| Row 4 | 4 | "1234" | +| Row 5 | 5 | "12345" | +| Row 6 | 6 | "123456" | +| Row 7 | 7 | "1234567" | +| Row 8 | 8 | "12345678" | +| Row 9 | 9 | "123456789" | +| Row 10 | 10 | "123456789" | +--------+----------+-------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -2977,17 +2977,17 @@ evaluation: +--------+----------+-------------+ | Type | UInt8 | String | | Domain | {0..=10} | {""..} | -| Row 0 | 0_u8 | "" | -| Row 1 | 1_u8 | "9" | -| Row 2 | 2_u8 | "89" | -| Row 3 | 3_u8 | "789" | -| Row 4 | 4_u8 | "6789" | -| Row 5 | 5_u8 | "56789" | -| Row 6 | 6_u8 | "456789" | -| Row 7 | 7_u8 | "3456789" | -| Row 8 | 8_u8 | "23456789" | -| Row 9 | 9_u8 | "123456789" | -| Row 10 | 10_u8 | "123456789" | +| Row 0 | 0 | "" | +| Row 1 | 1 | "9" | +| Row 2 | 2 | "89" | +| Row 3 | 3 | "789" | +| Row 4 | 4 | "6789" | +| Row 5 | 5 | "56789" | +| Row 6 | 6 | "456789" | +| Row 7 | 7 | "3456789" | +| Row 8 | 8 | "23456789" | +| Row 9 | 9 | "123456789" | +| Row 10 | 10 | "123456789" | +--------+----------+-------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -3061,51 +3061,51 @@ evaluation: +--------+----------+---------+--------+ | Type | Int8 | UInt8 | String | | Domain | {-4..=4} | {0..=4} | {""..} | -| Row 0 | 0_i8 | 0_u8 | "" | -| Row 1 | 0_i8 | 1_u8 | "" | -| Row 2 | 0_i8 | 2_u8 | "" | -| Row 3 | 0_i8 | 3_u8 | "" | -| Row 4 | 0_i8 | 4_u8 | "" | -| Row 5 | 1_i8 | 0_u8 | "" | -| Row 6 | 1_i8 | 1_u8 | "a" | -| Row 7 | 1_i8 | 2_u8 | "ab" | -| Row 8 | 1_i8 | 3_u8 | "abc" | -| Row 9 | 1_i8 | 4_u8 | "abc" | -| Row 10 | 2_i8 | 0_u8 | "" | -| Row 11 | 2_i8 | 1_u8 | "b" | -| Row 12 | 2_i8 | 2_u8 | "bc" | -| Row 13 | 2_i8 | 3_u8 | "bc" | -| Row 14 | 2_i8 | 4_u8 | "bc" | -| Row 15 | 3_i8 | 0_u8 | "" | -| Row 16 | 3_i8 | 1_u8 | "c" | -| Row 17 | 3_i8 | 2_u8 | "c" | -| Row 18 | 3_i8 | 3_u8 | "c" | -| Row 19 | 3_i8 | 4_u8 | "c" | -| Row 20 | 4_i8 | 0_u8 | "" | -| Row 21 | 4_i8 | 1_u8 | "" | -| Row 22 | 4_i8 | 2_u8 | "" | -| Row 23 | 4_i8 | 3_u8 | "" | -| Row 24 | 4_i8 | 4_u8 | "" | -| Row 25 | -1_i8 | 0_u8 | "" | -| Row 26 | -1_i8 | 1_u8 | "c" | -| Row 27 | -1_i8 | 2_u8 | "c" | -| Row 28 | -1_i8 | 3_u8 | "c" | -| Row 29 | -1_i8 | 4_u8 | "c" | -| Row 30 | -2_i8 | 0_u8 | "" | -| Row 31 | -2_i8 | 1_u8 | "b" | -| Row 32 | -2_i8 | 2_u8 | "bc" | -| Row 33 | -2_i8 | 3_u8 | "bc" | -| Row 34 | -2_i8 | 4_u8 | "bc" | -| Row 35 | -3_i8 | 0_u8 | "" | -| Row 36 | -3_i8 | 1_u8 | "a" | -| Row 37 | -3_i8 | 2_u8 | "ab" | -| Row 38 | -3_i8 | 3_u8 | "abc" | -| Row 39 | -3_i8 | 4_u8 | "abc" | -| Row 40 | -4_i8 | 0_u8 | "" | -| Row 41 | -4_i8 | 1_u8 | "" | -| Row 42 | -4_i8 | 2_u8 | "" | -| Row 43 | -4_i8 | 3_u8 | "" | -| Row 44 | -4_i8 | 4_u8 | "" | +| Row 0 | 0 | 0 | "" | +| Row 1 | 0 | 1 | "" | +| Row 2 | 0 | 2 | "" | +| Row 3 | 0 | 3 | "" | +| Row 4 | 0 | 4 | "" | +| Row 5 | 1 | 0 | "" | +| Row 6 | 1 | 1 | "a" | +| Row 7 | 1 | 2 | "ab" | +| Row 8 | 1 | 3 | "abc" | +| Row 9 | 1 | 4 | "abc" | +| Row 10 | 2 | 0 | "" | +| Row 11 | 2 | 1 | "b" | +| Row 12 | 2 | 2 | "bc" | +| Row 13 | 2 | 3 | "bc" | +| Row 14 | 2 | 4 | "bc" | +| Row 15 | 3 | 0 | "" | +| Row 16 | 3 | 1 | "c" | +| Row 17 | 3 | 2 | "c" | +| Row 18 | 3 | 3 | "c" | +| Row 19 | 3 | 4 | "c" | +| Row 20 | 4 | 0 | "" | +| Row 21 | 4 | 1 | "" | +| Row 22 | 4 | 2 | "" | +| Row 23 | 4 | 3 | "" | +| Row 24 | 4 | 4 | "" | +| Row 25 | -1 | 0 | "" | +| Row 26 | -1 | 1 | "c" | +| Row 27 | -1 | 2 | "c" | +| Row 28 | -1 | 3 | "c" | +| Row 29 | -1 | 4 | "c" | +| Row 30 | -2 | 0 | "" | +| Row 31 | -2 | 1 | "b" | +| Row 32 | -2 | 2 | "bc" | +| Row 33 | -2 | 3 | "bc" | +| Row 34 | -2 | 4 | "bc" | +| Row 35 | -3 | 0 | "" | +| Row 36 | -3 | 1 | "a" | +| Row 37 | -3 | 2 | "ab" | +| Row 38 | -3 | 3 | "abc" | +| Row 39 | -3 | 4 | "abc" | +| Row 40 | -4 | 0 | "" | +| Row 41 | -4 | 1 | "" | +| Row 42 | -4 | 2 | "" | +| Row 43 | -4 | 3 | "" | +| Row 44 | -4 | 4 | "" | +--------+----------+---------+--------+ evaluation (internal): +--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ diff --git a/src/query/functions/tests/it/scalars/testdata/tuple.txt b/src/query/functions/tests/it/scalars/testdata/tuple.txt index 369ed3ee73121..1dd4b7b05f7ea 100644 --- a/src/query/functions/tests/it/scalars/testdata/tuple.txt +++ b/src/query/functions/tests/it/scalars/testdata/tuple.txt @@ -22,7 +22,7 @@ checked expr : tuple(1_u8, 2_u8, "a") optimized expr : (1_u8, 2_u8, "a") output type : Tuple(UInt8, UInt8, String) output domain : ({1..=1}, {2..=2}, {"a"..="a"}) -output : (1_u8, 2_u8, "a") +output : (1, 2, "a") ast : (1, 2, ('a', 'b')) @@ -31,7 +31,7 @@ checked expr : tuple(1_u8, 2_u8, tuple(tuple(1_u8, "a")) optimized expr : 1_u8 output type : UInt8 output domain : {1..=1} -output : 1_u8 +output : 1 ast : (1, 'a').2 diff --git a/src/query/functions/tests/it/scalars/testdata/variant.txt b/src/query/functions/tests/it/scalars/testdata/variant.txt index ae98038816612..6df9dd56b9ca6 100644 --- a/src/query/functions/tests/it/scalars/testdata/variant.txt +++ b/src/query/functions/tests/it/scalars/testdata/variant.txt @@ -359,7 +359,7 @@ checked expr : length(CAST(parse_json("[1,2,3,4]") AS Va optimized expr : 4_u32 output type : UInt32 NULL output domain : {4..=4} -output : 4_u32 +output : 4 ast : length(parse_json('{"k":"v"}')) @@ -381,8 +381,8 @@ evaluation: | Type | String | UInt32 NULL | | Domain | {"[\"a\",\"b\",\"c\"]"..="true"} | Unknown | | Row 0 | "true" | NULL | -| Row 1 | "[1,2,3,4]" | 4_u32 | -| Row 2 | "[\"a\",\"b\",\"c\"]" | 3_u32 | +| Row 1 | "[1,2,3,4]" | 4 | +| Row 2 | "[\"a\",\"b\",\"c\"]" | 3 | +--------+----------------------------------+-------------+ evaluation (internal): +--------+--------------------------------------------------------------------------------------------------------+ @@ -403,9 +403,9 @@ evaluation: | Type | String NULL | UInt32 NULL | | Domain | {""..="true"} ∪ {NULL} | Unknown | | Row 0 | "true" | NULL | -| Row 1 | "[1,2,3,4]" | 4_u32 | +| Row 1 | "[1,2,3,4]" | 4 | | Row 2 | NULL | NULL | -| Row 3 | "[\"a\",\"b\",\"c\"]" | 3_u32 | +| Row 3 | "[\"a\",\"b\",\"c\"]" | 3 | +--------+------------------------+-------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -551,9 +551,9 @@ evaluation: +--------+----------------------------------+---------+--------------+ | Type | String | UInt64 | Variant NULL | | Domain | {"[\"a\",\"b\",\"c\"]"..="true"} | {0..=1} | Unknown | -| Row 0 | "true" | 0_u64 | NULL | -| Row 1 | "[1,2,3,4]" | 0_u64 | 1 | -| Row 2 | "[\"a\",\"b\",\"c\"]" | 1_u64 | "b" | +| Row 0 | "true" | 0 | NULL | +| Row 1 | "[1,2,3,4]" | 0 | 1 | +| Row 2 | "[\"a\",\"b\",\"c\"]" | 1 | "b" | +--------+----------------------------------+---------+--------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------+ @@ -575,9 +575,9 @@ evaluation: | Type | String NULL | UInt64 NULL | Variant NULL | | Domain | {""..="true"} ∪ {NULL} | {0..=2} ∪ {NULL} | Unknown | | Row 0 | "true" | NULL | NULL | -| Row 1 | "[1,2,3,4]" | 2_u64 | 3 | +| Row 1 | "[1,2,3,4]" | 2 | 3 | | Row 2 | NULL | NULL | NULL | -| Row 3 | "[\"a\",\"b\",\"c\"]" | 1_u64 | "b" | +| Row 3 | "[\"a\",\"b\",\"c\"]" | 1 | "b" | +--------+------------------------+------------------+--------------+ evaluation (internal): +--------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ @@ -981,7 +981,7 @@ checked expr : as_integer(parse_json("123")) optimized expr : 123_i64 output type : Int64 NULL output domain : {123..=123} -output : 123_i64 +output : 123 ast : as_float(parse_json('"ab"')) @@ -999,7 +999,7 @@ checked expr : as_float(parse_json("12.34")) optimized expr : 12.34_f64 output type : Float64 NULL output domain : {12.34..=12.34} -output : 12.34_f64 +output : 12.34 ast : as_string(parse_json('"ab"')) @@ -1116,7 +1116,7 @@ evaluation: | Type | String | Int64 NULL | | Domain | {"\"ab\""..="{\"a\":\"b\"}"} | Unknown | | Row 0 | "true" | NULL | -| Row 1 | "123" | 123_i64 | +| Row 1 | "123" | 123 | | Row 2 | "12.34" | NULL | | Row 3 | "\"ab\"" | NULL | | Row 4 | "[1,2,3]" | NULL | @@ -1141,7 +1141,7 @@ evaluation: | Type | String | Int64 NULL | | Domain | {"\"ab\""..="{\"a\":\"b\"}"} | {-9223372036854775808..=9223372036854775807} ∪ {NULL} | | Row 0 | "true" | NULL | -| Row 1 | "123" | 123_i64 | +| Row 1 | "123" | 123 | | Row 2 | "12.34" | NULL | | Row 3 | "\"ab\"" | NULL | | Row 4 | "[1,2,3]" | NULL | @@ -1166,8 +1166,8 @@ evaluation: | Type | String | Float64 NULL | | Domain | {"\"ab\""..="{\"a\":\"b\"}"} | Unknown | | Row 0 | "true" | NULL | -| Row 1 | "123" | 123_f64 | -| Row 2 | "12.34" | 12.34_f64 | +| Row 1 | "123" | 123 | +| Row 2 | "12.34" | 12.34 | | Row 3 | "\"ab\"" | NULL | | Row 4 | "[1,2,3]" | NULL | | Row 5 | "{\"a\":\"b\"}" | NULL | @@ -1191,8 +1191,8 @@ evaluation: | Type | String | Float64 NULL | | Domain | {"\"ab\""..="{\"a\":\"b\"}"} | {-inf..=NaN} ∪ {NULL} | | Row 0 | "true" | NULL | -| Row 1 | "123" | 123_f64 | -| Row 2 | "12.34" | 12.34_f64 | +| Row 1 | "123" | 123 | +| Row 2 | "12.34" | 12.34 | | Row 3 | "\"ab\"" | NULL | | Row 4 | "[1,2,3]" | NULL | | Row 5 | "{\"a\":\"b\"}" | NULL | diff --git a/src/query/service/tests/it/storages/fuse/operations/commit.rs b/src/query/service/tests/it/storages/fuse/operations/commit.rs index 18d173dc8b165..e974900717294 100644 --- a/src/query/service/tests/it/storages/fuse/operations/commit.rs +++ b/src/query/service/tests/it/storages/fuse/operations/commit.rs @@ -127,12 +127,12 @@ async fn test_fuse_occ_retry() -> Result<()> { .await?; let expected = vec![ - "+----------+------------------+", - "| Column 0 | Column 1 |", - "+----------+------------------+", - "| 1_i32 | (2_i32, 3_i32) |", - "| 5_i32 | (10_i32, 15_i32) |", - "+----------+------------------+", + "+----------+----------+", + "| Column 0 | Column 1 |", + "+----------+----------+", + "| 1 | (2, 3) |", + "| 5 | (10, 15) |", + "+----------+----------+", ]; common_expression::block_debug::assert_blocks_sorted_eq(expected, blocks.as_slice()); diff --git a/src/query/service/tests/it/storages/fuse/operations/mutation/block_compact_mutator.rs b/src/query/service/tests/it/storages/fuse/operations/mutation/block_compact_mutator.rs index 13d0bd787f0a4..4421b5a7269b2 100644 --- a/src/query/service/tests/it/storages/fuse/operations/mutation/block_compact_mutator.rs +++ b/src/query/service/tests/it/storages/fuse/operations/mutation/block_compact_mutator.rs @@ -71,7 +71,7 @@ async fn test_compact() -> Result<()> { "+----------+----------+", "| Column 0 | Column 1 |", "+----------+----------+", - "| 1_u64 | 1_u64 |", + "| 1 | 1 |", "+----------+----------+", ]; let qry = format!( diff --git a/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs b/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs index dae1d5e8f497d..369ca9109c99b 100644 --- a/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs +++ b/src/query/service/tests/it/storages/fuse/operations/mutation/deletion.rs @@ -63,7 +63,7 @@ async fn test_deletion_mutator_multiple_empty_segments() -> Result<()> { "+----------+----------+", "| Column 0 | Column 1 |", "+----------+----------+", - "| 9_u64 | 9_u64 |", + "| 9 | 9 |", "+----------+----------+", ]; let qry = format!( diff --git a/src/query/service/tests/it/storages/fuse/table.rs b/src/query/service/tests/it/storages/fuse/table.rs index e0f51fa6c1e2d..9919413ace4aa 100644 --- a/src/query/service/tests/it/storages/fuse/table.rs +++ b/src/query/service/tests/it/storages/fuse/table.rs @@ -80,14 +80,14 @@ async fn test_fuse_table_normal_case() -> Result<()> { // - value_start_from = 1 // thus let expected = vec![ - "+----------+----------------+", - "| Column 0 | Column 1 |", - "+----------+----------------+", - "| 1_i32 | (2_i32, 3_i32) |", - "| 1_i32 | (2_i32, 3_i32) |", - "| 2_i32 | (4_i32, 6_i32) |", - "| 2_i32 | (4_i32, 6_i32) |", - "+----------+----------------+", + "+----------+----------+", + "| Column 0 | Column 1 |", + "+----------+----------+", + "| 1 | (2, 3) |", + "| 1 | (2, 3) |", + "| 2 | (4, 6) |", + "| 2 | (4, 6) |", + "+----------+----------+", ]; common_expression::block_debug::assert_blocks_sorted_eq(expected, blocks.as_slice()); } @@ -136,14 +136,14 @@ async fn test_fuse_table_normal_case() -> Result<()> { // two block, two rows for each block, value starts with 2 let expected = vec![ - "+----------+----------------+", - "| Column 0 | Column 1 |", - "+----------+----------------+", - "| 2_i32 | (4_i32, 6_i32) |", - "| 2_i32 | (4_i32, 6_i32) |", - "| 3_i32 | (6_i32, 9_i32) |", - "| 3_i32 | (6_i32, 9_i32) |", - "+----------+----------------+", + "+----------+----------+", + "| Column 0 | Column 1 |", + "+----------+----------+", + "| 2 | (4, 6) |", + "| 2 | (4, 6) |", + "| 3 | (6, 9) |", + "| 3 | (6, 9) |", + "+----------+----------+", ]; common_expression::block_debug::assert_blocks_sorted_eq(expected, blocks.as_slice()); } diff --git a/src/query/service/tests/it/storages/fuse/table_functions/clustering_information_table.rs b/src/query/service/tests/it/storages/fuse/table_functions/clustering_information_table.rs index 50486388f8512..2eae19a75cc58 100644 --- a/src/query/service/tests/it/storages/fuse/table_functions/clustering_information_table.rs +++ b/src/query/service/tests/it/storages/fuse/table_functions/clustering_information_table.rs @@ -50,7 +50,7 @@ async fn test_clustering_information_table_read() -> Result<()> { "+----------+----------+----------+----------+----------+----------+", "| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |", "+----------+----------+----------+----------+----------+----------+", - "| \"(id)\" | 0_u64 | 0_u64 | 0_f64 | 0_f64 | {} |", + "| \"(id)\" | 0 | 0 | 0 | 0 | {} |", "+----------+----------+----------+----------+----------+----------+", ]; @@ -73,7 +73,7 @@ async fn test_clustering_information_table_read() -> Result<()> { "+----------+----------+----------+----------+----------+-------------+", "| Column 0 | Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |", "+----------+----------+----------+----------+----------+-------------+", - "| \"(id)\" | 1_u64 | 0_u64 | 0_f64 | 1_f64 | {\"00001\":1} |", + "| \"(id)\" | 1 | 0 | 0 | 1 | {\"00001\":1} |", "+----------+----------+----------+----------+----------+-------------+", ]; diff --git a/src/query/service/tests/it/storages/fuse/table_functions/fuse_block_table.rs b/src/query/service/tests/it/storages/fuse/table_functions/fuse_block_table.rs index 7561128f4cc59..65619a2846bad 100644 --- a/src/query/service/tests/it/storages/fuse/table_functions/fuse_block_table.rs +++ b/src/query/service/tests/it/storages/fuse/table_functions/fuse_block_table.rs @@ -35,7 +35,7 @@ async fn test_fuse_block_table() -> Result<()> { "+----------+", "| Column 0 |", "+----------+", - "| 0_u64 |", + "| 0 |", "+----------+", ]; let qry = format!( @@ -60,7 +60,7 @@ async fn test_fuse_block_table() -> Result<()> { "+----------+", "| Column 0 |", "+----------+", - "| 2_u64 |", + "| 2 |", "+----------+", ]; diff --git a/src/query/service/tests/it/storages/fuse/table_test_fixture.rs b/src/query/service/tests/it/storages/fuse/table_test_fixture.rs index aae88ea5e4172..e3c624e80534a 100644 --- a/src/query/service/tests/it/storages/fuse/table_test_fixture.rs +++ b/src/query/service/tests/it/storages/fuse/table_test_fixture.rs @@ -546,7 +546,7 @@ pub async fn history_should_have_item( // check history let db = fixture.default_db_name(); let tbl = fixture.default_table_name(); - let count_str = format!("| {}_u64 |", item_cnt); + let count_str = format!("| {} |", item_cnt); let expected = vec![ "+----------+", "| Column 0 |", diff --git a/src/query/service/tests/it/storages/testdata/roles_table.txt b/src/query/service/tests/it/storages/testdata/roles_table.txt index 8f413bab31b60..610ab6f022995 100644 --- a/src/query/service/tests/it/storages/testdata/roles_table.txt +++ b/src/query/service/tests/it/storages/testdata/roles_table.txt @@ -4,8 +4,8 @@ DB.Table: 'system'.'roles', Table: roles-table_id:1, ver:0, Engine: SystemRoles +----------+----------+ | Column 0 | Column 1 | +----------+----------+ -| "test" | 0_u64 | -| "test1" | 1_u64 | +| "test" | 0 | +| "test1" | 1 | +----------+----------+ diff --git a/src/query/service/tests/it/table_functions/numbers_table.rs b/src/query/service/tests/it/table_functions/numbers_table.rs index 711eb886a3987..42b35ad78d3ea 100644 --- a/src/query/service/tests/it/table_functions/numbers_table.rs +++ b/src/query/service/tests/it/table_functions/numbers_table.rs @@ -50,14 +50,14 @@ async fn test_number_table() -> Result<()> { "+----------+", "| Column 0 |", "+----------+", - "| 0_u64 |", - "| 1_u64 |", - "| 2_u64 |", - "| 3_u64 |", - "| 4_u64 |", - "| 5_u64 |", - "| 6_u64 |", - "| 7_u64 |", + "| 0 |", + "| 1 |", + "| 2 |", + "| 3 |", + "| 4 |", + "| 5 |", + "| 6 |", + "| 7 |", "+----------+", ]; common_expression::block_debug::assert_blocks_sorted_eq(expected, result.as_slice()); diff --git a/tests/sqllogictests/suites/base/20+_others/20_0000_describe_table b/tests/sqllogictests/suites/base/20+_others/20_0000_describe_table index 6f7bdc5172dbf..34007e24e7c04 100644 --- a/tests/sqllogictests/suites/base/20+_others/20_0000_describe_table +++ b/tests/sqllogictests/suites/base/20+_others/20_0000_describe_table @@ -54,17 +54,17 @@ f VARCHAR NO '' (empty) query TTTTT DESC INFORMATION_SCHEMA.COLUMNS ---- -table_catalog VARCHAR NO (empty) (empty) -table_schema VARCHAR NO (empty) (empty) -table_name VARCHAR NO (empty) (empty) -column_name VARCHAR NO (empty) (empty) +table_catalog VARCHAR NO "" (empty) +table_schema VARCHAR NO "" (empty) +table_name VARCHAR NO "" (empty) +column_name VARCHAR NO "" (empty) ordinal_position TINYINT UNSIGNED NO 0 (empty) column_default NULL NO NULL (empty) column_comment NULL NO NULL (empty) column_key NULL NO NULL (empty) -is_nullable VARCHAR NO (empty) (empty) -data_type VARCHAR NO (empty) (empty) -column_type VARCHAR NO (empty) (empty) +is_nullable VARCHAR NO "" (empty) +data_type VARCHAR NO "" (empty) +column_type VARCHAR NO "" (empty) character_maximum_length NULL NO NULL (empty) character_octet_length NULL NO NULL (empty) numeric_precision NULL NO NULL (empty) @@ -87,4 +87,3 @@ DROP TABLE IF EXISTS t statement ok DROP TABLE IF EXISTS t1 - diff --git a/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test b/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test index 190d5ab40c2eb..3acc700607ef3 100644 --- a/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test +++ b/tests/sqllogictests/suites/mode/cluster/04_0002_explain_v2.test @@ -16,7 +16,7 @@ explain select t1.a from t1 where a > 0; Exchange ├── exchange type: Merge └── Filter - ├── filters: [gt(t1.a (#0), to_int32(0_u8))] + ├── filters: [gt(t1.a (#0), to_int32(0))] ├── estimated rows: 0.00 └── TableScan ├── table: default.default.t1 @@ -24,7 +24,7 @@ Exchange ├── read bytes: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [gt(t1.a (#0), 0_i32)], limit: NONE] + ├── push downs: [filters: [gt(t1.a (#0), 0)], limit: NONE] ├── output columns: [0] └── estimated rows: 0.00 @@ -34,7 +34,7 @@ explain select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a an Exchange ├── exchange type: Merge └── Filter - ├── filters: [or(gt(t1.a (#0), to_int32(3_u8)), and(gt(t2.a (#2), to_int32(5_u8)), gt(t1.a (#0), to_int32(1_u8))))] + ├── filters: [or(gt(t1.a (#0), to_int32(3)), and(gt(t2.a (#2), to_int32(5)), gt(t1.a (#0), to_int32(1))))] ├── estimated rows: 0.00 └── HashJoin ├── join type: INNER @@ -55,7 +55,7 @@ Exchange └── Exchange(Probe) ├── exchange type: Hash(t1.a (#0)) └── Filter - ├── filters: [or(gt(t1.a (#0), to_int32(3_u8)), gt(t1.a (#0), to_int32(1_u8)))] + ├── filters: [or(gt(t1.a (#0), to_int32(3)), gt(t1.a (#0), to_int32(1)))] ├── estimated rows: 0.00 └── TableScan ├── table: default.default.t1 @@ -63,7 +63,7 @@ Exchange ├── read bytes: 0 ├── partitions total: 0 ├── partitions scanned: 0 - ├── push downs: [filters: [or(gt(t1.a (#0), 3_i32), gt(t1.a (#0), 1_i32))], limit: NONE] + ├── push downs: [filters: [or(gt(t1.a (#0), 3), gt(t1.a (#0), 1))], limit: NONE] └── estimated rows: 0.00 query T @@ -188,7 +188,7 @@ Limit ├── sort keys: [c ASC NULLS LAST, d ASC NULLS LAST, e ASC NULLS LAST] ├── estimated rows: 0.00 └── EvalScalar - ├── expressions: [plus(t1.a (#0), 1_u8), plus(t1.b (#1), 1_u8), plus(t2.a (#2), 1_u8)] + ├── expressions: [plus(t1.a (#0), 1), plus(t1.b (#1), 1), plus(t2.a (#2), 1)] ├── estimated rows: 0.00 └── HashJoin ├── join type: INNER diff --git a/tests/sqllogictests/suites/mode/cluster/exchange.test b/tests/sqllogictests/suites/mode/cluster/exchange.test index 49d5d7828d9ef..82f1373d474a9 100644 --- a/tests/sqllogictests/suites/mode/cluster/exchange.test +++ b/tests/sqllogictests/suites/mode/cluster/exchange.test @@ -112,7 +112,7 @@ Exchange ├── Exchange(Build) │ ├── exchange type: Hash(t.b (#1)) │ └── EvalScalar - │ ├── expressions: [plus(numbers.number (#0), 1_u8)] + │ ├── expressions: [plus(numbers.number (#0), 1)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.system.numbers diff --git a/tests/sqllogictests/suites/mode/standalone/explain/aggregate.test b/tests/sqllogictests/suites/mode/standalone/explain/aggregate.test index 58944cc11220f..d4d352b4c10d9 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/aggregate.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/aggregate.test @@ -44,7 +44,7 @@ query T explain select 1 from numbers(10) group by 1; ---- EvalScalar -├── expressions: [1_u8] +├── expressions: [1] ├── estimated rows: 10.00 └── TableScan ├── table: default.system.numbers @@ -61,7 +61,7 @@ query T explain select 1, number, number + 1, number -1 from numbers(10) group by number, abs(number), cast(number as int); ---- EvalScalar -├── expressions: [1_u8, plus(group_item (#0), 1_u8), minus(group_item (#0), 1_u8)] +├── expressions: [1, plus(group_item (#0), 1), minus(group_item (#0), 1)] ├── estimated rows: 10.00 └── AggregateFinal ├── group by: [number] diff --git a/tests/sqllogictests/suites/mode/standalone/explain/bloom_filter.test b/tests/sqllogictests/suites/mode/standalone/explain/bloom_filter.test index 7add1d7b6800a..1f76cf79724ca 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/bloom_filter.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/bloom_filter.test @@ -14,18 +14,18 @@ insert into bloom_test_t values(1,1), (7,8), (10,10) query T explain select * from bloom_test_t where c1 = 5 ---- - Filter - ├── filters: [eq(bloom_test_t.c1 (#0), to_int32(5_u8))] - ├── estimated rows: 1.20 - └── TableScan - ├── table: default.default.bloom_test_t - ├── read rows: 3 - ├── read bytes: 86 - ├── partitions total: 2 - ├── partitions scanned: 1 - ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [eq(bloom_test_t.c1 (#0), 5_i32)], limit: NONE] - └── estimated rows: 6.00 +Filter +├── filters: [eq(bloom_test_t.c1 (#0), to_int32(5))] +├── estimated rows: 1.20 +└── TableScan + ├── table: default.default.bloom_test_t + ├── read rows: 3 + ├── read bytes: 86 + ├── partitions total: 2 + ├── partitions scanned: 1 + ├── pruning stats: [segments: , blocks: ] + ├── push downs: [filters: [eq(bloom_test_t.c1 (#0), 5)], limit: NONE] + └── estimated rows: 6.00 query T select * from bloom_test_t where c1 = 5 @@ -80,4 +80,3 @@ select count(*) from bloom_test_t where c1 = 5 statement ok drop table bloom_test_t - diff --git a/tests/sqllogictests/suites/mode/standalone/explain/explain.test b/tests/sqllogictests/suites/mode/standalone/explain/explain.test index 9b0caad60510c..8e6162dfccd8c 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/explain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/explain.test @@ -14,7 +14,7 @@ query T explain select t1.a from t1 where a > 0 ---- Filter -├── filters: [gt(t1.a (#0), to_uint64(0_u8))] +├── filters: [gt(t1.a (#0), to_uint64(0))] ├── estimated rows: 0.33 └── TableScan ├── table: default.default.t1 @@ -23,7 +23,7 @@ Filter ├── partitions total: 1 ├── partitions scanned: 0 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [gt(t1.a (#0), 0_u64)], limit: NONE] + ├── push downs: [filters: [gt(t1.a (#0), 0)], limit: NONE] ├── output columns: [0] └── estimated rows: 1.00 @@ -31,7 +31,7 @@ query T explain select * from t1, t2 where (t1.a = t2.a and t1.a > 3) or (t1.a = t2.a and t2.a > 5 and t1.a > 1) ---- Filter -├── filters: [or(gt(t1.a (#0), to_uint64(3_u8)), and(gt(t2.a (#2), to_uint64(5_u8)), gt(t1.a (#0), to_uint64(1_u8))))] +├── filters: [or(gt(t1.a (#0), to_uint64(3)), and(gt(t2.a (#2), to_uint64(5)), gt(t1.a (#0), to_uint64(1))))] ├── estimated rows: 0.19 └── HashJoin ├── join type: INNER @@ -40,7 +40,7 @@ Filter ├── filters: [] ├── estimated rows: 0.56 ├── Filter(Build) - │ ├── filters: [or(gt(t1.a (#0), to_uint64(3_u8)), gt(t1.a (#0), to_uint64(1_u8)))] + │ ├── filters: [or(gt(t1.a (#0), to_uint64(3)), gt(t1.a (#0), to_uint64(1)))] │ ├── estimated rows: 0.56 │ └── TableScan │ ├── table: default.default.t1 @@ -49,7 +49,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 0 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [or(gt(t1.a (#0), 3_u64), gt(t1.a (#0), 1_u64))], limit: NONE] + │ ├── push downs: [filters: [or(gt(t1.a (#0), 3), gt(t1.a (#0), 1))], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -547,7 +547,7 @@ query T explain select * from t1,t2 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b < 4) ---- Filter -├── filters: [or(and(gt(t1.a (#0), to_uint64(1_u8)), gt(t2.a (#2), to_uint64(2_u8))), and(lt(t1.b (#1), to_uint64(3_u8)), lt(t2.b (#3), to_uint64(4_u8))))] +├── filters: [or(and(gt(t1.a (#0), to_uint64(1)), gt(t2.a (#2), to_uint64(2))), and(lt(t1.b (#1), to_uint64(3)), lt(t2.b (#3), to_uint64(4))))] ├── estimated rows: 0.71 └── HashJoin ├── join type: CROSS @@ -556,7 +556,7 @@ Filter ├── filters: [] ├── estimated rows: 2.26 ├── Filter(Build) - │ ├── filters: [or(gt(t1.a (#0), to_uint64(1_u8)), lt(t1.b (#1), to_uint64(3_u8)))] + │ ├── filters: [or(gt(t1.a (#0), to_uint64(1)), lt(t1.b (#1), to_uint64(3)))] │ ├── estimated rows: 0.56 │ └── TableScan │ ├── table: default.default.t1 @@ -565,10 +565,10 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [or(gt(t1.a (#0), 1_u64), lt(t1.b (#1), 3_u64))], limit: NONE] + │ ├── push downs: [filters: [or(gt(t1.a (#0), 1), lt(t1.b (#1), 3))], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) - ├── filters: [or(gt(t2.a (#2), to_uint64(2_u8)), lt(t2.b (#3), to_uint64(4_u8)))] + ├── filters: [or(gt(t2.a (#2), to_uint64(2)), lt(t2.b (#3), to_uint64(4)))] ├── estimated rows: 4.06 └── TableScan ├── table: default.default.t2 @@ -577,14 +577,14 @@ Filter ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [or(gt(t2.a (#2), 2_u64), lt(t2.b (#3), 4_u64))], limit: NONE] + ├── push downs: [filters: [or(gt(t2.a (#2), 2), lt(t2.b (#3), 4))], limit: NONE] └── estimated rows: 5.00 query T explain select * from t1,t2 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b < 4) or t1.a = 2 ---- Filter -├── filters: [or(or(and(gt(t1.a (#0), to_uint64(1_u8)), gt(t2.a (#2), to_uint64(2_u8))), and(lt(t1.b (#1), to_uint64(3_u8)), lt(t2.b (#3), to_uint64(4_u8)))), eq(t1.a (#0), to_uint64(2_u8)))] +├── filters: [or(or(and(gt(t1.a (#0), to_uint64(1)), gt(t2.a (#2), to_uint64(2))), and(lt(t1.b (#1), to_uint64(3)), lt(t2.b (#3), to_uint64(4)))), eq(t1.a (#0), to_uint64(2)))] ├── estimated rows: 1.91 └── HashJoin ├── join type: CROSS @@ -593,7 +593,7 @@ Filter ├── filters: [] ├── estimated rows: 3.52 ├── Filter(Build) - │ ├── filters: [or(gt(t1.a (#0), to_uint64(1_u8)), or(lt(t1.b (#1), to_uint64(3_u8)), eq(t1.a (#0), to_uint64(2_u8))))] + │ ├── filters: [or(gt(t1.a (#0), to_uint64(1)), or(lt(t1.b (#1), to_uint64(3)), eq(t1.a (#0), to_uint64(2))))] │ ├── estimated rows: 0.70 │ └── TableScan │ ├── table: default.default.t1 @@ -602,7 +602,7 @@ Filter │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [or(gt(t1.a (#0), 1_u64), or(lt(t1.b (#1), 3_u64), eq(t1.a (#0), 2_u64)))], limit: NONE] + │ ├── push downs: [filters: [or(gt(t1.a (#0), 1), or(lt(t1.b (#1), 3), eq(t1.a (#0), 2)))], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 @@ -624,7 +624,7 @@ query T explain select * from t1,t2, t3 where (t1.a > 1 and t2.a > 2) or (t1.b < 3 and t2.b < 4) or t3.a = 2 ---- Filter -├── filters: [or(or(and(gt(t1.a (#0), to_uint64(1_u8)), gt(t2.a (#2), to_uint64(2_u8))), and(lt(t1.b (#1), to_uint64(3_u8)), lt(t2.b (#3), to_uint64(4_u8)))), eq(t3.a (#4), to_uint64(2_u8)))] +├── filters: [or(or(and(gt(t1.a (#0), to_uint64(1)), gt(t2.a (#2), to_uint64(2))), and(lt(t1.b (#1), to_uint64(3)), lt(t2.b (#3), to_uint64(4)))), eq(t3.a (#4), to_uint64(2)))] ├── estimated rows: 19.44 └── HashJoin ├── join type: CROSS @@ -676,7 +676,7 @@ HashJoin ├── filters: [] ├── estimated rows: 5.49 ├── Filter(Build) -│ ├── filters: [or(and(gt(t1.a (#0), to_uint64(1_u8)), gt(t2.a (#2), to_uint64(2_u8))), and(lt(t1.b (#1), to_uint64(3_u8)), lt(t2.b (#3), to_uint64(4_u8))))] +│ ├── filters: [or(and(gt(t1.a (#0), to_uint64(1)), gt(t2.a (#2), to_uint64(2))), and(lt(t1.b (#1), to_uint64(3)), lt(t2.b (#3), to_uint64(4))))] │ ├── estimated rows: 0.71 │ └── HashJoin │ ├── join type: CROSS @@ -685,7 +685,7 @@ HashJoin │ ├── filters: [] │ ├── estimated rows: 2.26 │ ├── Filter(Build) -│ │ ├── filters: [or(gt(t1.a (#0), to_uint64(1_u8)), lt(t1.b (#1), to_uint64(3_u8)))] +│ │ ├── filters: [or(gt(t1.a (#0), to_uint64(1)), lt(t1.b (#1), to_uint64(3)))] │ │ ├── estimated rows: 0.56 │ │ └── TableScan │ │ ├── table: default.default.t1 @@ -694,10 +694,10 @@ HashJoin │ │ ├── partitions total: 1 │ │ ├── partitions scanned: 1 │ │ ├── pruning stats: [segments: , blocks: ] -│ │ ├── push downs: [filters: [or(gt(t1.a (#0), 1_u64), lt(t1.b (#1), 3_u64))], limit: NONE] +│ │ ├── push downs: [filters: [or(gt(t1.a (#0), 1), lt(t1.b (#1), 3))], limit: NONE] │ │ └── estimated rows: 1.00 │ └── Filter(Probe) -│ ├── filters: [or(gt(t2.a (#2), to_uint64(2_u8)), lt(t2.b (#3), to_uint64(4_u8)))] +│ ├── filters: [or(gt(t2.a (#2), to_uint64(2)), lt(t2.b (#3), to_uint64(4)))] │ ├── estimated rows: 4.06 │ └── TableScan │ ├── table: default.default.t2 @@ -706,10 +706,10 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [or(gt(t2.a (#2), 2_u64), lt(t2.b (#3), 4_u64))], limit: NONE] +│ ├── push downs: [filters: [or(gt(t2.a (#2), 2), lt(t2.b (#3), 4))], limit: NONE] │ └── estimated rows: 5.00 └── Filter(Probe) - ├── filters: [gt(t3.a (#4), to_uint64(1_u8))] + ├── filters: [gt(t3.a (#4), to_uint64(1))] ├── estimated rows: 7.78 └── TableScan ├── table: default.default.t3 @@ -718,7 +718,7 @@ HashJoin ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [gt(t3.a (#4), 1_u64)], limit: NONE] + ├── push downs: [filters: [gt(t3.a (#4), 1)], limit: NONE] └── estimated rows: 10.00 query T @@ -732,7 +732,7 @@ Limit ├── sort keys: [a DESC NULLS LAST] ├── estimated rows: 1.01 └── Filter - ├── filters: [or(and(or(gt(t1.a (#0), to_uint64(1_u8)), lt(t1.b (#1), to_uint64(2_u8))), gt(t2.a (#2), to_uint64(2_u8))), and(lt(t1.b (#1), to_uint64(3_u8)), lt(t2.b (#3), to_uint64(4_u8))))] + ├── filters: [or(and(or(gt(t1.a (#0), to_uint64(1)), lt(t1.b (#1), to_uint64(2))), gt(t2.a (#2), to_uint64(2))), and(lt(t1.b (#1), to_uint64(3)), lt(t2.b (#3), to_uint64(4))))] ├── estimated rows: 1.01 └── HashJoin ├── join type: CROSS @@ -741,7 +741,7 @@ Limit ├── filters: [] ├── estimated rows: 2.86 ├── Filter(Build) - │ ├── filters: [or(or(gt(t1.a (#0), to_uint64(1_u8)), lt(t1.b (#1), to_uint64(2_u8))), lt(t1.b (#1), to_uint64(3_u8)))] + │ ├── filters: [or(or(gt(t1.a (#0), to_uint64(1)), lt(t1.b (#1), to_uint64(2))), lt(t1.b (#1), to_uint64(3)))] │ ├── estimated rows: 0.70 │ └── TableScan │ ├── table: default.default.t1 @@ -750,10 +750,10 @@ Limit │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] - │ ├── push downs: [filters: [or(or(gt(t1.a (#0), 1_u64), lt(t1.b (#1), 2_u64)), lt(t1.b (#1), 3_u64))], limit: NONE] + │ ├── push downs: [filters: [or(or(gt(t1.a (#0), 1), lt(t1.b (#1), 2)), lt(t1.b (#1), 3))], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) - ├── filters: [or(gt(t2.a (#2), to_uint64(2_u8)), lt(t2.b (#3), to_uint64(4_u8)))] + ├── filters: [or(gt(t2.a (#2), to_uint64(2)), lt(t2.b (#3), to_uint64(4)))] ├── estimated rows: 4.06 └── TableScan ├── table: default.default.t2 @@ -762,7 +762,7 @@ Limit ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [or(gt(t2.a (#2), 2_u64), lt(t2.b (#3), 4_u64))], limit: NONE] + ├── push downs: [filters: [or(gt(t2.a (#2), 2), lt(t2.b (#3), 4))], limit: NONE] └── estimated rows: 5.00 query T @@ -775,7 +775,7 @@ HashJoin ├── filters: [] ├── estimated rows: 2.78 ├── Filter(Build) -│ ├── filters: [or(gt(t1.a (#0), to_uint64(1_u8)), lt(t1.b (#1), to_uint64(2_u8)))] +│ ├── filters: [or(gt(t1.a (#0), to_uint64(1)), lt(t1.b (#1), to_uint64(2)))] │ ├── estimated rows: 0.56 │ └── TableScan │ ├── table: default.default.t1 @@ -784,7 +784,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [or(gt(t1.a (#0), 1_u64), lt(t1.b (#1), 2_u64))], limit: NONE] +│ ├── push downs: [filters: [or(gt(t1.a (#0), 1), lt(t1.b (#1), 2))], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.default.t2 diff --git a/tests/sqllogictests/suites/mode/standalone/explain/fold_count.test b/tests/sqllogictests/suites/mode/standalone/explain/fold_count.test index 562e6de0003f4..16fda7b2ec9a5 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/fold_count.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/fold_count.test @@ -11,7 +11,7 @@ EvalScalar ├── expressions: [COUNT(*) (#2)] ├── estimated rows: 1.00 └── EvalScalar - ├── expressions: [1000_u64] + ├── expressions: [1000] ├── estimated rows: 1.00 └── DummyTableScan @@ -25,7 +25,7 @@ EvalScalar ├── expressions: [COUNT(*) (#2)] ├── estimated rows: 1.00 └── EvalScalar - ├── expressions: [1001_u64] + ├── expressions: [1001] ├── estimated rows: 1.00 └── DummyTableScan @@ -44,7 +44,7 @@ EvalScalar ├── aggregate functions: [count()] ├── estimated rows: 1.00 └── Filter - ├── filters: [gt(t.number (#0), to_uint64(10_u8))] + ├── filters: [gt(t.number (#0), to_uint64(10))] ├── estimated rows: 989.89 └── TableScan ├── table: default.default.t @@ -53,7 +53,7 @@ EvalScalar ├── partitions total: 2 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [gt(t.number (#0), 10_u64)], limit: NONE] + ├── push downs: [filters: [gt(t.number (#0), 10)], limit: NONE] └── estimated rows: 1001.00 statement ok diff --git a/tests/sqllogictests/suites/mode/standalone/explain/join.test b/tests/sqllogictests/suites/mode/standalone/explain/join.test index 25567c9cff39f..9f2838ae8fa65 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/join.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/join.test @@ -50,7 +50,7 @@ explain select t.number from t, t1 where t.number = t1.number and t.number = t1. HashJoin ├── join type: INNER ├── build keys: [t.number (#0), t.number (#0)] -├── probe keys: [t1.number (#1), plus(t1.number (#1), 1_u8)] +├── probe keys: [t1.number (#1), plus(t1.number (#1), 1)] ├── filters: [] ├── estimated rows: 1.00 ├── TableScan(Build) @@ -82,7 +82,7 @@ HashJoin ├── filters: [] ├── estimated rows: 1.11 ├── Filter(Build) -│ ├── filters: [gt(t.number (#0), to_uint64(1_u8))] +│ ├── filters: [gt(t.number (#0), to_uint64(1))] │ ├── estimated rows: 0.33 │ └── TableScan │ ├── table: default.default.t @@ -91,10 +91,10 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 0 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [gt(t.number (#0), 1_u64)], limit: NONE] +│ ├── push downs: [filters: [gt(t.number (#0), 1)], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) - ├── filters: [lt(to_uint64(1_u8), t1.number (#1))] + ├── filters: [lt(to_uint64(1), t1.number (#1))] ├── estimated rows: 3.33 └── TableScan ├── table: default.default.t1 @@ -103,14 +103,14 @@ HashJoin ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [lt(1_u64, t1.number (#1))], limit: NONE] + ├── push downs: [filters: [lt(1, t1.number (#1))], limit: NONE] └── estimated rows: 10.00 query T explain select t.number from t, t1 where t.number + t1.number = 1 ---- Filter -├── filters: [eq(plus(t.number (#0), t1.number (#1)), to_uint64(1_u8))] +├── filters: [eq(plus(t.number (#0), t1.number (#1)), to_uint64(1))] ├── estimated rows: 3.33 └── HashJoin ├── join type: CROSS @@ -148,7 +148,7 @@ HashJoin ├── filters: [] ├── estimated rows: 0.00 ├── Filter(Build) -│ ├── filters: [eq(t.number (#0), to_uint64(1_u8))] +│ ├── filters: [eq(t.number (#0), to_uint64(1))] │ ├── estimated rows: 0.33 │ └── TableScan │ ├── table: default.default.t @@ -157,7 +157,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 0 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [eq(t.number (#0), 1_u64)], limit: NONE] +│ ├── push downs: [filters: [eq(t.number (#0), 1)], limit: NONE] │ └── estimated rows: 1.00 └── HashJoin(Probe) ├── join type: INNER @@ -208,7 +208,7 @@ query T explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 42 ---- Filter -├── filters: [gt(b.x (#1), CAST(42_u8 AS Int32 NULL))] +├── filters: [gt(b.x (#1), CAST(42 AS Int32 NULL))] ├── estimated rows: 2.67 └── HashJoin ├── join type: LEFT OUTER @@ -239,7 +239,7 @@ query T explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 44 or b.x < 43 ---- Filter -├── filters: [or(gt(b.x (#1), CAST(44_u8 AS Int32 NULL)), lt(b.x (#1), CAST(43_u8 AS Int32 NULL)))] +├── filters: [or(gt(b.x (#1), CAST(44 AS Int32 NULL)), lt(b.x (#1), CAST(43 AS Int32 NULL)))] ├── estimated rows: 2.22 └── HashJoin ├── join type: LEFT OUTER @@ -270,7 +270,7 @@ query T explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 42 and b.x < 45 ---- Filter -├── filters: [gt(b.x (#1), CAST(42_u8 AS Int32 NULL)), lt(b.x (#1), CAST(45_u8 AS Int32 NULL))] +├── filters: [gt(b.x (#1), CAST(42 AS Int32 NULL)), lt(b.x (#1), CAST(45 AS Int32 NULL))] ├── estimated rows: 1.78 └── HashJoin ├── join type: LEFT OUTER @@ -303,7 +303,7 @@ query T explain select * from onecolumn as a left join twocolumn as b on a.x = b.x where b.x > 44 or a.x < 43 ---- Filter -├── filters: [or(gt(b.x (#1), CAST(44_u8 AS Int32 NULL)), lt(a.x (#0), CAST(43_u8 AS Int32 NULL)))] +├── filters: [or(gt(b.x (#1), CAST(44 AS Int32 NULL)), lt(a.x (#0), CAST(43 AS Int32 NULL)))] ├── estimated rows: 3.11 └── HashJoin ├── join type: LEFT OUTER @@ -340,7 +340,7 @@ HashJoin ├── filters: [] ├── estimated rows: 1.78 ├── Filter(Build) -│ ├── filters: [gt(b.x (#1), CAST(42_u8 AS Int32 NULL)), lt(b.x (#1), CAST(45_u8 AS Int32 NULL))] +│ ├── filters: [gt(b.x (#1), CAST(42 AS Int32 NULL)), lt(b.x (#1), CAST(45 AS Int32 NULL))] │ ├── estimated rows: 1.78 │ └── TableScan │ ├── table: default.default.twocolumn @@ -349,7 +349,7 @@ HashJoin │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [gt(b.x (#1), 42_i32), lt(b.x (#1), 45_i32)], limit: NONE] +│ ├── push downs: [filters: [gt(b.x (#1), 42), lt(b.x (#1), 45)], limit: NONE] │ └── estimated rows: 4.00 └── TableScan(Probe) ├── table: default.default.onecolumn diff --git a/tests/sqllogictests/suites/mode/standalone/explain/limit.test b/tests/sqllogictests/suites/mode/standalone/explain/limit.test index d5cab54248c8e..05d783f4692a8 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/limit.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/limit.test @@ -81,7 +81,7 @@ Limit ├── aggregate functions: [] ├── estimated rows: 0.33 └── Filter - ├── filters: [eq(CAST(t.number (#0) AS UInt64 NULL), TRY_CAST(if(CAST(is_not_null(scalar_subquery_4 (#4)) AS Boolean NULL), CAST(scalar_subquery_4 (#4) AS Int64 NULL), CAST(0_i64 AS Int64 NULL)) AS UInt64 NULL))] + ├── filters: [eq(CAST(t.number (#0) AS UInt64 NULL), TRY_CAST(if(CAST(is_not_null(scalar_subquery_4 (#4)) AS Boolean NULL), CAST(scalar_subquery_4 (#4) AS Int64 NULL), CAST(0 AS Int64 NULL)) AS UInt64 NULL))] ├── estimated rows: 0.33 └── HashJoin ├── join type: SINGLE diff --git a/tests/sqllogictests/suites/mode/standalone/explain/prune_column.test b/tests/sqllogictests/suites/mode/standalone/explain/prune_column.test index df9bc41f2811d..b490770c7f587 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/prune_column.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/prune_column.test @@ -41,7 +41,7 @@ Limit ├── sort keys: [number ASC NULLS LAST] ├── estimated rows: 0.33 └── Filter - ├── filters: [gt(numbers.b (#0), to_uint64(1_u8))] + ├── filters: [gt(numbers.b (#0), to_uint64(1))] ├── estimated rows: 0.33 └── AggregateFinal ├── group by: [number, number, number, number] @@ -70,10 +70,10 @@ HashJoin ├── filters: [] ├── estimated rows: 0.33 ├── Filter(Build) -│ ├── filters: [eq(t1.c (#3), to_uint64(1_u8))] +│ ├── filters: [eq(t1.c (#3), to_uint64(1))] │ ├── estimated rows: 0.33 │ └── EvalScalar -│ ├── expressions: [plus(numbers.number (#0), 1_u8), plus(numbers.number (#0), 1_u8), plus(numbers.number (#0), 1_u8)] +│ ├── expressions: [plus(numbers.number (#0), 1), plus(numbers.number (#0), 1), plus(numbers.number (#0), 1)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.system.numbers @@ -84,7 +84,7 @@ HashJoin │ ├── push downs: [filters: [], limit: NONE] │ └── estimated rows: 1.00 └── EvalScalar(Probe) - ├── expressions: [plus(numbers.number (#9), 1_u8)] + ├── expressions: [plus(numbers.number (#9), 1)] ├── estimated rows: 1.00 └── TableScan ├── table: default.system.numbers @@ -125,10 +125,10 @@ Filter │ ├── filters: [] │ ├── estimated rows: 0.33 │ ├── Filter(Build) - │ │ ├── filters: [eq(t2.c (#8), to_uint64(1_u8))] + │ │ ├── filters: [eq(t2.c (#8), to_uint64(1))] │ │ ├── estimated rows: 0.33 │ │ └── EvalScalar - │ │ ├── expressions: [plus(numbers.number (#5), 1_u8), plus(numbers.number (#5), 1_u8)] + │ │ ├── expressions: [plus(numbers.number (#5), 1), plus(numbers.number (#5), 1)] │ │ ├── estimated rows: 1.00 │ │ └── TableScan │ │ ├── table: default.system.numbers @@ -139,7 +139,7 @@ Filter │ │ ├── push downs: [filters: [], limit: NONE] │ │ └── estimated rows: 1.00 │ └── EvalScalar(Probe) - │ ├── expressions: [plus(numbers.number (#14), 1_u8)] + │ ├── expressions: [plus(numbers.number (#14), 1)] │ ├── estimated rows: 1.00 │ └── TableScan │ ├── table: default.system.numbers @@ -150,7 +150,7 @@ Filter │ ├── push downs: [filters: [], limit: NONE] │ └── estimated rows: 1.00 └── EvalScalar(Probe) - ├── expressions: [plus(numbers.number (#0), 1_u8)] + ├── expressions: [plus(numbers.number (#0), 1)] ├── estimated rows: 1.00 └── TableScan ├── table: default.system.numbers @@ -186,7 +186,7 @@ HashJoin ├── filters: [] ├── estimated rows: 3.33 ├── Filter(Build) -│ ├── filters: [eq(count(*) (#2), 1_u64)] +│ ├── filters: [eq(count(*) (#2), 1)] │ ├── estimated rows: 0.33 │ └── AggregateFinal │ ├── group by: [] @@ -242,7 +242,7 @@ EvalScalar ├── aggregate functions: [count()] ├── estimated rows: 1.00 └── Filter - ├── filters: [eq(t.b (#1), to_int32(2_u8))] + ├── filters: [eq(t.b (#1), to_int32(2))] ├── estimated rows: 0.67 └── TableScan ├── table: default.default.t @@ -251,7 +251,7 @@ EvalScalar ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [eq(t.b (#1), 2_i32)], limit: NONE] + ├── push downs: [filters: [eq(t.b (#1), 2)], limit: NONE] ├── output columns: [1] └── estimated rows: 2.00 diff --git a/tests/sqllogictests/suites/mode/standalone/explain/select.test b/tests/sqllogictests/suites/mode/standalone/explain/select.test index b3640fbbaf547..888182750f6d8 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/select.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/select.test @@ -14,7 +14,7 @@ query T explain select * from (select * from numbers(1)) as t1 where number = 1 ---- Filter -├── filters: [eq(t1.number (#0), to_uint64(1_u8))] +├── filters: [eq(t1.number (#0), to_uint64(1))] ├── estimated rows: 0.33 └── TableScan ├── table: default.system.numbers @@ -22,17 +22,17 @@ Filter ├── read bytes: 8 ├── partitions total: 1 ├── partitions scanned: 1 - ├── push downs: [filters: [eq(t1.number (#0), 1_u64)], limit: NONE] + ├── push downs: [filters: [eq(t1.number (#0), 1)], limit: NONE] └── estimated rows: 1.00 query T explain select * from (select number as a, number + 1 as b from numbers(1)) as t1 where a = 1 and b = 1 ---- Filter -├── filters: [eq(t1.a (#0), to_uint64(1_u8)), eq(t1.b (#1), to_uint64(1_u8))] +├── filters: [eq(t1.a (#0), to_uint64(1)), eq(t1.b (#1), to_uint64(1))] ├── estimated rows: 0.11 └── EvalScalar - ├── expressions: [plus(numbers.number (#0), 1_u8)] + ├── expressions: [plus(numbers.number (#0), 1)] ├── estimated rows: 1.00 └── TableScan ├── table: default.system.numbers @@ -47,10 +47,10 @@ query T explain select * from (select number as a, number + 1 as b from numbers(1)) as t1 where a = 1 ---- EvalScalar -├── expressions: [plus(numbers.number (#0), 1_u8)] +├── expressions: [plus(numbers.number (#0), 1)] ├── estimated rows: 0.33 └── Filter - ├── filters: [eq(t1.a (#0), to_uint64(1_u8))] + ├── filters: [eq(t1.a (#0), to_uint64(1))] ├── estimated rows: 0.33 └── TableScan ├── table: default.system.numbers @@ -58,14 +58,14 @@ EvalScalar ├── read bytes: 8 ├── partitions total: 1 ├── partitions scanned: 1 - ├── push downs: [filters: [eq(t1.a (#0), 1_u64)], limit: NONE] + ├── push downs: [filters: [eq(t1.a (#0), 1)], limit: NONE] └── estimated rows: 1.00 query T explain select * from numbers(1) where number = pow(1, 1 + 1) ---- Filter -├── filters: [eq(to_float64(numbers.number (#0)), pow(to_float64(1_u8), to_float64(plus(1_u8, 1_u8))))] +├── filters: [eq(to_float64(numbers.number (#0)), pow(to_float64(1), to_float64(plus(1, 1))))] ├── estimated rows: 0.33 └── TableScan ├── table: default.system.numbers @@ -73,14 +73,14 @@ Filter ├── read bytes: 8 ├── partitions total: 1 ├── partitions scanned: 1 - ├── push downs: [filters: [eq(to_float64(numbers.number (#0)), 1_f64)], limit: NONE] + ├── push downs: [filters: [eq(to_float64(numbers.number (#0)), 1)], limit: NONE] └── estimated rows: 1.00 query T explain select * from numbers(1) where TRUE and 1 = 1 ---- Filter -├── filters: [eq(1_u8, 1_u8)] +├── filters: [eq(1, 1)] ├── estimated rows: 0.33 └── TableScan ├── table: default.system.numbers diff --git a/tests/sqllogictests/suites/mode/standalone/explain/subquery.test b/tests/sqllogictests/suites/mode/standalone/explain/subquery.test index cb86e611e91c2..67380d692fe13 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/subquery.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/subquery.test @@ -2,7 +2,7 @@ query T explain select t.number from numbers(1) as t, numbers(1) as t1 where t.number = (select count(*) from numbers(1) as t2, numbers(1) as t3 where t.number = t2.number) ---- Filter -├── filters: [eq(CAST(t.number (#0) AS UInt64 NULL), TRY_CAST(if(CAST(is_not_null(scalar_subquery_4 (#4)) AS Boolean NULL), CAST(scalar_subquery_4 (#4) AS Int64 NULL), CAST(0_i64 AS Int64 NULL)) AS UInt64 NULL))] +├── filters: [eq(CAST(t.number (#0) AS UInt64 NULL), TRY_CAST(if(CAST(is_not_null(scalar_subquery_4 (#4)) AS Boolean NULL), CAST(scalar_subquery_4 (#4) AS Int64 NULL), CAST(0 AS Int64 NULL)) AS UInt64 NULL))] ├── estimated rows: 0.33 └── HashJoin ├── join type: SINGLE @@ -73,7 +73,7 @@ query T explain select t.number from numbers(1) as t where exists (select t1.number from numbers(1) as t1 where t.number = t1.number) or t.number > 1 ---- Filter -├── filters: [or(2 (#2), CAST(gt(t.number (#0), to_uint64(1_u8)) AS Boolean NULL))] +├── filters: [or(2 (#2), CAST(gt(t.number (#0), to_uint64(1)) AS Boolean NULL))] ├── estimated rows: 0.33 └── HashJoin ├── join type: RIGHT MARK @@ -111,7 +111,7 @@ HashJoin ├── filters: [] ├── estimated rows: 0.33 ├── Filter(Build) -│ ├── filters: [eq(count(*) (#2), 1_u64)] +│ ├── filters: [eq(count(*) (#2), 1)] │ ├── estimated rows: 0.33 │ └── AggregateFinal │ ├── group by: [] @@ -126,7 +126,7 @@ HashJoin │ ├── offset: 0 │ ├── estimated rows: 0.33 │ └── Filter -│ ├── filters: [eq(numbers.number (#1), to_uint64(0_u8))] +│ ├── filters: [eq(numbers.number (#1), to_uint64(0))] │ ├── estimated rows: 0.33 │ └── TableScan │ ├── table: default.system.numbers @@ -134,7 +134,7 @@ HashJoin │ ├── read bytes: 8 │ ├── partitions total: 1 │ ├── partitions scanned: 1 -│ ├── push downs: [filters: [eq(numbers.number (#1), 0_u64)], limit: NONE] +│ ├── push downs: [filters: [eq(numbers.number (#1), 0)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.system.numbers @@ -158,7 +158,7 @@ Filter ├── filters: [] ├── estimated rows: 1.00 ├── Filter(Build) - │ ├── filters: [eq(numbers.number (#1), to_uint64(0_u8))] + │ ├── filters: [eq(numbers.number (#1), to_uint64(0))] │ ├── estimated rows: 0.33 │ └── TableScan │ ├── table: default.system.numbers @@ -166,7 +166,7 @@ Filter │ ├── read bytes: 8 │ ├── partitions total: 1 │ ├── partitions scanned: 1 - │ ├── push downs: [filters: [eq(numbers.number (#1), 0_u64)], limit: NONE] + │ ├── push downs: [filters: [eq(numbers.number (#1), 0)], limit: NONE] │ └── estimated rows: 1.00 └── TableScan(Probe) ├── table: default.system.numbers @@ -265,7 +265,7 @@ HashJoin ├── filters: [] ├── estimated rows: 0.33 ├── Filter(Build) -│ ├── filters: [eq(numbers.number (#1), to_uint64(0_u8))] +│ ├── filters: [eq(numbers.number (#1), to_uint64(0))] │ ├── estimated rows: 0.33 │ └── TableScan │ ├── table: default.system.numbers @@ -273,10 +273,10 @@ HashJoin │ ├── read bytes: 8 │ ├── partitions total: 1 │ ├── partitions scanned: 1 -│ ├── push downs: [filters: [eq(numbers.number (#1), 0_u64)], limit: NONE] +│ ├── push downs: [filters: [eq(numbers.number (#1), 0)], limit: NONE] │ └── estimated rows: 1.00 └── Filter(Probe) - ├── filters: [lt(t.number (#0), to_uint64(10_u8))] + ├── filters: [lt(t.number (#0), to_uint64(10))] ├── estimated rows: 0.33 └── TableScan ├── table: default.system.numbers @@ -284,7 +284,7 @@ HashJoin ├── read bytes: 8 ├── partitions total: 1 ├── partitions scanned: 1 - ├── push downs: [filters: [lt(t.number (#0), 10_u64)], limit: NONE] + ├── push downs: [filters: [lt(t.number (#0), 10)], limit: NONE] └── estimated rows: 1.00 query T @@ -343,7 +343,7 @@ query T explain select t.number from numbers(1) as t, numbers(1) as t1 where (select count(*) = 1 from numbers(1) where t.number = number) and t.number = t1.number ---- Filter -├── filters: [TRY_CAST(if(CAST(is_not_null(scalar_subquery_3 (#3)) AS Boolean NULL), CAST(scalar_subquery_3 (#3) AS Variant NULL), CAST(0_i64 AS Variant NULL)) AS UInt64 NULL)] +├── filters: [TRY_CAST(if(CAST(is_not_null(scalar_subquery_3 (#3)) AS Boolean NULL), CAST(scalar_subquery_3 (#3) AS Variant NULL), CAST(0 AS Variant NULL)) AS UInt64 NULL)] ├── estimated rows: 0.33 └── HashJoin ├── join type: SINGLE @@ -352,7 +352,7 @@ Filter ├── filters: [] ├── estimated rows: 1.00 ├── EvalScalar(Build) - │ ├── expressions: [eq(COUNT(*) (#4), to_uint64(1_u8))] + │ ├── expressions: [eq(COUNT(*) (#4), to_uint64(1))] │ ├── estimated rows: 0.33 │ └── AggregateFinal │ ├── group by: [number] diff --git a/tests/sqllogictests/suites/mode/standalone/explain/union.test b/tests/sqllogictests/suites/mode/standalone/explain/union.test index 8e8c8ef9a11aa..5d098868e8e2d 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/union.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/union.test @@ -58,7 +58,7 @@ explain select * from v where a > 1 UnionAll ├── estimated rows: 1.33 ├── Filter -│ ├── filters: [gt(v.a (#0), to_int32(1_u8))] +│ ├── filters: [gt(v.a (#0), to_int32(1))] │ ├── estimated rows: 0.67 │ └── TableScan │ ├── table: default.default.t1 @@ -67,10 +67,10 @@ UnionAll │ ├── partitions total: 1 │ ├── partitions scanned: 1 │ ├── pruning stats: [segments: , blocks: ] -│ ├── push downs: [filters: [gt(v.a (#0), 1_i32)], limit: NONE] +│ ├── push downs: [filters: [gt(v.a (#0), 1)], limit: NONE] │ └── estimated rows: 2.00 └── Filter - ├── filters: [gt(a (#2), to_int32(1_u8))] + ├── filters: [gt(a (#2), to_int32(1))] ├── estimated rows: 0.67 └── TableScan ├── table: default.default.t2 @@ -79,7 +79,7 @@ UnionAll ├── partitions total: 1 ├── partitions scanned: 1 ├── pruning stats: [segments: , blocks: ] - ├── push downs: [filters: [gt(a (#2), 1_i32)], limit: NONE] + ├── push downs: [filters: [gt(a (#2), 1)], limit: NONE] └── estimated rows: 2.00 query T diff --git a/tests/sqllogictests/suites/query/02_function/02_0002_function_cast b/tests/sqllogictests/suites/query/02_function/02_0002_function_cast index 9db6598797d5e..58a7830476e3d 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0002_function_cast +++ b/tests/sqllogictests/suites/query/02_function/02_0002_function_cast @@ -195,12 +195,12 @@ SELECT to_timestamp(1640019661000000) = to_timestamp('2021-12-20 17:01:01.000000 query B -SELECT parse_json(true)::boolean +SELECT to_variant(true)::boolean ---- 1 query B -SELECT parse_json(false)::boolean +SELECT to_variant(false)::boolean ---- 0 @@ -217,75 +217,74 @@ SELECT parse_json('"false"')::boolean 0 - statement error 1001 SELECT parse_json('"test"')::boolean statement error 1001 -SELECT parse_json(1)::boolean +SELECT to_variant(1)::boolean statement error 1001 SELECT parse_json('null')::boolean query I -SELECT parse_json(255)::uint8 +SELECT to_variant(255)::uint8 ---- 255 query I -SELECT parse_json(65535)::uint16 +SELECT to_variant(65535)::uint16 ---- 65535 query I -SELECT parse_json(4294967295)::uint32 +SELECT to_variant(4294967295)::uint32 ---- 4294967295 query I -SELECT parse_json(18446744073709551615)::uint64 +SELECT to_variant(18446744073709551615)::uint64 ---- 18446744073709551615 query I -SELECT parse_json(-128)::int8 +SELECT to_variant(-128)::int8 ---- -128 query I -SELECT parse_json(127)::int8 +SELECT to_variant(127)::int8 ---- 127 query I -SELECT parse_json(-32768)::int16 +SELECT to_variant(-32768)::int16 ---- -32768 query I -SELECT parse_json(32767)::int16 +SELECT to_variant(32767)::int16 ---- 32767 query I -SELECT parse_json(-2147483648)::int32 +SELECT to_variant(-2147483648)::int32 ---- -2147483648 query I -SELECT parse_json(2147483647)::int32 +SELECT to_variant(2147483647)::int32 ---- 2147483647 query I -SELECT parse_json(-9223372036854775808)::int64 +SELECT to_variant(-9223372036854775808)::int64 ---- -9223372036854775808 query I -SELECT parse_json(9223372036854775807)::int64 +SELECT to_variant(9223372036854775807)::int64 ---- 9223372036854775807 @@ -362,12 +361,12 @@ statement error 1001 SELECT parse_json('null')::int64 query F -SELECT parse_json(12.34)::float32 +SELECT to_variant(12.34)::float32 ---- 12.34 query F -SELECT parse_json(1234.5678)::float64 +SELECT to_variant(1234.5678)::float64 ---- 1234.5678 @@ -421,7 +420,7 @@ SELECT as_array(parse_json('[1,2,3]')) [1,2,3] query T -SELECT as_array(parse_json(1)) +SELECT as_array(to_variant(1)) ---- NULL diff --git a/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_parse_json b/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_parse_json index 34802ffea93a6..44023091356bd 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_parse_json +++ b/tests/sqllogictests/suites/query/02_function/02_0048_function_semi_structureds_parse_json @@ -1,20 +1,20 @@ query T -select parse_json(null) +select to_variant(null) ---- -NULL +null query T -select parse_json(true) +select to_variant(true) ---- true query T -select parse_json(123) +select to_variant(123) ---- 123 query T -select parse_json(12.34) +select to_variant(12.34) ---- 12.34 @@ -84,22 +84,22 @@ select '==try_parse_json==' ==try_parse_json== query T -select try_parse_json(null) +select try_to_variant(null) ---- -NULL +null query T -select try_parse_json(true) +select try_to_variant(true) ---- true query T -select try_parse_json(123) +select try_to_variant(123) ---- 123 query T -select try_parse_json(12.34) +select try_to_variant(12.34) ---- 12.34 diff --git a/tests/sqllogictests/suites/query/02_function/02_0049_function_semi_structureds_check_json b/tests/sqllogictests/suites/query/02_function/02_0049_function_semi_structureds_check_json index cdf0cbd23d9eb..42199e010414f 100644 --- a/tests/sqllogictests/suites/query/02_function/02_0049_function_semi_structureds_check_json +++ b/tests/sqllogictests/suites/query/02_function/02_0049_function_semi_structureds_check_json @@ -3,21 +3,6 @@ select check_json(null) ---- NULL -query T -select check_json(true) ----- -NULL - -query T -select check_json(123) ----- -NULL - -query T -select check_json(12.34) ----- -NULL - query T select check_json('null') ----