Skip to content

Commit acf4701

Browse files
committed
remove dictionary support in lists, as that's out of scope
1 parent 0de2318 commit acf4701

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

datafusion-postgres/src/datatypes.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,7 @@ pub(crate) fn into_pg_type(df_type: &DataType) -> PgWireResult<Type> {
4141
DataType::Utf8 => Type::VARCHAR,
4242
DataType::LargeUtf8 => Type::TEXT,
4343
DataType::List(field) | DataType::FixedSizeList(field, _) | DataType::LargeList(field) => {
44-
let field_type = field.data_type();
45-
46-
// Handle dictionary types in lists
47-
let actual_type = match field_type {
48-
DataType::Dictionary(_, value_type) => value_type.as_ref(),
49-
_ => field_type,
50-
};
51-
52-
match actual_type {
44+
match field.data_type() {
5345
DataType::Boolean => Type::BOOL_ARRAY,
5446
DataType::Int8 | DataType::UInt8 => Type::CHAR_ARRAY,
5547
DataType::Int16 | DataType::UInt16 => Type::INT2_ARRAY,
@@ -248,7 +240,6 @@ fn get_time64_nanosecond_value(arr: &Arc<dyn Array>, idx: usize) -> Option<Naive
248240
.value_as_datetime(idx)
249241
}
250242

251-
252243
fn encode_value(
253244
encoder: &mut DataRowEncoder,
254245
arr: &Arc<dyn Array>,
@@ -649,7 +640,10 @@ fn encode_value(
649640
PgWireError::UserError(Box::new(ErrorInfo::new(
650641
"ERROR".to_owned(),
651642
"XX000".to_owned(),
652-
format!("Unsupported dictionary key type for value type {}", value_type),
643+
format!(
644+
"Unsupported dictionary key type for value type {}",
645+
value_type
646+
),
653647
)))
654648
})?;
655649

0 commit comments

Comments
 (0)