gaborkaszab commented on code in PR #5159:
URL: https://github.com/apache/iceberg/pull/5159#discussion_r928894935
##########
mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java:
##########
@@ -112,6 +112,8 @@ public class TestHiveIcebergStorageHandlerNoScan {
private static final Set<String> IGNORED_PARAMS =
ImmutableSet.of("bucketing_version", "numFilesErasureCoded");
+ private static final String DEFAULT_CATALOG_NAME = "default_iceberg";
+
Review Comment:
Not anymore. Dropped.
##########
hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalog.java:
##########
@@ -171,9 +172,17 @@ public boolean dropTable(TableIdentifier identifier,
boolean purge) {
false /* throw NoSuchObjectException if the table doesn't exist
*/);
return null;
});
-
if (purge && lastMetadata != null) {
CatalogUtil.dropTableData(ops.io(), lastMetadata);
+
+ Boolean shouldDropFullTableFolder =
Boolean.parseBoolean(lastMetadata.property(
+ TableProperties.DROP_FULL_TABLE_FOLDER,
+ String.valueOf(TableProperties.DROP_FULL_TABLE_FOLDER_DEFAULT)));
+ if (shouldDropFullTableFolder) {
+ ((HadoopFileIO) fileIO).deletePrefix(lastMetadata.location());
Review Comment:
Indeed, thx!
##########
mr/src/test/java/org/apache/iceberg/mr/hive/TestTables.java:
##########
@@ -189,16 +189,37 @@ public Table createTable(TestHiveShell shell, String
tableName, Schema schema, F
*/
public Table createTable(TestHiveShell shell, String tableName, Schema
schema, PartitionSpec spec,
FileFormat fileFormat, List<Record> records) {
+ return createTable(shell, tableName, schema, spec, fileFormat, records,
null);
+ }
+
+ /**
+ * Creates a partitioned Hive test table using Hive SQL. The table will be
in the 'default' database.
+ * The table will be populated with the provided List of {@link Record}s
using a Hive insert statement.
+ * @param shell The HiveShell used for Hive table creation
+ * @param tableName The name of the test table
+ * @param schema The schema used for the table creation
+ * @param spec The partition specification for the table
+ * @param fileFormat The file format used for writing the data
+ * @param records The records with which the table is populated
+ * @param properties Additional TblProperties to pass to the create table
statement
+ * @return The created table
+ * @throws IOException If there is an error writing data
+ */
+ public Table createTable(TestHiveShell shell, String tableName, Schema
schema, PartitionSpec spec,
Review Comment:
You mean I should put this test framework change into the Hive repo as well?
I can do so, I think the timing would be better after this PR is merged.
Unless if there is any restriction that changes like this should land in Hive
first.
--
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]