diff --git a/datafusion/physical-plan/src/aggregates/mod.rs b/datafusion/physical-plan/src/aggregates/mod.rs index feca5eb1db381..40b145a5be1ff 100644 --- a/datafusion/physical-plan/src/aggregates/mod.rs +++ b/datafusion/physical-plan/src/aggregates/mod.rs @@ -2436,25 +2436,21 @@ mod tests { "labels".to_string(), DataType::Struct( vec![ - Field::new_dict( + Field::new( "a".to_string(), DataType::Dictionary( Box::new(DataType::Int32), Box::new(DataType::Utf8), ), true, - 0, - false, ), - Field::new_dict( + Field::new( "b".to_string(), DataType::Dictionary( Box::new(DataType::Int32), Box::new(DataType::Utf8), ), true, - 0, - false, ), ] .into(), @@ -2466,15 +2462,13 @@ mod tests { vec![ Arc::new(StructArray::from(vec![ ( - Arc::new(Field::new_dict( + Arc::new(Field::new( "a".to_string(), DataType::Dictionary( Box::new(DataType::Int32), Box::new(DataType::Utf8), ), true, - 0, - false, )), Arc::new( vec![Some("a"), None, Some("a")] @@ -2483,15 +2477,13 @@ mod tests { ) as ArrayRef, ), ( - Arc::new(Field::new_dict( + Arc::new(Field::new( "b".to_string(), DataType::Dictionary( Box::new(DataType::Int32), Box::new(DataType::Utf8), ), true, - 0, - false, )), Arc::new( vec![Some("b"), Some("c"), Some("b")] diff --git a/datafusion/proto-common/src/from_proto/mod.rs b/datafusion/proto-common/src/from_proto/mod.rs index 14375c0590a4f..11666486e49bd 100644 --- a/datafusion/proto-common/src/from_proto/mod.rs +++ b/datafusion/proto-common/src/from_proto/mod.rs @@ -321,6 +321,8 @@ impl TryFrom<&protobuf::Field> for Field { fn try_from(field: &protobuf::Field) -> Result { let datatype = field.arrow_type.as_deref().required("arrow_type")?; let field = if field.dict_id != 0 { + // TODO file a ticket about handling deprecated dict_id attributes + #[allow(deprecated)] Self::new_dict( field.name.as_str(), datatype, @@ -365,6 +367,8 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue { .as_ref() .ok_or_else(|| Error::required("value"))?; + // TODO file a ticket about handling deprecated dict_id attributes + #[allow(deprecated)] Ok(match value { Value::BoolValue(v) => Self::Boolean(Some(*v)), Value::Utf8Value(v) => Self::Utf8(Some(v.to_owned())), diff --git a/datafusion/proto-common/src/to_proto/mod.rs b/datafusion/proto-common/src/to_proto/mod.rs index 1b9583516ced3..25bda957ff8ff 100644 --- a/datafusion/proto-common/src/to_proto/mod.rs +++ b/datafusion/proto-common/src/to_proto/mod.rs @@ -97,6 +97,8 @@ impl TryFrom<&Field> for protobuf::Field { nullable: field.is_nullable(), children: Vec::new(), metadata: field.metadata().clone(), + // TODO file a ticket about handling deprecated dict_id attributes + #[allow(deprecated)] dict_id: field.dict_id().unwrap_or(0), dict_ordered: field.dict_is_ordered().unwrap_or(false), }) diff --git a/datafusion/proto/tests/cases/roundtrip_logical_plan.rs b/datafusion/proto/tests/cases/roundtrip_logical_plan.rs index f793e96f612b7..94478f3592af0 100644 --- a/datafusion/proto/tests/cases/roundtrip_logical_plan.rs +++ b/datafusion/proto/tests/cases/roundtrip_logical_plan.rs @@ -1777,6 +1777,8 @@ fn round_trip_datatype() { } } +// TODO file a ticket about handling deprecated dict_id attributes +#[allow(deprecated)] #[test] fn roundtrip_dict_id() -> Result<()> { let dict_id = 42;