andygrove commented on code in PR #7249:
URL: https://github.com/apache/datafusion-comet/pull/7249#discussion_r4697644784
##########
native/core/src/execution/operators/scan.rs:
##########
@@ -525,31 +468,27 @@ mod import_tests {
.add_buffer(under_aligned)
.build_unchecked()
};
-
- let schema: SchemaRef = Arc::new(Schema::new(vec![Field::new(
- "d",
- decimal_type.clone(),
- false,
- )]));
+ let fields = Fields::from(vec![Field::new("d", decimal_type, false)]);
let struct_data = unsafe {
- ArrayData::builder(DataType::Struct(schema.fields().clone()))
+ ArrayData::builder(DataType::Struct(fields.clone()))
.len(2)
.add_child_data(decimal)
.build_unchecked()
};
-
- let stream = one_batch_stream(Arc::clone(&schema), struct_data);
- let mut reader = ArrowArrayStreamReader::try_new(stream).unwrap();
- let batch = reader.next().unwrap().unwrap();
- let col = batch
- .column(0)
+ let array = FFI_ArrowArray::new(&struct_data);
+
+ // The same import `RecordBatchStreamReader::next` performs. (Arrow 60
made the
+ // `FFI_ArrowArrayStream` callbacks private, so a hand-rolled stream
is no longer possible.)
Review Comment:
Applied. (b5c92caa6b)
##########
native/core/src/execution/planner/aggregate.rs:
##########
@@ -254,17 +254,17 @@ impl OperatorBuilder for HashAggBuilder {
})
.collect();
- // DataFusion 55 runs Single over input sorted on some of its keys
with the legacy
- // GroupedHashAggregateStream, whose spill can fail against the fair
limit (#6880). Final
- // runs an OrderedFinalAggregateStream there, which spills, and which
the fair pool exempts
- // from that limit (`limited_to_its_share`). MergeAsPartial evaluates
to its state under
- // Final as under Single.
+ // A PartialMerge over input sorted on some of its keys runs as Final,
as a
+ // ClusteredFinalAggregateStream, which the fair pool exempts from its
fair limit
+ // (`limited_to_its_share`). It was added because DataFusion 55 ran
Single there with the
+ // legacy GroupedHashAggregateStream, whose spill could fail against
that limit (#6880).
+ // DataFusion 56 runs Single there as a
ClusteredSingleAggregateStream, which spills, so
+ // this may no longer be needed (#7765). MergeAsPartial evaluates to
its state
+ // under Final as under Single.
Review Comment:
Applied, and rewrote the `merge_as_partial.rs` module doc the same way: it
now says `Final` runs as a `ClusteredFinalAggregateStream` that the fair pool
exempts, and that #7765 tracks whether `Single` would do. I also dropped "from
DataFusion 56" from its `PartialReduce` sentence. (b5c92caa6b)
##########
native/core/src/parquet/cast_column/variant/tests.rs:
##########
@@ -977,14 +977,32 @@ fn
normalize_spark_empty_key_metadata_rejects_other_malformed_encodings() {
);
for malformed in [
- vec![1, 3, 0, 1, 1, 2, 0xff, b'a'], // Invalid UTF-8.
- vec![1, 3, 0, 2, 1, 2, b'z', b'a'], // Decreasing offsets.
- vec![1, 3, 0, 1, 1, 2, b'z', b'z'], // Duplicate dictionary keys.
- vec![1, 3, 0, 1, 1, 3, b'z', b'a'], // Out-of-bounds offset.
- vec![1, 3, 0, 1, 1, 2, b'z', b'a', 0], // Unexpected trailing bytes.
+ vec![1, 3, 0, 1, 1, 2, 0xff, b'a'], // Invalid UTF-8.
+ vec![1, 3, 0, 2, 1, 2, b'z', b'a'], // Decreasing offsets.
+ vec![1, 3, 0, 1, 1, 3, b'z', b'a'], // Out-of-bounds offset.
] {
assert!(normalize(&malformed).is_err(), "accepted {malformed:?}");
}
+ // Arrow 59 rejected both dictionaries only for their empty entry, which
Arrow 60 accepts
+ // (apache/arrow-rs#10352), so they no longer reach the empty-key retry.
Arrow does not reject
+ // the rest: an unsorted dictionary may repeat an entry, and bytes after
the last offset are
+ // never read. The row passes through unchanged, as in Spark, which checks
only the offsets
+ // of the keys it looks up.
Review Comment:
Applied. (b5c92caa6b)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]