Skip to content

Commit

Permalink
clean up tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGe00 committed Feb 18, 2024
1 parent 83f2357 commit 82bf185
Showing 1 changed file with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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\", "
Expand Down

0 comments on commit 82bf185

Please sign in to comment.