diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java index 652267d8a..48f909f54 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/HiveToTrinoConverterTest.java @@ -49,7 +49,7 @@ public void testViews(String database, String view, String expectedSql) { @DataProvider(name = "viewTestCases") public Object[][] viewTestCasesProvider() { - return new Object[][] { + return new Object[][] { { "test", "view_table_join_with_view_table_with_nested_columns", "..." }, { "test", "t_dot_star_view", "SELECT \"tablea\".\"a\" AS \"a\", \"tablea\".\"b\" AS \"b\", \"tablea0\".\"b\" AS \"tbb\"\n" + "FROM \"test\".\"tablea\" AS \"tablea\"\n" diff --git a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java index 0409333ff..f125538c0 100644 --- a/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java +++ b/coral-trino/src/test/java/com/linkedin/coral/trino/rel2trino/TestUtils.java @@ -414,6 +414,14 @@ public static void initializeTablesAndViews(HiveConf conf) throws HiveException, + "UNION ALL\n" + "SELECT a_tinyint, a_smallint, a_integer, a_bigint, a_float FROM test.table_with_mixed_columns"); + run(driver, "CREATE TABLE test.table_join_view_scenario_simple_table (key string)"); + run(driver, + "CREATE TABLE test.table_join_view_scenario_table_nested_columns (studentid struct, details struct>)"); + run(driver, + "CREATE VIEW test.view_table_join_view_scenario_table_nested_columns AS SELECT studentid.id student_id, details.name as student_name, details.misc.major major, details.lastUpdated details_last_updated FROM test.table_join_view_scenario_table_nested_columns"); + run(driver, + "CREATE VIEW test.view_table_join_with_view_table_with_nested_columns AS SELECT v.student_id, v.student_name, v.details_last_updated FROM test.view_table_join_view_scenario_table_nested_columns v INNER JOIN test.table_join_view_scenario_simple_table t ON concat('U', v.student_id) = t.key"); + // Tables used in RelToTrinoConverterTest run(driver, "CREATE TABLE IF NOT EXISTS test.tableOne(icol int, dcol double, scol string, tcol timestamp, acol array)");