turcsanyip commented on a change in pull request #4697:
URL: https://github.com/apache/nifi/pull/4697#discussion_r535663284



##########
File path: 
nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/UpdateHive3Table.java
##########
@@ -322,29 +411,55 @@ private synchronized void checkAndUpdateTableSchema(final 
ProcessSession session
                     s.execute(createTableSql);
                 }
 
-                // Now that the table is created, describe it and determine 
its location (for placing the flowfile downstream)
-                String describeTable = "DESC FORMATTED " + tableName;
-                ResultSet tableInfo = s.executeQuery(describeTable);
-                boolean moreRows = tableInfo.next();
-                boolean locationFound = false;
-                while (moreRows && !locationFound) {
-                    String line = tableInfo.getString(1);
-                    if (line.startsWith("Location:")) {
-                        locationFound = true;
-                        continue; // Don't do a next() here, need to get the 
second column value
-                    }
-                    moreRows = tableInfo.next();
-                }
-                outputPath = tableInfo.getString(2);
+                tableCreated = true;
+            }
 
-            } else {
-                List<String> hiveColumns = new ArrayList<>();
+            // Process the table (columns, partitions, location, etc.)
+            List<String> hiveColumns = new ArrayList<>();
 
-                String describeTable = "DESC FORMATTED " + tableName;
-                ResultSet tableInfo = s.executeQuery(describeTable);
-                // Result is 3 columns, col_name, data_type, comment. Check 
the first row for a header and skip if so, otherwise add column name
+            String describeTable = "DESC FORMATTED " + tableName;

Review comment:
       Backticks are missing around tablename which leads to an error in case 
of `_test_table` eg.




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