Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,32 @@ public void testViewReferencingHiveAndIcebergTables()
onHive().executeQuery("DROP TABLE default.view_iceberg_table");
}

@Test(groups = HIVE_VIEWS)
public void testViewWithColumnAliasesDifferingInCase()
{
onHive().executeQuery("DROP TABLE IF EXISTS test_hive_namesake_column_name_a");
onHive().executeQuery("DROP TABLE IF EXISTS test_hive_namesake_column_name_b");
Comment thread
findinpath marked this conversation as resolved.
Outdated
onHive().executeQuery("CREATE TABLE test_hive_namesake_column_name_a(some_id string)");
onHive().executeQuery("CREATE TABLE test_hive_namesake_column_name_b(SOME_ID string)");
onHive().executeQuery("INSERT INTO TABLE test_hive_namesake_column_name_a VALUES ('hive')");
onHive().executeQuery("INSERT INTO TABLE test_hive_namesake_column_name_b VALUES (' hive ')");

onHive().executeQuery("DROP VIEW IF EXISTS test_namesake_column_names_view");
onHive().executeQuery("" +
"CREATE VIEW test_namesake_column_names_view AS \n" +
" SELECT a.some_id FROM test_hive_namesake_column_name_a a \n" +
" LEFT JOIN (SELECT trim(SOME_ID) AS SOME_ID FROM test_hive_namesake_column_name_b) b \n" +
" ON a.some_id = b.some_id \n" +
" WHERE a.some_id != ''");
assertViewQuery(
"SELECT * FROM test_namesake_column_names_view",
queryAssert -> queryAssert.containsOnly(row("hive")));

onHive().executeQuery("DROP TABLE test_hive_namesake_column_name_a");
onHive().executeQuery("DROP TABLE test_hive_namesake_column_name_b");
onHive().executeQuery("DROP VIEW test_namesake_column_names_view");
}

protected static void assertViewQuery(String query, Consumer<QueryAssert> assertion)
{
// Ensure Hive and Presto view compatibility by comparing the results
Expand Down