tkalkirill commented on code in PR #2413:
URL: https://github.com/apache/ignite-3/pull/2413#discussion_r1285704640


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/SqlQueryProcessor.java:
##########
@@ -443,9 +444,15 @@ private CompletableFuture<AsyncSqlCursor<List<Object>>> 
querySingle0(
 
                     boolean implicitTxRequired = outerTx == null;
 
-                    tx.set(implicitTxRequired ? txManager.begin(!rwOp, null) : 
outerTx);
+                    InternalTransaction currentTx = implicitTxRequired ? 
txManager.begin(!rwOp, null) : outerTx;
 
-                    SchemaPlus schema = sqlSchemaManager.schema(schemaName);
+                    tx.set(currentTx);
+
+                    // TODO IGNITE-18733: wait for actual metadata for TX.
+                    HybridTimestamp txTimestamp = currentTx.startTimestamp();
+                    int observableCatalogVersion = 
catalogManager.activeCatalogVersion(txTimestamp.longValue());
+
+                    SchemaPlus schema = sqlSchemaManager.schema(schemaName, 
observableCatalogVersion);

Review Comment:
   > Maybe, we should either use CatalogSqlSchemaManager as sqlSchemaManager 
type, or add a method to SqlSchemaManager interface that will resolve a version 
by tx timestamp. WDYT?
   
   Yes, I like the option with an additional method.



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

Reply via email to