mattyb149 commented on a change in pull request #4750:
URL: https://github.com/apache/nifi/pull/4750#discussion_r556021114



##########
File path: 
nifi-nar-bundles/nifi-hive-bundle/nifi-hive_1_1-processors/src/main/java/org/apache/nifi/processors/hive/UpdateHive_1_1Table.java
##########
@@ -562,7 +686,35 @@ private synchronized void checkAndUpdateTableSchema(final 
ProcessSession session
                 outputPath = tableLocation + "/" + String.join("/", 
partitionColumnsLocationList);
             }
 
-            session.putAttribute(flowFile, ATTR_OUTPUT_PATH, outputPath);
+            // If updating field names, return a new RecordSchema, otherwise 
return null
+            OutputMetadataHolder outputMetadataHolder;
+            if (!tableCreated && updateFieldNames) {
+                List<RecordField> inputRecordFields = schema.getFields();
+                List<RecordField> outputRecordFields = new ArrayList<>();
+                Map<String,String> fieldMap = new HashMap<>();
+
+                for (RecordField inputRecordField : inputRecordFields) {
+                    final String inputRecordFieldName = 
inputRecordField.getFieldName();
+                    boolean found = false;
+                    for (String hiveColumnName : hiveColumns) {
+                        if 
(inputRecordFieldName.equalsIgnoreCase(hiveColumnName)) {

Review comment:
       Agreed, I will change the behavior and add the appropriate documentation.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to