From 82bf18539af4448e831d30bf1c9b72376199b7b5 Mon Sep 17 00:00:00 2001 From: Kevin Ge Date: Sat, 17 Feb 2024 20:05:44 -0500 Subject: [PATCH] clean up tests --- .../rel2trino/HiveToTrinoConverterTest.java | 20 ------------------- 1 file changed, 20 deletions(-) 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 91460af6f..2989386a5 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 @@ -39,24 +39,6 @@ public void afterClass() throws IOException { FileUtils.deleteDirectory(new File(conf.get(TestUtils.CORAL_TRINO_TEST_DIR))); } - // @Test - // public void tmp() { - // RelNode relNode = TestUtils.getHiveToRelConverter().convertSql( - // "SELECT a, d, f FROM test.tableA LATERAL VIEW json_tuple(tableA.b.b1, 'trino', 'rocks') jt AS d, f"); - // // RelNode relNode = TestUtils.getHiveToRelConverter().convertView("test", "lateral_view_json_tuple_view"); - // // "SELECT a, d, e, f FROM test.tableA LATERAL VIEW json_tuple(b.b1, 'trino', 'always', 'rocks') jt AS d, e, f" - // RelToTrinoConverter relToTrinoConverter = TestUtils.getRelToTrinoConverter(); - // String expandedSql = relToTrinoConverter.convert(relNode); - // String expectedSql = "SELECT \"tablea\".\"a\" AS \"a\", \"t0\".\"d\" AS \"d\", \"t0\".\"f\" AS \"f\"\n" - // + "FROM \"test\".\"tablea\" AS \"tablea\"\nCROSS JOIN LATERAL (SELECT " - // + "\"if\"(\"REGEXP_LIKE\"('trino', '^[^\\\"]*$'), CAST(\"json_extract\"(\"tablea\".\"b\".\"b1\", '$[\"' || 'trino' || '\"]') AS VARCHAR(65535)), NULL) AS \"d\", " - // // + "\"if\"(\"REGEXP_LIKE\"('always', '^[^\\\"]*$'), CAST(\"json_extract\"(\"tablea\".\"b\".\"b1\", '$[\"' || 'always' || '\"]') AS VARCHAR(65535)), NULL) AS \"e\", " - // + "\"if\"(\"REGEXP_LIKE\"('rocks', '^[^\\\"]*$'), CAST(\"json_extract\"(\"tablea\".\"b\".\"b1\", '$[\"' || 'rocks' || '\"]') AS VARCHAR(65535)), NULL) AS \"f\"\n" - // // + "FROM (VALUES (0)) AS \"t\" (\"ZERO\")) AS \"t0\" (\"d\", \"e\", \"f\")"; - // + "FROM (VALUES (0)) AS \"t\" (\"ZERO\")) AS \"t0\" (\"d\", \"f\")"; - // assertEquals(expandedSql, expectedSql); - // } - @Test(dataProvider = "viewTestCases") public void testViews(String database, String view, String expectedSql) { RelNode relNode = TestUtils.getHiveToRelConverter().convertView(database, view); @@ -160,8 +142,6 @@ public Object[][] viewTestCasesProvider() { { "test", "date_function_view", "SELECT \"date\"('2021-01-02') AS \"a\"\n" + "FROM \"test\".\"tablea\" AS \"tablea\"" }, - // lateral_view_json_tuple_view - // SELECT a, d, e, f FROM test.tableA LATERAL VIEW json_tuple(b.b1, 'trino', 'always', 'rocks') jt AS d, e, f") { "test", "lateral_view_json_tuple_view", "SELECT \"tablea\".\"a\" AS \"a\", \"t0\".\"d\" AS \"d\", \"t0\".\"e\" AS \"e\", \"t0\".\"f\" AS \"f\"\n" + "FROM \"test\".\"tablea\" AS \"tablea\"\nCROSS JOIN LATERAL (SELECT " + "\"if\"(\"REGEXP_LIKE\"('trino', '^[^\\\"]*$'), CAST(\"json_extract\"(\"tablea\".\"b\".\"b1\", '$[\"' || 'trino' || '\"]') AS VARCHAR(65535)), NULL) AS \"d\", "