lcspinter commented on a change in pull request #2333:
URL: https://github.com/apache/hive/pull/2333#discussion_r643747277
##########
File path:
iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java
##########
@@ -155,6 +155,36 @@ public void after() throws Exception {
HiveIcebergStorageHandlerTestUtils.close(shell);
}
+ @Test
+ public void testPartitionTransform() {
+ Schema schema = new Schema(
+ optional(1, "id", Types.LongType.get()),
+ optional(2, "year_field", Types.DateType.get()),
+ optional(3, "month_field", Types.TimestampType.withZone()),
+ optional(4, "day_field", Types.TimestampType.withoutZone()),
+ optional(5, "hour_field", Types.TimestampType.withoutZone()),
+ optional(6, "truncate_field", Types.StringType.get()),
+ optional(7, "bucket_field", Types.StringType.get()),
+ optional(8, "identity_field", Types.StringType.get())
+ );
+ PartitionSpec spec =
PartitionSpec.builderFor(schema).year("year_field").month("month_field").day("day_field")
+ .hour("hour_field").truncate("truncate_field",
2).bucket("bucket_field", 2)
+ .identity("identity_field").build();
+ String tableName = "part_test";
+
+ TableIdentifier identifier = TableIdentifier.of("default", tableName);
+ shell.executeStatement("CREATE EXTERNAL TABLE " + identifier +
+ " PARTITIONED BY SPEC (year_field year, month_field month, day_field
day, hour_field hour, " +
+ "truncate_field truncate[2], bucket_field bucket[2], identity_field
identity)" +
+ " STORED BY '" + HiveIcebergStorageHandler.class.getName() + "' " +
+ testTables.locationForCreateTableSQL(identifier) +
+ "TBLPROPERTIES ('" + InputFormatConfig.TABLE_SCHEMA + "'='" +
+ SchemaParser.toJson(schema) + "', " +
+ "'" + InputFormatConfig.CATALOG_NAME + "'='" +
Catalogs.ICEBERG_DEFAULT_CATALOG_NAME + "')");
Review comment:
Removed it.
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]