Skip to content

Commit

Permalink
support largelist for proto
Browse files Browse the repository at this point in the history
  • Loading branch information
Weijun-H committed Nov 21, 2023
1 parent 315cf48 commit 4f54551
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions datafusion/proto/proto/datafusion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ message ScalarValue{
// Literal Date32 value always has a unit of day
int32 date_32_value = 14;
ScalarTime32Value time32_value = 15;
ScalarListValue large_list_value = 16;
ScalarListValue list_value = 17;
ScalarListValue fixed_size_list_value = 18;

Expand Down
14 changes: 14 additions & 0 deletions datafusion/proto/src/generated/pbjson.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion datafusion/proto/src/generated/prost.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion datafusion/proto/src/logical_plan/from_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
Value::Float64Value(v) => Self::Float64(Some(*v)),
Value::Date32Value(v) => Self::Date32(Some(*v)),
// ScalarValue::List is serialized using arrow IPC format
Value::ListValue(scalar_list) | Value::FixedSizeListValue(scalar_list) => {
Value::ListValue(scalar_list)
| Value::FixedSizeListValue(scalar_list)
| Value::LargeListValue(scalar_list) => {
let protobuf::ScalarListValue {
ipc_message,
arrow_data,
Expand Down Expand Up @@ -703,6 +705,7 @@ impl TryFrom<&protobuf::ScalarValue> for ScalarValue {
let arr = record_batch.column(0);
match value {
Value::ListValue(_) => Self::List(arr.to_owned()),
Value::LargeListValue(_) => Self::LargeList(arr.to_owned()),
Value::FixedSizeListValue(_) => Self::FixedSizeList(arr.to_owned()),
_ => unreachable!(),
}
Expand Down
2 changes: 1 addition & 1 deletion datafusion/proto/src/logical_plan/to_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ impl TryFrom<&ScalarValue> for protobuf::ScalarValue {
)),
}),
ScalarValue::LargeList(_) => Ok(protobuf::ScalarValue {
value: Some(protobuf::scalar_value::Value::ListValue(
value: Some(protobuf::scalar_value::Value::LargeListValue(
scalar_list_value,
)),
}),
Expand Down

0 comments on commit 4f54551

Please sign in to comment.