From 855cd7d9037fa0574d8c9dec4c8e2c1621c9f4f8 Mon Sep 17 00:00:00 2001 From: Jinser Kafka Date: Mon, 11 Mar 2024 20:18:49 +0800 Subject: [PATCH] chore: update comment for `DataType::Int256` in `ToBinary` --- src/common/src/types/to_binary.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/src/types/to_binary.rs b/src/common/src/types/to_binary.rs index 3b66828b7c8fe..5f769b971a657 100644 --- a/src/common/src/types/to_binary.rs +++ b/src/common/src/types/to_binary.rs @@ -106,7 +106,6 @@ impl<'a> ToBinary for ListRef<'a> { DataType::Int16 => Type::INT2_ARRAY, DataType::Int32 => Type::INT4_ARRAY, DataType::Int64 => Type::INT8_ARRAY, - DataType::Int256 => Type::NUMERIC_ARRAY, // HACK: NOT SURE DataType::Float32 => Type::FLOAT4_ARRAY, DataType::Float64 => Type::FLOAT8_ARRAY, DataType::Decimal => Type::NUMERIC_ARRAY, @@ -119,6 +118,9 @@ impl<'a> ToBinary for ListRef<'a> { DataType::Bytea => Type::BYTEA_ARRAY, DataType::Jsonb => Type::JSONB_ARRAY, DataType::Serial => Type::INT4_ARRAY, + // INFO: `Int256` not support in `ScalarRefImpl::to_sql` + // Just let `Array[Int256]` continue `to_sql`, and the `ScalarRefImpl::to_sql` will handle the error. + DataType::Int256 => Type::NUMERIC_ARRAY, DataType::Struct(_) | DataType::List(_) => bail_not_implemented!( issue = 7949, "the pgwire extended-mode encoding for lists with more than one dimension ({ty}) is unsupported"