grorge123 commented on code in PR #5526:
URL: https://github.com/apache/datafusion-comet/pull/5526#discussion_r3886564490
##########
spark/src/main/scala/org/apache/comet/codegen/CometBatchKernelCodegen.scala:
##########
@@ -117,7 +126,7 @@ object CometBatchKernelCodegen extends Logging with
CometExprTraitShim with Come
* nested-field count on `spark.sql.codegen.maxFields`.
*/
def canHandle(boundExpr: Expression): Option[String] = {
- if (!isSupportedDataType(boundExpr.dataType)) {
+ if (!isSupportedDataType(boundExpr.dataType, allowNullType = true)) {
Review Comment:
@/tmp/claude-1000/-home-grorge-Desktop-GITHUB-datafusion-comet/2910ab3b-81ad-4f39-b07f-11355921d1f8/scratchpad/reply-coalesce.md
##########
spark/src/main/scala/org/apache/comet/codegen/CometBatchKernelCodegen.scala:
##########
@@ -81,18 +81,27 @@ object CometBatchKernelCodegen extends Logging with
CometExprTraitShim with Come
/**
* Type surface the kernel covers on both input and output sides. Recursive:
complex types are
* supported when their children are.
+ *
+ * `NullType` is output-only: [[CometBatchKernelCodegenOutput]] can write an
all-null Arrow
+ * `NullVector`, but `CometScalaUDFCodegen.specFor` cannot build an
[[ArrowColumnSpec]] for one,
+ * so a `NullType` input (nested or not) has to keep falling back to Spark.
*/
- def isSupportedDataType(dt: DataType): Boolean = dt match {
+ def isSupportedDataType(dt: DataType): Boolean = isSupportedDataType(dt,
allowNullType = false)
+
+ private def isSupportedDataType(dt: DataType, allowNullType: Boolean):
Boolean = dt match {
+ case NullType => allowNullType
case BooleanType | ByteType | ShortType | IntegerType | LongType => true
case FloatType | DoubleType => true
case _: DecimalType => true
case _: StringType | _: BinaryType => true
case DateType | TimestampType | TimestampNTZType => true
case dt if isTimeType(dt) => true
case _: YearMonthIntervalType | _: DayTimeIntervalType |
CalendarIntervalType => true
- case ArrayType(inner, _) => isSupportedDataType(inner)
- case st: StructType => st.fields.forall(f =>
isSupportedDataType(f.dataType))
- case mt: MapType => isSupportedDataType(mt.keyType) &&
isSupportedDataType(mt.valueType)
+ case ArrayType(inner, _) => isSupportedDataType(inner, allowNullType)
+ case st: StructType => st.fields.forall(f =>
isSupportedDataType(f.dataType, allowNullType))
+ case mt: MapType =>
+ isSupportedDataType(mt.keyType, allowNullType) &&
Review Comment:
@/tmp/claude-1000/-home-grorge-Desktop-GITHUB-datafusion-comet/2910ab3b-81ad-4f39-b07f-11355921d1f8/scratchpad/reply-keys.md
--
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]