Skip to content

Commit

Permalink
Revert "[native] Add followup e2e test for table format"
Browse files Browse the repository at this point in the history
This reverts commit b036356.
  • Loading branch information
kewang1024 authored and xiaoxmeng committed Nov 6, 2024
1 parent 2555927 commit 4c2ecd6
Showing 1 changed file with 0 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,40 +74,6 @@ public void testCreateTableWithUnsupportedFormats()
}
}

@Test
public void testTableFormats()
{
// With different storage_format than table format, verify the data can be correctly read back
Session[] sessions = buildSessionsForTableWriteFormat();
for (String tableFormat : TABLE_FORMATS) {
for (Session session : sessions) {
// Unpartitioned table
String tmpTableName = generateRandomTableName();
try {
getQueryRunner().execute(session, String.format("CREATE TABLE %s WITH (format = '" + tableFormat + "') AS SELECT * FROM nation", tmpTableName));
assertQuery(String.format("SELECT * FROM %s", tmpTableName), "SELECT * FROM nation");
// TODO add support for presto to query each partition's format then verify written format is correct
}
finally {
dropTableIfExists(tmpTableName);
}

// Partitioned table
String partitionedOrdersTableName = generateRandomTableName();
try {
getQueryRunner().execute(session, String.format(
"CREATE TABLE %s WITH (format = '" + tableFormat + "', " +
"partitioned_by = ARRAY[ 'orderstatus' ]) " +
"AS SELECT custkey, comment, orderstatus FROM orders", partitionedOrdersTableName));
assertQuery(String.format("SELECT * FROM %s", partitionedOrdersTableName), "SELECT custkey, comment, orderstatus FROM orders");
}
finally {
dropTableIfExists(partitionedOrdersTableName);
}
}
}
}

@Test
public void testCreateUnpartitionedTableAsSelect()
{
Expand Down Expand Up @@ -445,24 +411,4 @@ private Session buildSessionForTableWrite()
.setCatalogSessionProperty("hive", "orc_compression_codec", "ZSTD")
.build();
}

private Session[] buildSessionsForTableWriteFormat()
{
Session.SessionBuilder sessionBuilder = Session.builder(getSession())
.setSystemProperty("scale_writers", "true")
.setSystemProperty("table_writer_merge_operator_enabled", "true")
.setSystemProperty("task_writer_count", "1")
.setSystemProperty("task_partitioned_writer_count", "2")
.setCatalogSessionProperty("hive", "collect_column_statistics_on_write", "true")
.setCatalogSessionProperty("hive", "orc_compression_codec", "ZSTD");
Session s1 = sessionBuilder
.setCatalogSessionProperty("hive", "hive_storage_format", "PARQUET")
.setCatalogSessionProperty("hive", "respect_table_format", "true").build();
Session s2 = sessionBuilder
.setCatalogSessionProperty("hive", "hive_storage_format", "PARQUET")
.setCatalogSessionProperty("hive", "respect_table_format", "false").build();
Session[] sessions = {s1, s2};

return sessions;
}
}

0 comments on commit 4c2ecd6

Please sign in to comment.