comphead commented on code in PR #6927:
URL: https://github.com/apache/datafusion-comet/pull/6927#discussion_r4263843661
##########
spark/src/main/scala/org/apache/comet/serde/aggregates.scala:
##########
@@ -1475,14 +1475,16 @@ object AggSerde {
/**
* Shared support level for `Min` / `Max` based on the result data type.
Floats follow Spark's
- * ordering natively, so strict floating-point mode does not apply to them.
+ * ordering natively, so strict floating-point mode does not apply to them.
Spark and the native
+ * accumulators both compare strings and binary as unsigned bytes, except
that Spark orders a
+ * string with a non-default collation by that collation.
*/
- def minMaxSupportLevel(dt: DataType): SupportLevel = {
- if (!minMaxDataTypeSupported(dt)) {
- Unsupported(Some(s"Unsupported data type: $dt"))
- } else {
- Compatible()
- }
+ def minMaxSupportLevel(dt: DataType): SupportLevel = dt match {
+ case _: StringType if isStringCollationType(dt) =>
+ Unsupported(Some(ComparisonUtils.nonDefaultCollationReason("min/max")))
+ case _: StringType | BinaryType => Compatible()
Review Comment:
Thanks for measuring this. I agree with Andy's read: plain string and binary
`min`/`max` runs as ordered sort aggregates that emit each group as soon as it
completes, so the exposure is the hash shape next to a typed imperative
aggregate. #6936 tracks the fix in DataFusion's `MinMaxBytesState`, and as of
3752f31136 the new case in `minMaxSupportLevel` points at it.
--
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]