andygrove commented on code in PR #3004:
URL: https://github.com/apache/datafusion-comet/pull/3004#discussion_r2712728394


##########
spark/src/main/scala/org/apache/comet/serde/structs.scala:
##########
@@ -230,3 +232,68 @@ object CometJsonToStructs extends 
CometExpressionSerde[JsonToStructs] {
     }
   }
 }
+
+object CometStructsToCsv extends CometExpressionSerde[StructsToCsv] {
+
+  private val incompatibleDataTypes = Seq(DateType, TimestampType, 
TimestampNTZType, BinaryType)
+
+  override def getSupportLevel(expr: StructsToCsv): SupportLevel = {
+    val dataTypes = expr.inputSchema.fields.map(_.dataType)
+    val containsComplexType = dataTypes.exists(DataTypeSupport.isComplexType)
+    if (containsComplexType) {
+      return Unsupported(
+        Some(
+          s"The schema ${expr.inputSchema} is not supported because it 
includes a complex type"))
+    }
+    val containsIncompatibleDataTypes = 
dataTypes.exists(incompatibleDataTypes.contains)
+    if (containsIncompatibleDataTypes) {
+      return Incompatible(
+        Some(
+          s"The schema ${expr.inputSchema} is not supported because " +
+            s"it includes a incompatible data types: $incompatibleDataTypes"))
+    }
+    Compatible()

Review Comment:
   Can we guarantee full compatibility with the `UnivocityGenerator` that Spark 
uses? Perhaps this should be marked as incompatible for now until we have 
sufficient fuzz testing to confirm compatibility?



-- 
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]

Reply via email to