danny0405 commented on code in PR #8478:
URL: https://github.com/apache/hudi/pull/8478#discussion_r1170757264


##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/util/HiveSchemaUtil.java:
##########
@@ -65,6 +67,34 @@ public class HiveSchemaUtil {
   public static final String BINARY_TYPE_NAME = "binary";
   public static final String DATE_TYPE_NAME = "date";
 
+  private static final String DATABASE_NAME = "DATABASE_NAME";
+  private static final String EXTERNAL = "external";
+  private static final String TABLE_NAME = "TABLE_NAME";
+  private static final String LIST_COLUMNS = "columns";
+  private static final String PARTITIONS = "partitions";
+  private static final String ROW_FORMAT = "row_format";
+  private static final String LOCATION = "location";
+  private static final String LOCATION_BLOCK = "location_block";
+  private static final String PROPERTIES = "properties";
+  private static final String BUCKETS = "buckets";
+
+  private static final String CREATE_DATABASE_STMT =
+      "CREATE DATABASE IF NOT EXISTS <" + DATABASE_NAME + ">";
+
+  private static final String CREATE_TABLE_TEMPLATE =
+      "CREATE <" + EXTERNAL + ">TABLE <if(" + DATABASE_NAME + ")>`<" + 
DATABASE_NAME + ">`.<endif>"
+      + "`<" + TABLE_NAME + ">`(\n"
+      + "<" + LIST_COLUMNS + ">)\n"
+      + "<" + PARTITIONS + ">\n"
+      + "<" + BUCKETS + ">\n"
+      + "<" + ROW_FORMAT + ">\n"
+      + "<" + LOCATION_BLOCK + ">"
+      + "TBLPROPERTIES (\n"
+      + "<" + PROPERTIES + ">)";

Review Comment:
   Not a fan of antlr, this introduces unnecessary complexity and dependency of 
the antlr jar, how about we refactor the code using just a string builder, each 
sub-clause can be built separately.



-- 
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: commits-unsubscr...@hudi.apache.org

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

Reply via email to