LuciferYang commented on code in PR #40610: URL: https://github.com/apache/spark/pull/40610#discussion_r1168174768
########## connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/SparkResult.scala: ########## @@ -70,22 +76,24 @@ private[sql] class SparkResult[T]( val reader = new ArrowStreamReader(ipcStreamBytes.newInput(), allocator) try { val root = reader.getVectorSchemaRoot - if (batches.isEmpty) { - if (structType == null) { - // If the schema is not available yet, fallback to the schema from Arrow. - structType = ArrowUtils.fromArrowSchema(root.getSchema) - } - // TODO: create encoders that directly operate on arrow vectors. + if (structType == null) { + // If the schema is not available yet, fallback to the schema from Arrow. + structType = ArrowUtils.fromArrowSchema(root.getSchema) + } + // TODO: create encoders that directly operate on arrow vectors. + if (boundEncoder == null) { boundEncoder = createEncoder(structType).resolveAndBind(structType.toAttributes) } + Review Comment: please revert this line -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org