You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2022/07/13 19:50:05 UTC

[GitHub] [hive] cravani commented on a diff in pull request #3419: HIVE-26374: Query based compaction fails for tables with CDT and colu…

cravani commented on code in PR #3419:
URL: https://github.com/apache/hive/pull/3419#discussion_r920434176


##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java:
##########
@@ -419,15 +421,13 @@ private void defineColumns(StringBuilder query) {
     }
     List<FieldSchema> cols = sourceTab.getSd().getCols();
     boolean isFirst = true;
+    List<String> columnDescs = new ArrayList<String>();

Review Comment:
   Fixed the code.



##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java:
##########
@@ -419,15 +421,13 @@ private void defineColumns(StringBuilder query) {
     }
     List<FieldSchema> cols = sourceTab.getSd().getCols();
     boolean isFirst = true;

Review Comment:
   Removed!



##########
ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CompactionQueryBuilder.java:
##########
@@ -419,15 +421,13 @@ private void defineColumns(StringBuilder query) {
     }
     List<FieldSchema> cols = sourceTab.getSd().getCols();
     boolean isFirst = true;
+    List<String> columnDescs = new ArrayList<String>();
     for (FieldSchema col : cols) {
-      if (!isFirst) {
-        query.append(", ");
-      }
-      isFirst = false;
-      query.append("`").append(col.getName()).append("` ");
-      query.append(crud ? ":" : "");
-      query.append(col.getType());
+      String columnType = DDLPlanUtils.formatType(TypeInfoUtils.getTypeInfoFromTypeString(col.getType()));
+      String columnDesc = "`" + col.getName() + "`" + (crud ? ":" : "") + columnType;

Review Comment:
   We can add the extra space, honestly it won't make much of difference because this would be a temporary table and would be dropped after compaction.



-- 
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: gitbox-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org