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


##########
flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/sink/dynamic/TableUpdater.java:
##########
@@ -153,8 +153,12 @@ private TableMetadataCache.ResolvedSchemaInfo 
findOrCreateSchema(
           LOG.info(
               "Triggering schema update for table {} {} to {}", identifier, 
tableSchema, schema);
           UpdateSchema updateApi = table.updateSchema();
-          EvolveSchemaVisitor.visit(
-              identifier, updateApi, tableSchema, schema, caseSensitive, 
dropUnusedColumns);
+          try {
+            EvolveSchemaVisitor.visit(
+                identifier, updateApi, tableSchema, schema, caseSensitive, 
dropUnusedColumns);
+          } catch (IllegalArgumentException e) {
+            throw new DynamicRecordException(e.getMessage(), e);

Review Comment:
    Agreed, that is the rule now. DynamicRecordException is only thrown by 
in-memory steps that depend on the record's schema, spec, equality and 
distribution fields or data: the schema comparison, schema and spec evolution 
(validated with apply() before commit()), and the upsert and distribution 
checks. Catalog and commit calls are never classified, since their failures 
can't be told apart from transient ones: the REST client maps HTTP 400 to 
IllegalArgumentException/ValidationException, Glue throws 
IllegalStateException, and a closed client pool throws IllegalStateException. 
To keep the list complete, TestTypeMismatchFailures runs every ordered pair of 
25 types, as a column and nested in a struct, list or map, and asserts the 
outcome is either success or DynamicRecordException. 
TestTableUpdater#commitFailureIsNotRecordException pins the other side. Two 
cases that fit the rule only fail inside commit() or table creation: [dropping 
a partition source column, now covered / not covered
 ], and creating a table with a v3-only type, which depends on the format 
version the TableCreator picks.



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