Skip to content

Commit 861f1df

Browse files
committed
fmt
1 parent af6c807 commit 861f1df

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ fn remap_dictionary_key_nulls(
258258
values: ArrayRef,
259259
) -> DataFusionResult<DictionaryArray<Int64Type>> {
260260
// fast path: no nulls in values
261-
if values.null_count() == 0{
261+
if values.null_count() == 0 {
262262
return Ok(DictionaryArray::new(keys, values));
263263
}
264264

tests/main.rs

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,11 +1280,13 @@ async fn test_dict_haystack() {
12801280
assert_batches_eq!(expected, &batches);
12811281
}
12821282

1283-
12841283
fn check_for_null_dictionary_values(array: &dyn Array) {
12851284
let array = array.as_any().downcast_ref::<DictionaryArray<Int64Type>>().unwrap();
12861285
let keys_array = array.keys();
1287-
let keys = keys_array.iter().filter_map(|x| x.map(|v| usize::try_from(v).unwrap())).collect::<Vec<_>>();
1286+
let keys = keys_array
1287+
.iter()
1288+
.filter_map(|x| x.map(|v| usize::try_from(v).unwrap()))
1289+
.collect::<Vec<_>>();
12881290
let values_array = array.values();
12891291
// no non-null keys should point to a null value
12901292
for i in 0..values_array.len() {
@@ -1330,20 +1332,8 @@ async fn test_dict_get_no_null_values() {
13301332

13311333
let sql = "select json_get_str(x, 'baz') v from data";
13321334
let expected = [
1333-
"+------+",
1334-
"| v |",
1335-
"+------+",
1336-
"| |",
1337-
"| fizz |",
1338-
"| |",
1339-
"| abcd |",
1340-
"| |",
1341-
"| fizz |",
1342-
"| fizz |",
1343-
"| fizz |",
1344-
"| fizz |",
1345-
"| |",
1346-
"+------+",
1335+
"+------+", "| v |", "+------+", "| |", "| fizz |", "| |", "| abcd |", "| |", "| fizz |",
1336+
"| fizz |", "| fizz |", "| fizz |", "| |", "+------+",
13471337
];
13481338
let batches = ctx.sql(&sql).await.unwrap().collect().await.unwrap();
13491339
assert_batches_eq!(expected, &batches);

0 commit comments

Comments
 (0)