kbendick commented on a change in pull request #3435:
URL: https://github.com/apache/iceberg/pull/3435#discussion_r740423155



##########
File path: data/src/main/java/org/apache/iceberg/data/TableMigrationUtil.java
##########
@@ -129,6 +140,9 @@ private TableMigrationUtil() {
             try {
               ParquetMetadata metadata = ParquetFileReader.readFooter(conf, 
stat);
               metrics = ParquetUtil.footerMetrics(metadata, Stream.empty(), 
metricsSpec, mapping);
+              if 
(!canImportSchema(ParquetSchemaUtil.convert(metadata.getFileMetaData().getSchema()),
 schema)) {
+                throw new ValidationException("Mismatch in table and imported 
file schema");

Review comment:
       Non-blocking question: Should we consider throwing the 
`ValidationException` from canImportSchema, so that the non-matching fields 
will be most visible in the initial exception message?
   
   I can picture the support requests where the answer is "scroll up in the 
logs" just flooding in 🙈. Might be wise to cut that off as much as possible 
from the start.




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