slfan1989 commented on code in PR #13956:
URL: https://github.com/apache/iceberg/pull/13956#discussion_r2324226904
##########
spark/v4.0/spark/src/test/java/org/apache/iceberg/spark/actions/TestRewriteTablePathsAction.java:
##########
@@ -1370,16 +1376,22 @@ private Table createMetastoreTable(
String sqlStr =
String.format(
"CREATE TABLE hive.%s.%s (c1 bigint, c2 string, c3 string)",
namespace, tableName);
+ if (partitionColumn != null && !partitionColumn.isEmpty()) {
+ sqlStr = String.format("%s USING iceberg PARTITIONED BY (%s)", sqlStr,
partitionColumn);
+ }
if (!location.isEmpty()) {
- sqlStr = String.format("%s USING iceberg LOCATION '%s'", sqlStr,
location);
+ sqlStr = String.format("%s LOCATION '%s'", sqlStr, location);
}
sql(sqlStr);
} else {
String sqlStr =
String.format(
"CREATE TABLE hive.%s.%s (c1 bigint, c2 string, c3 string)",
namespace, tableName);
+ if (partitionColumn != null && !partitionColumn.isEmpty()) {
+ sqlStr = String.format("%s USING iceberg PARTITIONED BY (%s)", sqlStr,
partitionColumn);
+ }
if (!location.isEmpty()) {
Review Comment:
@dramaticlly Thank you for the feedback! Optimized according to suggestions:
- Method renamed to generateCreateTableSQL (more semantic)
- Added complete method comments
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]