Vinz2168 commented on code in PR #11783:
URL: https://github.com/apache/nifi/pull/11783#discussion_r4236774033


##########
nifi-extension-bundles/nifi-poi-bundle/nifi-poi-services/src/main/java/org/apache/nifi/excel/ExcelStartingRowSchemaInference.java:
##########
@@ -79,16 +93,24 @@ public RecordSchema inferSchema(RecordSource<Row> 
recordSource) throws IOExcepti
             } else {
                 if (RowEvaluationStrategy.STANDARD == rowEvaluationStrategy) {
                     if (index <= 
RowEvaluationStrategy.NUM_ROWS_TO_DETERMINE_TYPES) {
-                        inferSchema(row, fieldNames, typeMap);
+                        inferSchema(row, fieldNames, typeMap, 
ignoredCellsBySheet);
                     } else {
                         break;
                     }
                 } else {
-                    inferSchema(row, fieldNames, typeMap);
+                    inferSchema(row, fieldNames, typeMap, ignoredCellsBySheet);
                 }
             }
             index++;
         }
+
+        if (logger != null) {
+            for (Map.Entry<String, IgnoredCells> entry : 
ignoredCellsBySheet.entrySet()) {
+                final IgnoredCells ignoredCells = entry.getValue();
+                logger.warn("Ignored non-empty cells beyond the {} header 
columns in {} row(s) of sheet [{}], first at row {} column {}",
+                        fieldNames.size(), ignoredCells.rowCount(), 
entry.getKey(), ignoredCells.firstRowNumber(), ignoredCells.firstColumnName());
+            }
+        }

Review Comment:
   Thanks @dan-s1, applied all three suggestions in a50d8a2."



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