// The following should probably provide the type of the list,
// and report cardinality as ARRAY.
@Test
  public void testUnionType() throws Exception {
    String sql ="SELECT typeof(a) AS t, modeof(a) AS m, drilltypeof(a) AS dt\n" +
                "FROM cp.`jsoninput/union/c.json`";
    try {
      testBuilder()
        .optionSettingQueriesForTestQuery("alter session set `exec.enable_union_type` = true")
        .sqlQuery(sql)
        .ordered()
        .baselineColumns("t",       "m",        "dt")
        .baselineValues( "VARCHAR", "NULLABLE", "UNION")
        .baselineValues( "BIGINT",  "NULLABLE", "UNION")
        .baselineValues( "FLOAT8",  "NULLABLE", "UNION")
        // The following should probably provide the type of the list,
        // and report cardinality as ARRAY.
        .baselineValues( "LIST",    "NULLABLE", "UNION")
        .baselineValues( "NULL",    "NULLABLE", "UNION")
        .go();
    }
    finally {
      client.resetSession(ExecConstants.ENABLE_UNION_TYPE_KEY);
    }
  }
.baselineValues( "BIGINT", "NULLABLE", "UNION")
.baselineValues( "FLOAT8", "NULLABLE", "UNION")
// The following should probably provide the type of the list,
// and report cardinality as ARRAY.
.baselineValues( "LIST", "NULLABLE", "UNION")
.baselineValues( "NULL", "NULLABLE", "UNION")
"FROM cp.`jsoninput/union/c.json`";
try {
testBuilder()
.optionSettingQueriesForTestQuery("alter session set `exec.enable_union_type` = true")
.sqlQuery(sql)
.ordered()
.baselineColumns("t", "m", "dt")
.baselineValues( "VARCHAR", "NULLABLE", "UNION")
.baselineValues( "BIGINT", "NULLABLE", "UNION")
.baselineValues( "FLOAT8", "NULLABLE", "UNION")
// The following should probably provide the type of the list,
// and report cardinality as ARRAY.
.baselineValues( "LIST", "NULLABLE", "UNION")
.baselineValues( "NULL", "NULLABLE", "UNION")
.go();
}
finally {
client.resetSession(ExecConstants.ENABLE_UNION_TYPE_KEY);
}
}
@Test
public void testUnionType() throws Exception {
String sql ="SELECT typeof(a) AS t, modeof(a) AS m, drilltypeof(a) AS dt\n" +
"FROM cp.`jsoninput/union/c.json`";
try {
testBuilder()
.optionSettingQueriesForTestQuery("alter session set `exec.enable_union_type` = true")
.sqlQuery(sql)
.ordered()
.baselineColumns("t", "m", "dt")
.baselineValues( "VARCHAR", "NULLABLE", "UNION")
.baselineValues( "BIGINT", "NULLABLE", "UNION")
.baselineValues( "FLOAT8", "NULLABLE", "UNION")
// The following should probably provide the type of the list,
// and report cardinality as ARRAY.
.baselineValues( "LIST", "NULLABLE", "UNION")
.baselineValues( "NULL", "NULLABLE", "UNION")
.go();
}
finally {
client.resetSession(ExecConstants.ENABLE_UNION_TYPE_KEY);
}
}