aleksandar-trajkovic-db commented on code in PR #59671:
URL: https://github.com/apache/spark/pull/59671#discussion_r4415303011


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalog.scala:
##########
@@ -151,11 +153,28 @@ class JDBCTableCatalog extends TableCatalog
     }
   }
 
+  // The per-read value decides the resolved schema, so it must reach 
loadTable.
+  override def tableStateOptionKeys(): util.Set[String] =
+    util.Set.of(JDBCOptions.JDBC_ZONELESS_TIMESTAMP_AS_NTZ)
+
+  // Carries the state options down the default dispatch to loadTable(ident), 
so subclass
+  // overrides of loadTable(ident) and loadTable(ident, writePrivileges) stay 
in the path.
+  private val currentStateOptions =

Review Comment:
   Correct, just to clarify the call stack basically looks like this:
   1.  The 3-arg loadTable gets called first, in our case it saves the state 
options and calls the parent loadTable
   2. The parent loadTable then dispatches the 2-arg loadTable for writes, 
which then calls the 1-arg loadTable from before and for reads it dispatches 
the 1-arg loadTable.
   This all happens on the same thread resolving the table. The other loadTable 
methods are not orthogonal to the one we are currently using, but 
complementary. 



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