HyukjinKwon commented on code in PR #59931:
URL: https://github.com/apache/spark/pull/59931#discussion_r4417637004


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/ffi/NativeDataSource.scala:
##########
@@ -88,48 +89,56 @@ class NativeDataSource(
     if ((declared & NativeLibrary.BATCH_WRITE) != 0) {
       capabilities.add(BATCH_WRITE)
     }
-    if ((declared & NativeLibrary.TRUNCATE) != 0) {
+    if ((declared & NativeLibrary.BATCH_TRUNCATE) != 0) {
       capabilities.add(TRUNCATE)
     }
     capabilities
   }
 
+  // The readers and the writers export the schemas with the time zone of the 
session on the
+  // driver, also on the executors, where they pass the same schemas to the 
library again.
+
   override def batchPlanner(schema: StructType): ColumnarBatchPlanner = {
     NativeArrow.checkSupported(schema, name, "plan a scan of")
     val executorLocation = NativeDataSourceRegistry.distribute(location)
     val library = NativeLibraries.get(location)
+    val timeZoneId = SQLConf.get.sessionLocalTimeZone

Review Comment:
   Done in 84d446a: `NativeDataSource` reads the time zone once, in a field, 
for its four uses. `ArrowBatchingOptions` still reads it separately, in the 
same `createBatchWriterFactory` call.



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