Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
Signed-off-by: jayzhan211 <[email protected]>
  • Loading branch information
jayzhan211 committed Jan 6, 2024
1 parent c7f348f commit bd98b9a
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 285 deletions.
21 changes: 8 additions & 13 deletions datafusion/common/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3022,20 +3022,15 @@ impl fmt::Display for ScalarValue {
.map(|(index, (column, field))| {
if nulls.is_some_and(|b| b.is_null(index)) {
format!("{}:NULL", field.name())
} else if let DataType::Struct(_) = field.data_type() {
let sv = ScalarValue::Struct(Arc::new(
column.as_struct().to_owned(),
));

format!("{}:{sv}", field.name())
} else {
if let DataType::Struct(_) = field.data_type() {
let sv = ScalarValue::Struct(Arc::new(
column.as_struct().to_owned(),
));

let name = field.name();
format!("{name}:{sv}")
} else {
let sv =
ScalarValue::try_from_array(column, 0).unwrap();
let name = field.name();
format!("{name}:{sv}")
}
let sv = ScalarValue::try_from_array(column, 0).unwrap();
format!("{}:{sv}", field.name())
}
})
.collect::<Vec<_>>()
Expand Down
17 changes: 6 additions & 11 deletions datafusion/proto/proto/datafusion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -933,13 +933,8 @@ message Union{
repeated int32 type_ids = 3;
}

message ScalarListValue {
bytes ipc_message = 1;
bytes arrow_data = 2;
Schema schema = 3;
}

message ScalarStructValue {
// Used for List/FixedSizeList/LargeList/Struct
message ScalarNestedValue {
bytes ipc_message = 1;
bytes arrow_data = 2;
Schema schema = 3;
Expand Down Expand Up @@ -1010,9 +1005,10 @@ 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;
ScalarNestedValue large_list_value = 16;
ScalarNestedValue list_value = 17;
ScalarNestedValue fixed_size_list_value = 18;
ScalarNestedValue struct_value = 32;

Decimal128 decimal128_value = 20;
Decimal256 decimal256_value = 39;
Expand All @@ -1032,7 +1028,6 @@ message ScalarValue{
bytes large_binary_value = 29;
ScalarTime64Value time64_value = 30;
IntervalMonthDayNanoValue interval_month_day_nano = 31;
ScalarStructValue struct_value = 32;
ScalarFixedSizeBinary fixed_size_binary_value = 34;
}
}
Expand Down
177 changes: 22 additions & 155 deletions datafusion/proto/src/generated/pbjson.rs

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

Loading

0 comments on commit bd98b9a

Please sign in to comment.