You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/01/22 01:52:42 UTC

[GitHub] [spark] ueshin commented on a change in pull request #31285: [SPARK-33489][PYSPARK] Add NullType support for Arrow executions.

ueshin commented on a change in pull request #31285:
URL: https://github.com/apache/spark/pull/31285#discussion_r562317056



##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/arrow/ArrowWriter.scala
##########
@@ -80,9 +81,7 @@ object ArrowWriter {
 
 class ArrowWriter(val root: VectorSchemaRoot, fields: Array[ArrowFieldWriter]) {
 
-  def schema: StructType = StructType(fields.map { f =>
-    StructField(f.name, f.dataType, f.nullable)
-  })
+  def schema: StructType = ArrowUtils.fromArrowSchema(root.getSchema())

Review comment:
       As `NullVector` has a fixed field name `"$data$"` for some reason, we have to refer the schema from `VectorSchemaRoot` instead.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org