kumarpritam863 commented on code in PR #18582:
URL: https://github.com/apache/iceberg/pull/18582#discussion_r4436258979


##########
flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableUpdater.java:
##########
@@ -78,8 +80,28 @@ private void findOrCreateTable(
       TableIdentifier identifier, Schema schema, PartitionSpec spec, 
TableCreator tableCreator) {
     Tuple2<Boolean, Exception> exists = cache.exists(identifier);
     if (Boolean.FALSE.equals(exists.f0)) {
-      if (exists.f1 instanceof NoSuchNamespaceException) {

Review Comment:
   - DynamicRecordProcessor.processRecord calls tableCache.exists() before it 
calls the updater. That caches the "not found" answer.
   - When TableUpdater asks again, it gets the cached answer with f1 == null. 
Gating on f1 would skip namespace creation on the immediate-update path.
   - Glue also throws NoSuchTableException for a missing namespace, not 
NoSuchNamespaceException.
   This block only runs when the table is missing, so it runs once per table 
creation. A single namespaceExists call is negligible there. The new 
testNamespaceCreatedWhenCatalogReportsMissingNamespaceAsMissingTable primes the 
cache with cache.exists(...) first, as the processor does. It fails on the old 
code.



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