From dc296f70ca356d6b38f60d89e3efec50a9bb773a Mon Sep 17 00:00:00 2001 From: Andy Lam Date: Thu, 9 Jul 2026 22:45:15 +0000 Subject: [PATCH 1/3] [SPARK-XXXXX][SQL][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing Remove the `--ONLY_IF spark` guard from the IN/EXISTS subquery golden-file tests and rewrite their temporary-view DDL into the portable `CREATE TEMPORARY VIEW t(cols) AS VALUES ...` form with ANSI-compatible literals, so the same query files can run against PostgreSQL under CrossDbmsQueryTestSuite. Also add debug/error logging to CrossDbmsQueryTestSuite to make per-query cross-DBMS mismatches easier to diagnose. Golden .out files still need to be regenerated with SPARK_GENERATE_GOLDEN_FILES=1. --- .../querytest/CrossDbmsQueryTestSuite.scala | 21 ++++- .../subquery/exists-subquery/exists-basic.sql | 58 ++++++------ .../subquery/exists-subquery/exists-cte.sql | 58 ++++++------ .../exists-joins-and-set-ops.sql | 88 +++++++++-------- .../exists-subquery/exists-orderby-limit.sql | 56 +++++------ .../exists-subquery/exists-outside-filter.sql | 61 ++++++------ .../exists-subquery/exists-within-and-or.sql | 58 ++++++------ .../subquery/in-subquery/in-group-by.sql | 86 ++++++++--------- .../inputs/subquery/in-subquery/in-having.sql | 84 ++++++++--------- .../subquery/in-subquery/in-order-by.sql | 90 +++++++++--------- .../in-subquery/in-set-operations.sql | 84 ++++++++--------- .../subquery/in-subquery/in-with-cte.sql | 92 +++++++++--------- .../subquery/in-subquery/nested-not-in.sql | 83 ++++++++-------- .../subquery/in-subquery/not-in-group-by.sql | 84 ++++++++--------- .../subquery/in-subquery/not-in-joins.sql | 84 ++++++++--------- ...not-in-unit-tests-multi-column-literal.sql | 6 +- .../not-in-unit-tests-multi-column.sql | 11 +-- ...ot-in-unit-tests-single-column-literal.sql | 6 +- .../not-in-unit-tests-single-column.sql | 11 +-- .../inputs/subquery/in-subquery/simple-in.sql | 94 +++++++++---------- 20 files changed, 579 insertions(+), 636 deletions(-) diff --git a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/querytest/CrossDbmsQueryTestSuite.scala b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/querytest/CrossDbmsQueryTestSuite.scala index c959aae8e91e6..286a03ce4f4d2 100644 --- a/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/querytest/CrossDbmsQueryTestSuite.scala +++ b/connector/docker-integration-tests/src/test/scala/org/apache/spark/sql/jdbc/querytest/CrossDbmsQueryTestSuite.scala @@ -100,7 +100,9 @@ trait CrossDbmsQueryTestSuite extends DockerJDBCIntegrationSuite with SQLQueryTe val conn = getConnection() val stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY) - val outputs: Seq[QueryTestOutput] = queries.map { sql => + val outputs: Seq[QueryTestOutput] = queries.zipWithIndex.map { case (sql, queryIdx) => + log.debug(s"[${testCase.name}] Executing query #$queryIdx against $DATABASE_NAME: " + + s"${sql.take(120).replace('\n', ' ')}${if (sql.length > 120) "..." else ""}") val output = { try { val sparkDf = localSparkSession.sql(sql) @@ -122,6 +124,8 @@ trait CrossDbmsQueryTestSuite extends DockerJDBCIntegrationSuite with SQLQueryTe } } val output = rows.map(_.mkString("\t")).toSeq + log.debug(s"[${testCase.name}] Query #$queryIdx returned ${output.size} rows from " + + s"$DATABASE_NAME") if (isSemanticallySorted(sparkDf.queryExecution.analyzed)) { output } else { @@ -129,7 +133,10 @@ trait CrossDbmsQueryTestSuite extends DockerJDBCIntegrationSuite with SQLQueryTe output.sorted } } catch { - case NonFatal(e) => Seq(e.getClass.getName, e.getMessage) + case NonFatal(e) => + log.warn(s"[${testCase.name}] Query #$queryIdx threw ${e.getClass.getName} " + + s"against $DATABASE_NAME: ${Option(e.getMessage).getOrElse("(no message)")}") + Seq(e.getClass.getName, e.getMessage) } } @@ -164,9 +171,19 @@ trait CrossDbmsQueryTestSuite extends DockerJDBCIntegrationSuite with SQLQueryTe } outputs.zip(expectedOutputs).zipWithIndex.foreach { case ((output, expected), i) => + if (output.sql != expected.sql) { + log.error(s"[${testCase.name}] SQL text mismatch for query #$i:\n" + + s" Expected (golden): ${expected.sql.take(200)}\n" + + s" Actual (input): ${output.sql.take(200)}") + } assertResult(expected.sql, s"SQL query did not match for query #$i\n${expected.sql}") { output.sql } + if (output.output != expected.output) { + log.error(s"[${testCase.name}] Output mismatch for query #$i (${output.sql.take(80)}):\n" + + s" Expected (Spark golden):\n${expected.output.take(500)}\n" + + s" Actual ($DATABASE_NAME):\n${output.output.take(500)}") + } assertResult(expected.output, s"Result did not match" + s" for query #$i\n${expected.sql}") { output.output diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-basic.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-basic.sql index 4055f798ad85d..2b26d6e08e4ae 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-basic.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-basic.sql @@ -1,38 +1,34 @@ --- Tests EXISTS subquery support. Tests basic form +-- Tests EXISTS subquery support. Tests basic form -- of EXISTS subquery (both EXISTS and NOT EXISTS) ---ONLY_IF spark -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id); +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70); -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); -- uncorrelated exist query -- TC.01.01 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-cte.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-cte.sql index ea8c0fc36ccfc..397bd8c4dfc36 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-cte.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-cte.sql @@ -1,38 +1,34 @@ --- Tests EXISTS subquery used along with +-- Tests EXISTS subquery used along with -- Common Table Expressions(CTE) ---ONLY_IF spark -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id); +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70); -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); -- CTE used inside subquery with correlated condition -- TC.01.01 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-joins-and-set-ops.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-joins-and-set-ops.sql index 1542fa5149aaf..3a4ce12691df6 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-joins-and-set-ops.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-joins-and-set-ops.sql @@ -13,38 +13,34 @@ --CONFIG_DIM2 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM2 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN ---ONLY_IF spark -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id); +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70); -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); -- Join in outer query block -- TC.01.01 @@ -244,78 +240,78 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' UNION SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' UNION SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX"); + WHERE dept_id = emp.dept_id and state = 'TX'); diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql index 9ff3409b21a37..a4d22bd518ac4 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-orderby-limit.sql @@ -5,38 +5,34 @@ --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN ---ONLY_IF spark -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id); +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70); -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); -- order by in both outer and/or inner query block -- TC.01.01 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-outside-filter.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-outside-filter.sql index 585de247b11c5..9f18eb5e196f7 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-outside-filter.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-outside-filter.sql @@ -1,38 +1,33 @@ -- Tests EXISTS subquery support where the subquery is used outside the WHERE clause. ---ONLY_IF spark - -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id); - -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); - -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70); + +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); + +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); -- uncorrelated select exist -- TC.01.01 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-within-and-or.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-within-and-or.sql index 5920b61dade52..922520e0e9cbf 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-within-and-or.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/exists-subquery/exists-within-and-or.sql @@ -1,38 +1,34 @@ --- Tests EXISTS subquery support. Tests EXISTS +-- Tests EXISTS subquery support. Tests EXISTS -- subquery within a AND or OR expression. ---ONLY_IF spark -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id); +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70); -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); -- Or used in conjunction with exists - ExistenceJoin diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql index 3161ac148e221..e7318aefc9f43 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql @@ -6,52 +6,48 @@ --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN ---ONLY_IF spark -create temporary view t1 as select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- GROUP BY in parent side @@ -118,7 +114,7 @@ WHERE t1c IN (SELECT t2c WHERE t1a = t2a) GROUP BY t1a, t1c -HAVING t1a = "t1b"; +HAVING t1a = 't1b'; -- GROUP BY in subquery -- TC 01.07 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql index 4d11ea7005b3b..ebb99f47ef5cc 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql @@ -4,52 +4,48 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false ---ONLY_IF spark -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- HAVING in the subquery diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql index 7fbb1c12924fc..3007ec61698af 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql @@ -9,53 +9,49 @@ --CONFIG_DIM2 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM2 spark.sql.optimizeNullAwareAntiJoin=false ---ONLY_IF spark - -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); - -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); - -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); + +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); + +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null); + +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- ORDER BY in parent side diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql index 3df495e0524fe..de7539228f78e 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql @@ -1,53 +1,49 @@ -- A test suite for set-operations in parent side, subquery, and both predicate subquery -- It includes correlated cases. ---ONLY_IF spark --SET spark.sql.autoBroadcastJoinThreshold=-1 -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- UNION, UNION ALL, UNION DISTINCT, INTERSECT and EXCEPT in the parent diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql index 8d08cfb4da346..7ef34d5454c7a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql @@ -1,55 +1,51 @@ -- A test suite for in with cte in parent side, subquery, and both predicate subquery -- It includes correlated cases. ---ONLY_IF spark --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- outside CTE @@ -58,7 +54,7 @@ WITH cte1 AS (SELECT t1a, t1b FROM t1 - WHERE t1a = "val1a") + WHERE t1a = 'val1a') SELECT t1a, t1b, t1c, @@ -139,7 +135,7 @@ WITH cte1 ON t1c = t2c LEFT JOIN t3 ON t2d = t3d) - AND t1a = "val1b") + AND t1a = 'val1b') SELECT * FROM (SELECT * FROM cte1 @@ -189,7 +185,7 @@ WITH cte1 AS SELECT t2b FROM t2 FULL OUTER JOIN T3 on t2a = t3a WHERE t1c = t2c) AND - t1a = "val1b") + t1a = 'val1b') SELECT * FROM ( SELECT * @@ -247,7 +243,7 @@ WITH cte1 AS (SELECT t1a, t1b FROM t1 - WHERE t1a = "val1d") + WHERE t1a = 'val1d') SELECT t1a, t1b, t1c, diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql index 9472690d99143..21cc4801df66c 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql @@ -1,52 +1,47 @@ -- Tests NOT-IN subqueries nested inside OR expression(s). ---ONLY_IF spark --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", 10), - (200, "emp 2", NULL), - (300, "emp 3", 20), - (400, "emp 4", 30), - (500, "emp 5", NULL), - (600, "emp 6", 100), - (800, "emp 8", 70) -AS EMP(id, emp_name, dept_id); - -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state); - -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt); - -CREATE TEMPORARY VIEW ADDRESS AS SELECT * FROM VALUES - (100, "emp 1", "addr1"), - (200, null, "addr2"), - (null, "emp 3", "addr3"), - (null, null, "addr4"), - (600, "emp 6", "addr6"), - (800, "emp 8", "addr8") -AS ADDRESS(id, emp_name, address); - -CREATE TEMPORARY VIEW S1 AS SELECT * FROM VALUES - (null, null), (5, 5), (8, 8), (11, 11) AS s1(a, b); -CREATE TEMPORARY VIEW S2 AS SELECT * FROM VALUES - (7, 7), (8, 8), (11, 11), (null, null) AS s2(c, d); +CREATE TEMPORARY VIEW EMP(id, emp_name, dept_id) AS VALUES + (100, 'emp 1', 10), + (200, 'emp 2', NULL), + (300, 'emp 3', 20), + (400, 'emp 4', 30), + (500, 'emp 5', NULL), + (600, 'emp 6', 100), + (800, 'emp 8', 70); + +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'); + +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00); + +CREATE TEMPORARY VIEW ADDRESS(id, emp_name, address) AS VALUES + (100, 'emp 1', 'addr1'), + (200, null, 'addr2'), + (null, 'emp 3', 'addr3'), + (null, null, 'addr4'), + (600, 'emp 6', 'addr6'), + (800, 'emp 8', 'addr8'); + +CREATE TEMPORARY VIEW S1(a, b) AS VALUES + (null, null), (5, 5), (8, 8), (11, 11); +CREATE TEMPORARY VIEW S2(c, d) AS VALUES + (7, 7), (8, 8), (11, 11), (null, null); -- null produced from both sides. -- TC.01.01 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql index 97da00ac2cefd..6df3f0ae43084 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql @@ -1,57 +1,53 @@ -- A test suite for NOT IN GROUP BY in parent side, subquery, and both predicate subquery -- It includes correlated cases. ---ONLY_IF spark -- Test aggregate operator with codegen on and off. --CONFIG_DIM1 spark.sql.codegen.wholeStage=true --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql index 639034c18f31b..e380fea328a69 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql @@ -1,55 +1,51 @@ -- A test suite for not-in-joins in parent side, subquery, and both predicate subquery -- It includes correlated cases. ---ONLY_IF spark --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- different not JOIN in parent side diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql index e9f3fda9c1b92..096d8e0ceddc2 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql @@ -6,14 +6,12 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false ---ONLY_IF spark -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, null), (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b); + (4, 5.0); -- Case 1 (not possible to write a literal with no rows, so we ignore it.) -- (subquery is empty -> row is returned) diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql index d5a30950b7fe7..a0841bd4d42c4 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql @@ -15,23 +15,20 @@ -- This can be generalized to include more tests for more columns, but it covers the main cases -- when there is more than one column. ---ONLY_IF spark --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, null), (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b); + (4, 5.0); -CREATE TEMPORARY VIEW s AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW s(c, d) AS VALUES (null, null), (0, 1.0), (2, 3.0), - (4, null) - AS s(c, d); + (4, null); -- Case 1 -- (subquery is empty -> row is returned) diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql index 2c3aed95a13ba..133f4e7d8e56c 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql @@ -6,13 +6,11 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false ---ONLY_IF spark -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b); + (4, 5.0); -- Uncorrelated NOT IN Subquery test cases -- Case 1 (not possible to write a literal with no rows, so we ignore it.) diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql index bbf5dce38a962..e98e7077c0930 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql @@ -33,19 +33,16 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false ---ONLY_IF spark -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b); + (4, 5.0); -CREATE TEMPORARY VIEW s AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW s(c, d) AS VALUES (null, 1.0), (2, 3.0), - (6, 7.0) - AS s(c, d); + (6, 7.0); -- Uncorrelated NOT IN Subquery test cases -- Case 1 diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql index 98f1f3d52cbb0..93aca803f56d3 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql @@ -3,53 +3,49 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false ---ONLY_IF spark -create temporary view t1 as select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i); +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'); -create temporary view t2 as select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i); +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null); -create temporary view t3 as select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i); +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'); -- correlated IN subquery -- simple select @@ -114,13 +110,11 @@ WHERE t1a NOT IN (SELECT t2a FROM t2); -- DDLs -create temporary view a as select * from values - (1, 1), (2, 1), (null, 1), (1, 3), (null, 3), (1, null), (null, 2) - as a(a1, a2); +create temporary view a(a1, a2) as values + (1, 1), (2, 1), (null, 1), (1, 3), (null, 3), (1, null), (null, 2); -create temporary view b as select * from values - (1, 1, 2), (null, 3, 2), (1, null, 2), (1, 2, null) - as b(b1, b2, b3); +create temporary view b(b1, b2, b3) as values + (1, 1, 2), (null, 3, 2), (1, null, 2), (1, 2, null); -- TC 02.01 SELECT a1, a2 From 605cb78468484fdc87e2ec1ef1c1a7dee3385f3d Mon Sep 17 00:00:00 2001 From: Andy Lam Date: Thu, 9 Jul 2026 23:37:08 +0000 Subject: [PATCH 2/3] Regenerate subquery golden files for portable view DDL Generated with SPARK_GENERATE_GOLDEN_FILES=1 after removing --ONLY_IF spark and rewriting the temporary-view DDL to the portable CREATE TEMPORARY VIEW t(cols) AS VALUES form. The literal-type changes (dropping S/L/float/BD suffixes) shift column types (smallint->int, float/double->decimal), which is reflected in the regenerated schemas. --- .../exists-subquery/exists-basic.sql.out | 250 ++-- .../exists-subquery/exists-cte.sql.out | 226 ++- .../exists-joins-and-set-ops.sql.out | 586 +++----- .../exists-orderby-limit.sql.out | 450 +++--- .../exists-outside-filter.sql.out | 284 ++-- .../exists-within-and-or.sql.out | 208 ++- .../subquery/in-subquery/in-group-by.sql.out | 717 ++++------ .../subquery/in-subquery/in-having.sql.out | 356 ++--- .../subquery/in-subquery/in-order-by.sql.out | 463 +++--- .../in-subquery/in-set-operations.sql.out | 1266 +++++++---------- .../subquery/in-subquery/in-with-cte.sql.out | 458 +++--- .../in-subquery/nested-not-in.sql.out | 370 ++--- .../in-subquery/not-in-group-by.sql.out | 304 ++-- .../subquery/in-subquery/not-in-joins.sql.out | 410 +++--- ...in-unit-tests-multi-column-literal.sql.out | 30 +- .../not-in-unit-tests-multi-column.sql.out | 108 +- ...n-unit-tests-single-column-literal.sql.out | 36 +- .../not-in-unit-tests-single-column.sql.out | 120 +- .../subquery/in-subquery/simple-in.sql.out | 398 +++--- .../exists-subquery/exists-basic.sql.out | 143 +- .../exists-subquery/exists-cte.sql.out | 115 +- .../exists-joins-and-set-ops.sql.out | 345 +++-- .../exists-orderby-limit.sql.out | 441 +++--- .../exists-outside-filter.sql.out | 131 +- .../exists-within-and-or.sql.out | 99 +- .../subquery/in-subquery/in-group-by.sql.out | 123 +- .../subquery/in-subquery/in-having.sql.out | 101 +- .../subquery/in-subquery/in-order-by.sql.out | 177 ++- .../in-subquery/in-set-operations.sql.out | 281 ++-- .../subquery/in-subquery/in-with-cte.sql.out | 111 +- .../in-subquery/nested-not-in.sql.out | 74 +- .../in-subquery/not-in-group-by.sql.out | 87 +- .../subquery/in-subquery/not-in-joins.sql.out | 95 +- ...in-unit-tests-multi-column-literal.sql.out | 3 +- .../not-in-unit-tests-multi-column.sql.out | 6 +- ...n-unit-tests-single-column-literal.sql.out | 3 +- .../not-in-unit-tests-single-column.sql.out | 6 +- .../subquery/in-subquery/simple-in.sql.out | 115 +- 38 files changed, 4014 insertions(+), 5482 deletions(-) diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-basic.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-basic.sql.out index 81c4a15dc9f4a..d61d2f078f3e4 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-basic.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-basic.sql.out @@ -1,81 +1,69 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (hiredate,None), (salary,None), (dept_id,None)], VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -92,16 +80,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter ((dept_id#x > 10) AND (dept_id#x < 30)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -117,16 +101,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -143,16 +123,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter ((outer(dept_id#x) = dept_id#x) OR isnull(outer(dept_id#x))) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -169,16 +145,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -195,16 +167,12 @@ Project [emp_name#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -220,16 +188,12 @@ Project [dept_id#x, dept_name#x, state#x] : +- Filter (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -246,16 +210,12 @@ Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) OR (outer(state#x) = NJ)) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -269,19 +229,15 @@ WHERE NOT EXISTS (SELECT * Project [emp_name#x, bonus_amt#x] +- Filter NOT exists#x [bonus_amt#x] : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- Filter ((emp_name#x = emp_name#x) AND (outer(bonus_amt#x) > salary#x)) + : +- Filter ((emp_name#x = emp_name#x) AND (outer(bonus_amt#x) > cast(salary#x as decimal(6,2)))) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -297,16 +253,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (emp_name#x = outer(emp_name#x)) : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : +- Project [emp_name#x, bonus_amt#x] - : +- SubqueryAlias BONUS - : +- LocalRelation [emp_name#x, bonus_amt#x] + : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -327,19 +279,13 @@ Project [emp_name#x, bonus_amt#x] : : +- Filter (dept_id#x = outer(dept_id#x)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-cte.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-cte.sql.out index abaf6a2432251..f6f2a60476a3b 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-cte.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-cte.sql.out @@ -1,81 +1,69 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (hiredate,None), (salary,None), (dept_id,None)], VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -111,24 +99,18 @@ WithCTE : : +- Join Inner, (dept_id#x = dept_id#x) : : :- SubqueryAlias emp : : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) -: : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] -: : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -: : : +- SubqueryAlias EMP -: : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +: : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: : +- Project [dept_id#x, dept_name#x, state#x] -: : +- SubqueryAlias DEPT -: : +- LocalRelation [dept_id#x, dept_name#x, state#x] +: : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: : +- LocalRelation [col1#x, col2#x, col3#x] : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) -: +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] -: +- Project [emp_name#x, bonus_amt#x] -: +- SubqueryAlias BONUS -: +- LocalRelation [emp_name#x, bonus_amt#x] +: +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] +: +- LocalRelation [col1#x, col2#x] +- Project [emp_name#x, bonus_amt#x] - +- Filter ((bonus_amt#x > cast(30 as double)) AND exists#x [emp_name#x]) + +- Filter ((bonus_amt#x > cast(cast(30 as decimal(2,0)) as decimal(6,2))) AND exists#x [emp_name#x]) : +- Project [1 AS 1#x] : +- Filter (outer(emp_name#x) = emp_name#x) : +- SubqueryAlias b @@ -137,10 +119,8 @@ WithCTE +- SubqueryAlias a +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -168,20 +148,16 @@ WithCTE : +- Filter ((id#x >= 100) AND (id#x <= 300)) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) -: +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] -: +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -: +- SubqueryAlias EMP -: +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +: +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] :- CTERelationDef xxxx, false : +- SubqueryAlias dept_cte : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter (dept_id#x = 10) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- Project [emp_name#x, bonus_amt#x] +- Filter exists#x [emp_name#x] : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x, dept_id#x, dept_name#x, state#x] @@ -195,10 +171,8 @@ WithCTE : +- CTERelationRef xxxx, true, [dept_id#x, dept_name#x, state#x], false, false +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -231,20 +205,16 @@ WithCTE : +- Filter ((id#x >= 100) AND (id#x <= 300)) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) -: +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] -: +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -: +- SubqueryAlias EMP -: +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +: +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] :- CTERelationDef xxxx, false : +- SubqueryAlias dept_cte : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter (dept_id#x = 10) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- Distinct +- Project [emp_name#x, bonus_amt#x] +- Filter (((dept_id#x = dept_id#x) AND (emp_name#x = emp_name#x)) AND exists#x [emp_name#x]) @@ -262,20 +232,16 @@ WithCTE : :- SubqueryAlias b : : +- SubqueryAlias bonus : : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : : +- Project [emp_name#x, bonus_amt#x] - : : +- SubqueryAlias BONUS - : : +- LocalRelation [emp_name#x, bonus_amt#x] + : : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : : +- LocalRelation [col1#x, col2#x] : +- SubqueryAlias e : +- SubqueryAlias emp_cte : +- CTERelationRef xxxx, true, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x], false, false +- SubqueryAlias d +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -306,16 +272,12 @@ WithCTE : +- Join LeftOuter, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) -: : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] -: : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -: : +- SubqueryAlias EMP -: : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +: : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- Aggregate [emp_name#x], [emp_name#x, sum(bonus_amt#x) AS sum(bonus_amt)#x] +- Filter exists#x [] : +- Project [dept_id#x, max(salary)#x] @@ -325,10 +287,8 @@ WithCTE : +- CTERelationRef xxxx, true, [id#x, salary#x, emp_name#x, dept_id#x], false, false +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -359,16 +319,12 @@ WithCTE : +- Join LeftOuter, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) -: : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] -: : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -: : +- SubqueryAlias EMP -: : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +: : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- Aggregate [emp_name#x], [emp_name#x, sum(bonus_amt#x) AS sum(bonus_amt)#x] +- Filter NOT exists#x [] : +- Project [dept_id#x, max(salary)#x] @@ -378,7 +334,5 @@ WithCTE : +- CTERelationRef xxxx, true, [id#x, salary#x, emp_name#x, dept_id#x], false, false +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out index 55b10125f7680..1b699c6a6cc83 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out @@ -1,81 +1,69 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (hiredate,None), (salary,None), (dept_id,None)], VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -93,23 +81,17 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x, dept_id#x, dept_name : +- Filter (emp_name#x = outer(emp_name#x)) : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : +- Project [emp_name#x, bonus_amt#x] - : +- SubqueryAlias BONUS - : +- LocalRelation [emp_name#x, bonus_amt#x] + : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : +- LocalRelation [col1#x, col2#x] +- Join Inner :- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -127,23 +109,17 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x, dept_id#x, dept_name : +- Filter (emp_name#x = outer(emp_name#x)) : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : +- Project [emp_name#x, bonus_amt#x] - : +- SubqueryAlias BONUS - : +- LocalRelation [emp_name#x, bonus_amt#x] + : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : +- LocalRelation [col1#x, col2#x] +- Join Inner, (dept_id#x = dept_id#x) :- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -161,23 +137,17 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x, dept_id#x, dept_name : +- Filter (emp_name#x = outer(emp_name#x)) : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : +- Project [emp_name#x, bonus_amt#x] - : +- SubqueryAlias BONUS - : +- LocalRelation [emp_name#x, bonus_amt#x] + : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : +- LocalRelation [col1#x, col2#x] +- Join LeftOuter, (dept_id#x = dept_id#x) :- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -195,23 +165,17 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x, dept_id#x, dept_name : +- Filter (emp_name#x = outer(emp_name#x)) : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : +- Project [emp_name#x, bonus_amt#x] - : +- SubqueryAlias BONUS - : +- LocalRelation [emp_name#x, bonus_amt#x] + : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : +- LocalRelation [col1#x, col2#x] +- Join Inner :- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias dept +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] + +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -230,22 +194,16 @@ Project [emp_name#x, bonus_amt#x] : +- Join Inner, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -264,22 +222,16 @@ Project [emp_name#x, bonus_amt#x] : +- Join RightOuter, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -305,22 +257,16 @@ Project [emp_name#x, bonus_amt#x] : +- Join Inner, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -348,22 +294,16 @@ Aggregate [emp_name#x], [emp_name#x, sum(bonus_amt#x) AS sum(bonus_amt)#x] : +- Join Inner, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -391,22 +331,16 @@ Aggregate [emp_name#x], [emp_name#x, sum(bonus_amt#x) AS sum(bonus_amt)#x] : +- Join Inner, (dept_id#x = dept_id#x) : :- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -429,24 +363,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter (dept_id#x < 30) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x >= 30) AND (dept_id#x <= 50)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -468,24 +396,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter (dept_id#x < 30) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x >= 30) AND (dept_id#x <= 50)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -507,24 +429,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter (dept_id#x < 30) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x >= 30) AND (dept_id#x <= 50)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -555,24 +471,18 @@ Union false, false : : :- Project [dept_id#x, dept_name#x, state#x] : : : +- SubqueryAlias dept : : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: : : +- Project [dept_id#x, dept_name#x, state#x] -: : : +- SubqueryAlias DEPT -: : : +- LocalRelation [dept_id#x, dept_name#x, state#x] +: : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x] : : +- Project [dept_id#x, dept_name#x, state#x] : : +- Filter (dept_id#x > 50) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: : +- Project [dept_id#x, dept_name#x, state#x] -: : +- SubqueryAlias DEPT -: : +- LocalRelation [dept_id#x, dept_name#x, state#x] +: : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: : +- LocalRelation [col1#x, col2#x, col3#x] : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) -: +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] -: +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -: +- SubqueryAlias EMP -: +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +: +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [] : +- Intersect false @@ -580,24 +490,18 @@ Union false, false : : +- Filter (dept_id#x < 30) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x >= 30) AND (dept_id#x <= 50)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -629,24 +533,18 @@ Distinct : : :- Project [dept_id#x, dept_name#x, state#x] : : : +- SubqueryAlias dept : : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : : +- Project [dept_id#x, dept_name#x, state#x] - : : : +- SubqueryAlias DEPT - : : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x] : : +- Project [dept_id#x, dept_name#x, state#x] : : +- Filter (dept_id#x > 50) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [] : +- Intersect false @@ -654,24 +552,18 @@ Distinct : : +- Filter (dept_id#x < 30) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x >= 30) AND (dept_id#x <= 50)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -679,11 +571,11 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' UNION SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [dept_id#x && dept_id#x] @@ -693,24 +585,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -718,11 +604,11 @@ SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' UNION SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter NOT exists#x [dept_id#x && dept_id#x] @@ -732,24 +618,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -757,11 +637,11 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [dept_id#x && dept_id#x] @@ -770,24 +650,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -795,11 +669,11 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [dept_id#x && dept_id#x] @@ -808,24 +682,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -833,11 +701,11 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [dept_id#x && dept_id#x] @@ -846,24 +714,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -871,11 +733,11 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter exists#x [dept_id#x && dept_id#x] @@ -884,24 +746,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -909,11 +765,11 @@ SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter NOT exists#x [dept_id#x && dept_id#x] @@ -922,24 +778,18 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -947,11 +797,11 @@ SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query analysis Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +- Filter NOT exists#x [dept_id#x && dept_id#x] @@ -960,21 +810,15 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = CA)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [dept_id#x, dept_name#x, state#x] : +- Filter ((dept_id#x = outer(dept_id#x)) AND (state#x = TX)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-orderby-limit.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-orderby-limit.sql.out index 25bd87d8afd9c..fad907a07f831 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-orderby-limit.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-orderby-limit.sql.out @@ -1,81 +1,69 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (hiredate,None), (salary,None), (dept_id,None)], VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -96,16 +84,12 @@ Sort [hiredate#x ASC NULLS FIRST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -127,16 +111,12 @@ Sort [hiredate#x DESC NULLS LAST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -160,16 +140,12 @@ Sort [hiredate#x ASC NULLS FIRST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -193,16 +169,12 @@ Sort [hiredate#x ASC NULLS FIRST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -223,16 +195,12 @@ Sort [hiredate#x ASC NULLS FIRST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -252,16 +220,12 @@ Project [emp_name#x] : +- Filter (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -281,16 +245,12 @@ Aggregate [count(1) AS count(1)#xL] : +- Filter (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -314,16 +274,12 @@ Sort [hiredate#x ASC NULLS FIRST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -347,16 +303,12 @@ Sort [hiredate#x ASC NULLS FIRST], true : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -375,16 +327,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 10) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -402,16 +350,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Aggregate [state#x], [max(dept_id#x) AS max(dept_id)#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -430,16 +374,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 100) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -459,16 +399,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 100) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -493,16 +429,12 @@ Project [emp_name#x] : +- Filter (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -523,16 +455,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 10) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -551,16 +479,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > outer(dept_id#x)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -580,16 +504,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Aggregate [state#x], [max(dept_id#x) AS max(dept_id)#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -609,16 +529,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter NOT (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -634,19 +550,15 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- GlobalLimit 1 : +- LocalLimit 1 : +- Aggregate [max(dept_id#x) AS max(dept_id)#x] - : +- Filter (outer(salary#x) > cast(200 as double)) + : +- Filter (outer(salary#x) > cast(cast(200 as decimal(3,0)) as decimal(5,2))) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -663,19 +575,15 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- GlobalLimit 1 : +- LocalLimit 1 : +- Aggregate [state#x], [state#x, max(dept_name#x) AS max(dept_name)#x] - : +- Filter (outer(salary#x) > cast(200 as double)) + : +- Filter (outer(salary#x) > cast(cast(200 as decimal(3,0)) as decimal(5,2))) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -696,16 +604,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 100) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -727,16 +631,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 100) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -757,16 +657,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter NOT (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -784,16 +680,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 10) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -810,16 +702,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Aggregate [state#x], [max(dept_id#x) AS max(dept_id)#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -837,16 +725,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 100) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -865,13 +749,9 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (dept_id#x > 100) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-outside-filter.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-outside-filter.sql.out index d15466f04f800..b94fa74d38467 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-outside-filter.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-outside-filter.sql.out @@ -1,81 +1,69 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (hiredate,None), (salary,None), (dept_id,None)], VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -92,16 +80,12 @@ Project [emp_name#x, exists#x [] AS exists()#x] : +- Filter ((dept_id#x > 10) AND (dept_id#x < 30)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -117,16 +101,12 @@ Project [emp_name#x, exists#x [dept_id#x] AS exists(dept_id)#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -143,16 +123,12 @@ Aggregate [sum(salary#x) AS sum(salary)#x, sum(salary#x) FILTER (WHERE exists#x : +- Filter ((dept_id#x > 10) AND (dept_id#x < 30)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -168,16 +144,12 @@ Aggregate [sum(salary#x) AS sum(salary)#x, sum(salary#x) FILTER (WHERE exists#x : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -196,24 +168,18 @@ Aggregate [sum(salary#x) AS sum(salary)#x, sum(salary#x) FILTER (WHERE (exists#x : : +- Filter (outer(dept_id#x) = dept_id#x) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: : +- Project [dept_id#x, dept_name#x, state#x] -: : +- SubqueryAlias DEPT -: : +- LocalRelation [dept_id#x, dept_name#x, state#x] +: : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [1 AS 1#x] : +- Filter (outer(emp_name#x) = emp_name#x) : +- SubqueryAlias bonus : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) -: +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] -: +- Project [emp_name#x, bonus_amt#x] -: +- SubqueryAlias BONUS -: +- LocalRelation [emp_name#x, bonus_amt#x] +: +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] +: +- LocalRelation [col1#x, col2#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -229,16 +195,12 @@ Aggregate [sum(distinct salary#x) AS sum(DISTINCT salary)#x, count(distinct hire : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -255,16 +217,12 @@ Aggregate [exists#x [dept_id#x]], [count(hiredate#x) AS count(hiredate)#xL, sum( : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -281,16 +239,12 @@ Aggregate [exists#x [dept_id#x]], [count(distinct hiredate#x) AS count(DISTINCT : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -310,24 +264,18 @@ Aggregate [count(CASE WHEN exists#x [] THEN 1 END) AS count(CASE WHEN exists() T : : +- Filter ((dept_id#x > 10) AND (dept_id#x < 30)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: : +- Project [dept_id#x, dept_name#x, state#x] -: : +- SubqueryAlias DEPT -: : +- LocalRelation [dept_id#x, dept_name#x, state#x] +: : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [1 AS 1#x] : +- Filter ((dept_id#x > 10) AND (dept_id#x < 30)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -345,24 +293,18 @@ Aggregate [count(CASE WHEN exists#x [dept_id#x] THEN 1 END) AS count(CASE WHEN e : : +- Filter (outer(dept_id#x) = dept_id#x) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: : +- Project [dept_id#x, dept_name#x, state#x] -: : +- SubqueryAlias DEPT -: : +- LocalRelation [dept_id#x, dept_name#x, state#x] +: : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [1 AS 1#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) -: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] +: +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -382,16 +324,12 @@ Project [emp_name#x, sum(salary) OVER (PARTITION BY exists() ROWS BETWEEN UNBOUN : +- Filter ((dept_id#x > 10) AND (dept_id#x < 30)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -410,13 +348,9 @@ Project [emp_name#x, sum(salary) OVER (PARTITION BY exists(dept_id) ROWS BETWEEN : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-within-and-or.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-within-and-or.sql.out index 7b846e5eae9c8..980d1f7830851 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-within-and-or.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/exists-subquery/exists-within-and-or.sql.out @@ -1,81 +1,69 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (hiredate,None), (salary,None), (dept_id,None)], VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -92,16 +80,12 @@ Project [emp_name#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -118,16 +102,12 @@ Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] : +- Filter (outer(dept_id#x) = dept_id#x) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -148,24 +128,18 @@ Project [emp_name#x] : : +- Filter ((outer(dept_id#x) = dept_id#x) AND (dept_id#x = 20)) : : +- SubqueryAlias dept : : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : : +- Project [dept_id#x, dept_name#x, state#x] - : : +- SubqueryAlias DEPT - : : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [state#x] : +- Filter ((outer(dept_id#x) = dept_id#x) AND (dept_id#x = 30)) : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] -- !query @@ -183,27 +157,21 @@ WHERE ( NOT EXISTS (SELECT * Project [emp_name#x, bonus_amt#x] +- Filter (NOT exists#x [bonus_amt#x] OR exists#x [bonus_amt#x]) : :- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- Filter ((emp_name#x = emp_name#x) AND (outer(bonus_amt#x) > salary#x)) + : : +- Filter ((emp_name#x = emp_name#x) AND (outer(bonus_amt#x) > cast(salary#x as decimal(6,2)))) : : +- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- Filter ((emp_name#x = emp_name#x) OR (outer(bonus_amt#x) < salary#x)) + : +- Filter ((emp_name#x = emp_name#x) OR (outer(bonus_amt#x) < cast(salary#x as decimal(6,2)))) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -223,24 +191,18 @@ emp_name IN Project [emp_name#x, bonus_amt#x] +- Filter (NOT exists#x [bonus_amt#x] AND emp_name#x IN (list#x [bonus_amt#x])) : :- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- Filter ((emp_name#x = emp_name#x) AND (outer(bonus_amt#x) > salary#x)) + : : +- Filter ((emp_name#x = emp_name#x) AND (outer(bonus_amt#x) > cast(salary#x as decimal(6,2)))) : : +- SubqueryAlias emp : : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : : +- SubqueryAlias EMP - : : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] : +- Project [emp_name#x] - : +- Filter (outer(bonus_amt#x) < salary#x) + : +- Filter (outer(bonus_amt#x) < cast(salary#x as decimal(6,2))) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as date) AS hiredate#x, cast(col4#x as decimal(5,2)) AS salary#x, cast(col5#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x] +- SubqueryAlias bonus +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] + +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-group-by.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-group-by.sql.out index 5a253f633bb11..f61ac3b1aec5e 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-group-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-group-by.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -118,17 +106,13 @@ Aggregate [t1a#x], [t1a#x, avg(t1b#x) AS avg(t1b)#x] +- Filter t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -141,22 +125,18 @@ WHERE t1b IN (SELECT t2b GROUP BY t1a, t1d -- !query analysis -Aggregate [t1a#x, t1d#xL], [t1a#x, max(t1b#x) AS max(t1b)#x] +Aggregate [t1a#x, t1d#x], [t1a#x, max(t1b#x) AS max(t1b)#x] +- Filter t1b#x IN (list#x [t1a#x]) : +- Project [t2b#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -174,17 +154,13 @@ Aggregate [t1a#x, t1b#x], [t1a#x, t1b#x] : +- Project [t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -205,25 +181,19 @@ Aggregate [t1a#x, t1c#x], [t1a#x, sum(distinct t1b#x) AS sum(DISTINCT t1b)#xL] : :- Project [t2c#x] : : +- Filter (outer(t1a#x) = t2a#x) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3c#x] : +- Filter (outer(t1a#x) = t3a#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -244,25 +214,19 @@ Aggregate [t1a#x, t1c#x], [t1a#x, sum(distinct t1b#x) AS sum(DISTINCT t1b)#xL] : :- Project [t2c#x] : : +- Filter (outer(t1a#x) = t2a#x) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3c#x] : +- Filter (outer(t1a#x) = t3a#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -274,7 +238,7 @@ WHERE t1c IN (SELECT t2c WHERE t1a = t2a) GROUP BY t1a, t1c -HAVING t1a = "t1b" +HAVING t1a = 't1b' -- !query analysis Filter (t1a#x = t1b) +- Aggregate [t1a#x, t1c#x], [t1a#x, count(distinct t1b#x) AS count(DISTINCT t1b)#xL] @@ -282,17 +246,13 @@ Filter (t1a#x = t1b) : +- Project [t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -302,21 +262,17 @@ WHERE t1b IN (SELECT Max(t2b) FROM t2 GROUP BY t2a) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1b#x IN (list#x []) : +- Aggregate [t2a#x], [max(t2b#x) AS max(t2b)#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -337,17 +293,13 @@ Project [t2a#x, t2b#x] : +- Project [t1a#x] : +- Filter (t1b#x = outer(t2b#x)) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -359,22 +311,18 @@ WHERE t1b IN (SELECT Min(t2b) AND t1c = t2c GROUP BY t2a) -- !query analysis -Aggregate [count(distinct t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x) AS count(DISTINCT t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i)#xL] +Aggregate [count(distinct t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x) AS count(DISTINCT t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i)#xL] +- Filter t1b#x IN (list#x [t1a#x && t1c#x]) : +- Aggregate [t2a#x], [min(t2b#x) AS min(t2b)#x] : +- Filter ((outer(t1a#x) = t2a#x) AND (outer(t1c#x) = t2c#x)) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -395,17 +343,13 @@ Project [t1a#x, t1b#x] : +- Aggregate [t2a#x, t2c#x], [max(t2c#x) AS max(t2c)#x, t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -427,23 +371,17 @@ Project [t1a#x, t1b#x] : : +- Aggregate [t3b#x], [min(t3a#x) AS min(t3a)#x] : : +- Filter (t3a#x = outer(t2a#x)) : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -461,17 +399,13 @@ Aggregate [t1a#x], [t1a#x, min(t1b#x) AS min(t1b)#x] : +- Aggregate [t2a#x], [min(t2c#x) AS min(t2c)#x] : +- Filter (t2b#x = outer(t1b#x)) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -488,30 +422,24 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t1a, t1d -- !query analysis -Aggregate [t1a#x, t1d#xL], [t1a#x, min(t1b#x) AS min(t1b)#x] +Aggregate [t1a#x, t1d#x], [t1a#x, min(t1b#x) AS min(t1b)#x] +- Filter t1c#x IN (list#x []) : +- Aggregate [t2c#x], [min(t2c#x) AS min(t2c)#x] : +- Filter t2b#x IN (list#x [t2a#x]) : : +- Aggregate [t3a#x], [min(t3b#x) AS min(t3b)#x] : : +- Filter (outer(t2a#x) = t3a#x) : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -529,29 +457,23 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t1a -- !query analysis Aggregate [t1a#x], [t1a#x, min(t1b#x) AS min(t1b)#x] -+- Filter (t1c#x IN (list#x [t1b#x]) AND t1d#xL IN (list#x [t1c#x])) ++- Filter (t1c#x IN (list#x [t1b#x]) AND t1d#x IN (list#x [t1c#x])) : :- Aggregate [t2a#x], [min(t2c#x) AS min(t2c)#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- Aggregate [t3d#xL], [t3d#xL] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Aggregate [t3d#x], [t3d#x] : +- Filter (outer(t1c#x) = t3c#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -569,29 +491,23 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t1a -- !query analysis Aggregate [t1a#x], [t1a#x, min(t1b#x) AS min(t1b)#x] -+- Filter (t1c#x IN (list#x [t1b#x]) OR t1d#xL IN (list#x [t1c#x])) ++- Filter (t1c#x IN (list#x [t1b#x]) OR t1d#x IN (list#x [t1c#x])) : :- Aggregate [t2a#x], [min(t2c#x) AS min(t2c)#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- Aggregate [t3d#xL], [t3d#xL] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Aggregate [t3d#x], [t3d#x] : +- Filter (outer(t1c#x) = t3c#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -613,32 +529,26 @@ HAVING Min(t1b) IS NOT NULL -- !query analysis Filter isnotnull(min(t1b)#x) +- Aggregate [t1a#x], [t1a#x, min(t1b#x) AS min(t1b)#x] - +- Filter (t1c#x IN (list#x [t1a#x && t1b#x]) OR t1d#xL IN (list#x [t1d#xL && t1c#x])) + +- Filter (t1c#x IN (list#x [t1a#x && t1b#x]) OR t1d#x IN (list#x [t1d#x && t1c#x])) : :- Project [min(t2c)#x] : : +- Filter (t2a#x > outer(t1a#x)) : : +- Aggregate [t2a#x], [min(t2c#x) AS min(t2c)#x, t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- Filter (t3d#xL = outer(t1d#xL)) - : +- Aggregate [t3d#xL], [t3d#xL] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Filter (t3d#x = outer(t1d#x)) + : +- Aggregate [t3d#x], [t3d#x] : +- Filter (outer(t1c#x) = t3c#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -648,8 +558,8 @@ where t1f IN (SELECT RANK() OVER (partition by t3c order by t2b) as s FROM t2, t3 where t2.t2c = t3.t3c and t2.t2a < t1.t1a) -- !query analysis Project [t1a#x] -+- Filter t1f#x IN (list#x [t1a#x]) - : +- Project [cast(s#x as double) AS s#x] ++- Filter cast(t1f#x as decimal(11,1)) IN (list#x [t1a#x]) + : +- Project [cast(s#x as decimal(11,1)) AS s#x] : +- Project [s#x] : +- Project [t3c#x, t2b#x, s#x, s#x] : +- Window [rank(t2b#x) windowspecdefinition(t3c#x, t2b#x ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS s#x], [t3c#x], [t2b#x ASC NULLS FIRST] @@ -657,23 +567,17 @@ Project [t1a#x] : +- Filter ((t2c#x = t3c#x) AND (t2a#x < outer(t1a#x))) : +- Join Inner : :- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -687,17 +591,13 @@ Sort [t1a#x ASC NULLS FIRST], true +- Aggregate [t1a#x], [t1a#x, t1a#x IN (list#x []) AS v1#x] : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -709,24 +609,18 @@ FROM t1 Aggregate [count(cast(t1a#x IN (list#x []) as int)) AS count(CAST((t1a IN (listquery())) AS INT))#xL, sum(cast(NOT t1b#x IN (list#x []) as int)) AS sum(CAST((NOT (t1b IN (listquery()))) AS INT))#xL] : :- Project [t2a#x] : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2b#x] : +- SubqueryAlias t2 -: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- SubqueryAlias t2 -: +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -743,17 +637,13 @@ Sort [t1a#x ASC NULLS FIRST], true +- Filter t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -771,17 +661,13 @@ Sort [t1a#x ASC NULLS FIRST], true +- Aggregate [t1a#x], [t1a#x, CASE WHEN t1a#x IN (list#x []) THEN 10 ELSE -10 END AS v1#x] : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -803,35 +689,26 @@ GROUP BY t1.t1c ORDER BY t1.t1c -- !query analysis Sort [t1c#x ASC NULLS FIRST], true -+- Aggregate [t1c#x], [t1c#x, sum(CASE WHEN t1c#x IN (list#x []) THEN 10 ELSE -10 END) AS v1#xL, sum(CASE WHEN t1d#xL IN (list#x []) THEN 10 ELSE -10 END) AS v2#xL, (t1c#x + 10) IN (list#x []) AS v3#x, count(t1c#x) AS ct#xL, count(t1d#xL) AS count(t1d)#xL] ++- Aggregate [t1c#x], [t1c#x, sum(CASE WHEN t1c#x IN (list#x []) THEN 10 ELSE -10 END) AS v1#xL, sum(CASE WHEN t1d#x IN (list#x []) THEN 10 ELSE -10 END) AS v2#xL, (t1c#x + 10) IN (list#x []) AS v3#x, count(t1c#x) AS ct#xL, count(t1d#x) AS count(t1d)#xL] : :- Project [t2c#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : :- Project [cast(t2c#x as bigint) AS t2c#xL] - : : +- Project [t2c#x] - : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : :- Project [t2c#x] + : : +- SubqueryAlias t2 + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [(t2c#x + 2) AS (t2c + 2)#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -846,17 +723,13 @@ FROM t1 Aggregate [sum(CASE WHEN t1c#x IN (list#x []) THEN 10 ELSE -10 END) AS v1#xL, count(t1c#x) AS ct#xL] : +- Project [t2c#x] : +- SubqueryAlias t2 -: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- SubqueryAlias t2 -: +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -872,42 +745,30 @@ GROUP BY Aggregate [(cast(t1a#x IN (list#x []) as int) + 1)], [(cast(t1a#x IN (list#x []) as int) + 1) AS groupExpr#x, sum((cast(t1a#x IN (list#x []) as int) + 1)) AS aggExpr#xL, ((cast(t1a#x IN (list#x []) as int) + 1) + cast(exists#x [] as int)) AS complexExpr#x] : :- Project [t2a#x] : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : :- Project [t2a#x] : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : :- Project [t2a#x] : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : :- Project [t2a#x] : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2a#x] : +- SubqueryAlias t2 -: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- SubqueryAlias t2 -: +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-having.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-having.sql.out index 3e6f3ab1a0d6b..6361f6c80c8d9 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-having.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-having.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -118,20 +106,16 @@ WHERE t1b IN (SELECT t2b -- !query analysis Project [t1a#x, t1b#x, t1h#x] +- Filter t1b#x IN (list#x []) - : +- Filter (cast(t2b#x as int) < 10) + : +- Filter (t2b#x < 10) : +- Aggregate [t2b#x], [t2b#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -148,21 +132,17 @@ WHERE t1b IN (SELECT Min(t2b) Project [t1a#x, t1b#x, t1c#x] +- Filter t1b#x IN (list#x [t1a#x]) : +- Project [min(t2b)#x] - : +- Filter (cast(t2b#x as int) > 1) + : +- Filter (t2b#x > 1) : +- Aggregate [t2b#x], [min(t2b#x) AS min(t2b)#x, t2b#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -174,23 +154,19 @@ WHERE t1b IN (SELECT t2b GROUP BY t1a, t1b, t1c HAVING t1b < 10 -- !query analysis -Filter (cast(t1b#x as int) < 10) +Filter (t1b#x < 10) +- Aggregate [t1a#x, t1b#x, t1c#x], [t1a#x, t1b#x, t1c#x] +- Filter t1b#x IN (list#x [t1c#x]) : +- Project [t2b#x] : +- Filter (outer(t1c#x) < t2c#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -209,17 +185,13 @@ Project [t1a#x, t1b#x, t1c#x] : +- Project [t2b#x] : +- Filter (outer(t1c#x) = t2c#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -234,24 +206,20 @@ WHERE t1c IN (SELECT t2c GROUP BY t1b HAVING t1b >= 8 -- !query analysis -Filter (cast(t1b#x as int) >= 8) +Filter (t1b#x >= 8) +- Aggregate [t1b#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x] +- Filter t1c#x IN (list#x [t1a#x]) : +- Filter (t2c#x > 10) : +- Aggregate [t2c#x], [t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -273,25 +241,19 @@ Filter t1a#x IN (list#x []) : : +- Project [t3b#x] : : +- Filter (outer(t2c#x) = t3c#x) : : +- SubqueryAlias t3 -: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) -: : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] -: : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] -: : +- SubqueryAlias t3 -: : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) +: : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 -: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- SubqueryAlias t2 -: +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Aggregate [t1a#x], [t1a#x, max(t1b#x) AS max(t1b)#x] - +- Filter (cast(t1b#x as int) > 0) + +- Filter (t1b#x > 0) +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -306,23 +268,19 @@ WHERE t1a NOT IN (SELECT t2a GROUP BY t1a, t1c HAVING Min(t1d) > t1c -- !query analysis -Filter (min(t1d)#xL > cast(t1c#x as bigint)) -+- Aggregate [t1a#x, t1c#x], [t1a#x, t1c#x, min(t1d#xL) AS min(t1d)#xL] +Filter (min(t1d)#x > t1c#x) ++- Aggregate [t1a#x, t1c#x], [t1a#x, t1c#x, min(t1d#x) AS min(t1d)#x] +- Filter NOT t1a#x IN (list#x []) : +- Filter (t2a#x > val2a) : +- Aggregate [t2a#x], [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -337,25 +295,21 @@ WHERE t1d NOT IN (SELECT t2d GROUP BY t1a, t1b HAVING t1b < 10 -- !query analysis -Filter (cast(t1b#x as int) < 10) +Filter (t1b#x < 10) +- Aggregate [t1a#x, t1b#x], [t1a#x, t1b#x] - +- Filter NOT t1d#xL IN (list#x [t1a#x]) - : +- Project [t2d#xL] + +- Filter NOT t1d#x IN (list#x [t1a#x]) + : +- Project [t2d#x] : +- Filter (t2c#x > 8) - : +- Aggregate [t2c#x, t2d#xL], [t2d#xL, t2c#x] + : +- Aggregate [t2c#x, t2d#x], [t2d#x, t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -370,18 +324,14 @@ HAVING t1a NOT IN (SELECT t2a -- !query analysis Filter NOT t1a#x IN (list#x []) : +- Project [t2a#x] -: +- Filter (cast(t2b#x as int) > 3) +: +- Filter (t2b#x > 3) : +- SubqueryAlias t2 -: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- SubqueryAlias t2 -: +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Aggregate [t1a#x], [t1a#x, max(t1b#x) AS max(t1b)#x] - +- Filter (cast(t1b#x as int) > 0) + +- Filter (t1b#x > 0) +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-order-by.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-order-by.sql.out index 075e4c90d8110..56c974bef1736 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-order-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-order-by.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -114,21 +102,17 @@ WHERE t1a IN (SELECT t2a ORDER BY t1a -- !query analysis Sort [t1a#x ASC NULLS FIRST], true -+- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] ++- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -146,17 +130,13 @@ Project [t1a#x] : +- Project [t2b#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -174,17 +154,13 @@ Sort [t1b#x DESC NULLS LAST], true : +- Project [t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -201,17 +177,13 @@ Sort [count(DISTINCT t1a)#xL ASC NULLS FIRST], true : +- Project [t2b#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -221,24 +193,19 @@ WHERE t1b IN (SELECT t2c FROM t2 ORDER BY t2d) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -+- Filter cast(t1b#x as int) IN (list#x []) +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] ++- Filter t1b#x IN (list#x []) : +- Project [t2c#x] - : +- Project [t2c#x] - : +- Sort [t2d#xL ASC NULLS FIRST], true - : +- Project [t2c#x, t2d#xL] - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Sort [t2d#x ASC NULLS FIRST], true + : +- Project [t2c#x, t2d#x] + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -250,24 +217,20 @@ WHERE t1b IN (SELECT Min(t2b) ORDER BY Min(t2b)) ORDER BY t1c DESC nulls first, t1a DESC, t1d DESC, t1h -- !query analysis -Sort [t1c#x DESC NULLS FIRST, t1a#x DESC NULLS LAST, t1d#xL DESC NULLS LAST, t1h#x ASC NULLS FIRST], true -+- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Sort [t1c#x DESC NULLS FIRST, t1a#x DESC NULLS LAST, t1d#x DESC NULLS LAST, t1h#x ASC NULLS FIRST], true ++- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1b#x IN (list#x [t1b#x]) : +- Sort [min(t2b)#x ASC NULLS FIRST], true : +- Aggregate [min(t2b#x) AS min(t2b)#x] : +- Filter (outer(t1b#x) = t2b#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -292,25 +255,19 @@ Sort [t1h#x DESC NULLS LAST], true : : +- Project [t2c#x, t2b#x] : : +- Filter (outer(t1a#x) = t2a#x) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2h#x] : +- Filter (outer(t1h#x) > t2h#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -321,21 +278,17 @@ WHERE t1a NOT IN (SELECT t2a ORDER BY t1a -- !query analysis Sort [t1a#x ASC NULLS FIRST], true -+- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] ++- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -353,17 +306,13 @@ Sort [t1b#x DESC NULLS LAST], true : +- Project [t2a#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -378,31 +327,25 @@ WHERE t1a NOT IN (SELECT t2a ORDER BY t1c DESC nulls last -- !query analysis Sort [t1c#x DESC NULLS LAST], true -+- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] ++- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter (NOT t1a#x IN (list#x []) AND t1c#x IN (list#x [])) : :- Sort [t2a#x DESC NULLS FIRST], true : : +- Project [t2a#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2c#x] : +- Sort [t2b#x DESC NULLS LAST], true : +- Project [t2c#x, t2b#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -413,23 +356,19 @@ WHERE t1b IN (SELECT Min(t2b) GROUP BY t2a ORDER BY t2a DESC) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1b#x IN (list#x []) : +- Project [min(t2b)#x] : +- Sort [t2a#x DESC NULLS LAST], true : +- Aggregate [t2a#x], [min(t2b#x) AS min(t2b)#x, t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -453,17 +392,13 @@ Sort [t1a#x ASC NULLS FIRST], true : +- Aggregate [t2a#x], [min(t2b#x) AS min(t2b)#x, t2a#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -474,23 +409,19 @@ WHERE t1b NOT IN (SELECT Min(t2b) GROUP BY t2a ORDER BY t2a) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1b#x IN (list#x []) : +- Project [min(t2b)#x] : +- Sort [t2a#x ASC NULLS FIRST], true : +- Aggregate [t2a#x], [min(t2b#x) AS min(t2b)#x, t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -511,17 +442,13 @@ Aggregate [t1a#x], [t1a#x, sum(distinct t1b#x) AS sum(DISTINCT t1b)#xL] : +- Aggregate [t2c#x], [min(t2b#x) AS min(t2b)#x, t2c#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -541,18 +468,14 @@ Sort [t1b#x DESC NULLS LAST], true +- Aggregate [t1a#x, t1b#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x] +- Filter NOT t1h#x IN (list#x [t1a#x]) : +- Project [t2h#x] - : +- Sort [t2d#xL DESC NULLS FIRST], true - : +- Project [t2h#x, t2d#xL] + : +- Sort [t2d#x DESC NULLS FIRST], true + : +- Project [t2h#x, t2d#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-set-operations.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-set-operations.sql.out index 9239670589bcb..6e317f3e7e6ff 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-set-operations.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-set-operations.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -127,39 +115,31 @@ ORDER BY t2c DESC nulls first -- !query analysis Sort [t2c#x DESC NULLS FIRST], true +- Project [t2a#x, t2b#x, t2c#x, t2h#x, t2i#x] - +- Filter (isnotnull(t2i#x) AND ((2 * cast(t2b#x as int)) = t2c#x)) + +- Filter (isnotnull(t2i#x) AND ((2 * t2b#x) = t2c#x)) +- SubqueryAlias t3 +- Union false, false - :- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + :- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] : +- Filter t2a#x IN (list#x []) : : +- Project [t1a#x] : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Project [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +- Filter t3a#x IN (list#x []) : +- Project [t1a#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t3 - +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -185,43 +165,35 @@ GROUP BY t2a, t2i ORDER BY t2d DESC -- !query analysis -Sort [t2d#xL DESC NULLS LAST], true -+- Aggregate [t2a#x, t2b#x, t2d#xL, t2i#x], [t2a#x, t2b#x, t2d#xL, count(distinct t2h#x) AS count(DISTINCT t2h)#xL, t2i#x] +Sort [t2d#x DESC NULLS LAST], true ++- Aggregate [t2a#x, t2b#x, t2d#x, t2i#x], [t2a#x, t2b#x, t2d#x, count(distinct t2h#x) AS count(DISTINCT t2h)#xL, t2i#x] +- SubqueryAlias t3 +- Distinct +- Union false, false - :- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + :- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] : +- Filter t2a#x IN (list#x [t2b#x]) : : +- Project [t1a#x] : : +- Filter (outer(t2b#x) = t1b#x) : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1c#x]) : +- Project [t3a#x] : +- Filter (outer(t1c#x) = t3c#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -270,70 +242,54 @@ Distinct :- Distinct : +- Union false, false : :- Union false, false - : : :- Aggregate [t2a#x, t2b#x, t2c#x], [t2a#x, t2b#x, t2c#x, min(t2d#xL) AS min(t2d)#xL] + : : :- Aggregate [t2a#x, t2b#x, t2c#x], [t2a#x, t2b#x, t2c#x, min(t2d#x) AS min(t2d)#x] : : : +- Filter t2a#x IN (list#x [t2b#x]) : : : : +- Project [t1a#x] : : : : +- Filter (t1b#x = outer(t2b#x)) : : : : +- SubqueryAlias t1 - : : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : : +- SubqueryAlias t1 - : : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- Aggregate [t2a#x, t2b#x, t2c#x], [t2a#x, t2b#x, t2c#x, max(t2d#xL) AS max(t2d)#xL] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : : +- Aggregate [t2a#x, t2b#x, t2c#x], [t2a#x, t2b#x, t2c#x, max(t2d#x) AS max(t2d)#x] : : +- Filter t2a#x IN (list#x [t2c#x]) : : : +- Project [t1a#x] : : : +- Filter (outer(t2c#x) = t1c#x) : : : +- SubqueryAlias t1 - : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : +- SubqueryAlias t1 - : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- Aggregate [t3a#x, t3b#x, t3c#x], [t3a#x, t3b#x, t3c#x, min(t3d#xL) AS min(t3d)#xL] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Aggregate [t3a#x, t3b#x, t3c#x], [t3a#x, t3b#x, t3c#x, min(t3d#x) AS min(t3d)#x] : +- Filter t3a#x IN (list#x [t3c#x]) : : +- Project [t2a#x] : : +- Filter (outer(t3c#x) = t2c#x) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- Aggregate [t1a#x, t1b#x, t1c#x], [t1a#x, t1b#x, t1c#x, max(t1d#xL) AS max(t1d)#xL] - +- Filter t1a#x IN (list#x [t1d#xL]) + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Aggregate [t1a#x, t1b#x, t1c#x], [t1a#x, t1b#x, t1c#x, max(t1d#x) AS max(t1d)#x] + +- Filter t1a#x IN (list#x [t1d#x]) : +- Project [t3a#x] - : +- Filter (t3d#xL = outer(t1d#xL)) + : +- Filter (t3d#x = outer(t1d#x)) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -375,40 +331,32 @@ HAVING t2b IS NOT NULL Distinct +- Union false, false :- Distinct - : +- Aggregate [t2a#x, t2b#x, t2c#x, t2d#xL, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#xL, t2h#x, t2i#x] + : +- Aggregate [t2a#x, t2b#x, t2c#x, t2d#x, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#x, t2h#x, t2i#x] : +- Filter t2a#x IN (list#x [t2b#x]) : : +- Project [t1a#x] : : +- Filter (t1b#x = outer(t2b#x)) : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Distinct +- Filter isnotnull(t2b#x) - +- Aggregate [t2a#x, t2b#x, t2c#x, t2d#xL, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#xL, t2h#x, t2i#x] + +- Aggregate [t2a#x, t2b#x, t2c#x, t2d#x, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#x, t2h#x, t2i#x] +- Filter t2a#x IN (list#x [t2c#x]) : +- Project [t1a#x] : +- Filter (outer(t2c#x) = t1c#x) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -463,58 +411,46 @@ Distinct +- Union false, false :- Distinct : +- Union false, false - : :- Aggregate [t2a#x, t2b#x, t2c#x, t2d#xL, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#xL, t2h#x, t2i#x] + : :- Aggregate [t2a#x, t2b#x, t2c#x, t2d#x, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#x, t2h#x, t2i#x] : : +- Filter t2a#x IN (list#x [t2b#x]) : : : +- Distinct : : : +- Project [t1a#x] : : : +- Filter (t1b#x = outer(t2b#x)) : : : +- SubqueryAlias t1 - : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : +- SubqueryAlias t1 - : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Distinct : +- Filter isnotnull(t2b#x) - : +- Aggregate [t2a#x, t2b#x, t2c#x, t2d#xL, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#xL, t2h#x, t2i#x] + : +- Aggregate [t2a#x, t2b#x, t2c#x, t2d#x, t2h#x, t2i#x], [t2a#x, t2b#x, count(t2c#x) AS count(t2c)#xL, t2d#x, t2h#x, t2i#x] : +- Filter t2b#x IN (list#x [t2c#x]) : : +- Aggregate [max(t1b#x) AS max(t1b)#x] : : +- Filter (outer(t2c#x) = t1c#x) : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- Project [t2a#x, t2b#x, cast(t2c#x as bigint) AS t2c#xL, t2d#xL, t2h#x, t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2h#x, t2i#x] - +- Filter t2d#xL IN (list#x [t2c#x]) - : +- Aggregate [min(t1d#xL) AS min(t1d)#xL] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Project [t2a#x, t2b#x, cast(t2c#x as bigint) AS t2c#xL, t2d#x, t2h#x, t2i#x] + +- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2h#x, t2i#x] + +- Filter t2d#x IN (list#x [t2c#x]) + : +- Aggregate [min(t1d#x) AS min(t1d)#x] : +- Filter (outer(t2c#x) = t1c#x) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -558,70 +494,54 @@ WHERE t2c IN (SELECT Max(t1c) Union false, false :- Except false : :- Intersect false -: : :- Project [t2a#x, t2b#x, t2c#x, t2d#xL] -: : : +- Filter t2a#x IN (list#x [t2b#x && t2d#xL]) +: : :- Project [t2a#x, t2b#x, t2c#x, t2d#x] +: : : +- Filter t2a#x IN (list#x [t2b#x && t2d#x]) : : : : +- Project [t1a#x] -: : : : +- Filter ((t1b#x = outer(t2b#x)) AND (t1d#xL < outer(t2d#xL))) +: : : : +- Filter ((t1b#x = outer(t2b#x)) AND (t1d#x < outer(t2d#x))) : : : : +- SubqueryAlias t1 -: : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: : : : +- SubqueryAlias t1 -: : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- SubqueryAlias t2 -: : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : : +- SubqueryAlias t2 -: : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL] +: : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +: : +- Project [t2a#x, t2b#x, t2c#x, t2d#x] : : +- Filter t2b#x IN (list#x [t2c#x]) : : : +- Aggregate [max(t1b#x) AS max(t1b)#x] : : : +- Filter (outer(t2c#x) = t1c#x) : : : +- SubqueryAlias t1 -: : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: : : +- SubqueryAlias t1 -: : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL] -: +- Filter t2d#xL IN (list#x [t2c#x]) -: : +- Aggregate [min(t3d#xL) AS min(t3d)#xL] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +: +- Project [t2a#x, t2b#x, t2c#x, t2d#x] +: +- Filter t2d#x IN (list#x [t2c#x]) +: : +- Aggregate [min(t3d#x) AS min(t3d)#x] : : +- Filter (outer(t2c#x) = t3c#x) : : +- SubqueryAlias t3 -: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) -: : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] -: : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] -: : +- SubqueryAlias t3 -: : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) +: : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 -: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: +- SubqueryAlias t2 -: +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -+- Project [t2a#x, t2b#x, t2c#x, t2d#xL] - +- Filter t2c#x IN (list#x [t2d#xL]) +: +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] ++- Project [t2a#x, t2b#x, t2c#x, t2d#x] + +- Filter t2c#x IN (list#x [t2d#x]) : +- Aggregate [max(t1c#x) AS max(t1c)#x] - : +- Filter (t1d#xL = outer(t2d#xL)) + : +- Filter (t1d#x = outer(t2d#x)) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -661,7 +581,7 @@ ORDER BY t1c DESC, t1a DESC Sort [t1c#x DESC NULLS LAST, t1a#x DESC NULLS LAST], true +- Distinct +- Filter (isnotnull(t1c#x) AND isnotnull(t1b#x)) - +- Aggregate [t1a#x, t1b#x, t1c#x, t1d#xL], [t1a#x, t1b#x, t1c#x, t1d#xL] + +- Aggregate [t1a#x, t1b#x, t1c#x, t1d#x], [t1a#x, t1b#x, t1c#x, t1d#x] +- Filter t1a#x IN (list#x []) : +- Distinct : +- Union false, false @@ -672,64 +592,50 @@ Sort [t1c#x DESC NULLS LAST, t1a#x DESC NULLS LAST], true : : : +- Union false, false : : : :- Project [t2a#x AS t3a#x] : : : : +- SubqueryAlias t2 - : : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : : +- SubqueryAlias t2 - : : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- Project [t2a#x AS t3a#x] : : : +- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- Project [t2a#x] : : +- SubqueryAlias t4 : : +- Distinct : : +- Union false, false : : :- Project [t2a#x] - : : : +- Filter (cast(t2b#x as int) > 6) + : : : +- Filter (t2b#x > 6) : : : +- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- Project [t2a#x] - : : +- Filter (cast(t2b#x as int) > 6) + : : +- Filter (t2b#x > 6) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2a#x] : +- SubqueryAlias t5 : +- Distinct : +- Union false, false : :- Project [t2a#x] - : : +- Filter (cast(t2b#x as int) > 6) + : : +- Filter (t2b#x > 6) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t1a#x] - : +- Filter (cast(t1b#x as int) > 6) + : +- Filter (t1b#x > 6) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -754,27 +660,21 @@ Project [t1a#x, t1b#x, t1c#x] : +- SubqueryAlias t3 : +- Intersect false : :- Project [t2b#x] - : : +- Filter (cast(t2b#x as int) > 6) + : : +- Filter (t2b#x > 6) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t1b#x] - : +- Filter (cast(t1b#x as int) > 6) + : +- Filter (t1b#x > 6) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -798,24 +698,18 @@ Sort [t1b#x DESC NULLS FIRST, t1c#x DESC NULLS LAST], true : +- Except false : :- Project [t2h#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3h#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -862,27 +756,21 @@ Sort [t1c#x DESC NULLS LAST, t1a#x DESC NULLS LAST], true : : +- SubqueryAlias t3 : : +- Intersect false : : :- Project [t2b#x] - : : : +- Filter (cast(t2b#x as int) > 6) + : : : +- Filter (t2b#x > 6) : : : +- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- Project [t1b#x] - : : +- Filter (cast(t1b#x as int) > 6) + : : +- Filter (t1b#x > 6) : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Project [t1a#x, t1b#x, t1c#x] +- Filter t1b#x IN (list#x [t1b#x]) : +- Project [t2b#x] @@ -890,27 +778,21 @@ Sort [t1c#x DESC NULLS LAST, t1a#x DESC NULLS LAST], true : +- SubqueryAlias t4 : +- Except false : :- Project [t2b#x] - : : +- Filter (cast(t2b#x as int) > 6) + : : +- Filter (t2b#x > 6) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t1b#x] - : +- Filter (cast(t1b#x as int) > 6) + : +- Filter (t1b#x > 6) : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -956,129 +838,101 @@ FROM (SELECT * FROM t3 WHERE t4.t2a = t3a)) -- !query analysis -Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +- SubqueryAlias __auto_generated_subquery_name - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +- Filter t2b#x IN (list#x [t2a#x]) : +- Aggregate [min(t3b#x) AS min(t3b)#x] : +- Filter (outer(t2a#x) = t3a#x) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t4 +- Except false :- Distinct : +- Union false, false : :- Distinct : : +- Union false, false - : : :- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : :- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] : : : +- Filter t2h#x IN (list#x [t2a#x]) : : : : +- Project [t1h#x] : : : : +- Filter (t1a#x = outer(t2a#x)) : : : : +- SubqueryAlias t1 - : : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : : +- SubqueryAlias t1 - : : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : : +- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] : : +- Filter t1h#x IN (list#x []) : : : +- Distinct : : : +- Union false, false : : : :- Project [t3h#x] : : : : +- SubqueryAlias t3 - : : : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : : : +- SubqueryAlias t3 - : : : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : : : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- Project [t1h#x] : : : +- SubqueryAlias t1 - : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : +- SubqueryAlias t1 - : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Intersect false - : :- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : :- Project [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] : : +- Filter t3a#x IN (list#x []) : : : +- Union false, false : : : :- Project [t2a#x] : : : : +- SubqueryAlias t2 - : : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : : +- SubqueryAlias t2 - : : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- Project [t1a#x] - : : : +- Filter (cast(t1b#x as int) > 0) + : : : +- Filter (t1b#x > 0) : : : +- SubqueryAlias t1 - : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : +- SubqueryAlias t1 - : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] : +- Filter t1b#x IN (list#x []) : : +- Distinct : : +- Union false, false : : :- Project [t3b#x] : : : +- SubqueryAlias t3 - : : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : : +- SubqueryAlias t3 - : : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- Project [t2b#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +- Filter t2h#x IN (list#x []) : +- Project [cast(t1i#x as timestamp) AS t1i#x] : +- Project [t1i#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1115,67 +969,51 @@ Sort [t2a#x ASC NULLS FIRST], true : +- Intersect false : :- Project [t1a#x] : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t3 +- Union false, false - :- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + :- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] : +- Filter NOT t2a#x IN (list#x []) : : +- Distinct : : +- Union false, false : : :- Project [t1a#x] : : : +- SubqueryAlias t1 - : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : +- SubqueryAlias t1 - : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- Project [t3a#x] : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +- Filter NOT t2a#x IN (list#x []) : +- Intersect false : :- Project [t1a#x] : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1229,18 +1067,14 @@ Sort [t1c#x DESC NULLS LAST, t1i#x ASC NULLS FIRST], true : :- Project [t2b#x] : : +- Filter isnull(t2c#x) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3b#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Aggregate [t1a#x, t1b#x, t1c#x, t1i#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1i#x] +- Filter NOT t1b#x IN (list#x [t1b#x]) : +- Project [t2b#x] @@ -1254,53 +1088,39 @@ Sort [t1c#x DESC NULLS LAST, t1i#x ASC NULLS FIRST], true : : : +- Filter NOT t2b#x IN (list#x []) : : : : +- Project [t1b#x] : : : : +- SubqueryAlias t1 - : : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : : : +- SubqueryAlias t1 - : : : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- Project [t1b#x] : : +- Filter NOT t1b#x IN (list#x []) : : : +- Project [t3b#x] : : : +- SubqueryAlias t3 - : : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : : +- SubqueryAlias t3 - : : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3b#x] : +- Filter NOT t3b#x IN (list#x []) : : +- Project [t2b#x] : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1313,30 +1133,24 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1b#x]) : +- Union false, false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1349,31 +1163,25 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1b#x]) : +- Distinct : +- Union false, false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1386,30 +1194,24 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1b#x]) : +- Intersect All true : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1422,30 +1224,24 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1b#x]) : +- Intersect false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1458,30 +1254,24 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1b#x]) : +- Except All true : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1494,30 +1284,24 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x [t1b#x]) : +- Except false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1530,30 +1314,24 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x [t1b#x]) : +- Union false, false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1566,31 +1344,25 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x [t1b#x]) : +- Distinct : +- Union false, false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1603,30 +1375,24 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x [t1b#x]) : +- Intersect All true : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1639,30 +1405,24 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x [t1b#x]) : +- Intersect false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1675,30 +1435,24 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x [t1b#x]) : +- Except All true : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -1711,27 +1465,21 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter NOT t1a#x IN (list#x [t1b#x]) : +- Except false : :- Project [t2a#x] : : +- Filter (t2b#x = outer(t1b#x)) : : +- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- Project [t3a#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-with-cte.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-with-cte.sql.out index 199b876fb9a86..a056bd677b2f5 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-with-cte.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/in-with-cte.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -111,7 +99,7 @@ WITH cte1 AS (SELECT t1a, t1b FROM t1 - WHERE t1a = "val1a") + WHERE t1a = 'val1a') SELECT t1a, t1b, t1c, @@ -128,23 +116,19 @@ WithCTE : +- Project [t1a#x, t1b#x] : +- Filter (t1a#x = val1a) : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -+- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] ++- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x] +- Filter t1b#x IN (list#x []) : +- Project [t1b#x] - : +- Filter (cast(t1b#x as int) > 0) + : +- Filter (t1b#x > 0) : +- SubqueryAlias cte1 : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -181,11 +165,9 @@ WithCTE : +- SubqueryAlias cte1 : +- Project [t1a#x, t1b#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Filter isnotnull(t1c#x) +- Aggregate [t1a#x, t1b#x, t1c#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x] +- Filter t1b#x IN (list#x []) @@ -195,11 +177,11 @@ WithCTE : : :- Distinct : : : +- Union false, false : : : :- Project [t1b#x] - : : : : +- Filter (cast(t1b#x as int) > 0) + : : : : +- Filter (t1b#x > 0) : : : : +- SubqueryAlias cte1 : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false : : : +- Project [t1b#x] - : : : +- Filter (cast(t1b#x as int) > 5) + : : : +- Filter (t1b#x > 5) : : : +- SubqueryAlias cte1 : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false : : +- Intersect false @@ -213,11 +195,9 @@ WithCTE : +- SubqueryAlias cte1 : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -252,44 +232,40 @@ WHERE t1c IN WithCTE :- CTERelationDef xxxx, false : +- SubqueryAlias cte1 -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x] +: +- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Project [t1a#x, t1b#x, t1c#x, t1h#x] +- Filter t1c#x IN (list#x []) : +- Project [t1c#x] - : +- Join LeftOuter, (t1d#xL > t1d#xL) + : +- Join LeftOuter, (t1d#x > t1d#x) : :- Join Inner, (t1b#x < t1b#x) - : : :- Join LeftOuter, (t1d#xL = t1d#xL) + : : :- Join LeftOuter, (t1d#x = t1d#x) : : : :- Join FullOuter, (t1c#x = t1c#x) : : : : :- Join Inner, (t1b#x > t1b#x) : : : : : :- SubqueryAlias cte1 - : : : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x], false, false + : : : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x], false, false : : : : : +- SubqueryAlias cte2 : : : : : +- SubqueryAlias cte1 - : : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x], false, false + : : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x], false, false : : : : +- SubqueryAlias cte3 : : : : +- SubqueryAlias cte1 - : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x], false, false + : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x], false, false : : : +- SubqueryAlias cte4 : : : +- SubqueryAlias cte1 - : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x], false, false + : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x], false, false : : +- SubqueryAlias cte5 : : +- SubqueryAlias cte1 - : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x], false, false + : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x], false, false : +- SubqueryAlias cte6 : +- SubqueryAlias cte1 - : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x], false, false + : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x], false, false +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -303,7 +279,7 @@ WITH cte1 ON t1c = t2c LEFT JOIN t3 ON t2d = t3d) - AND t1a = "val1b") + AND t1a = 'val1b') SELECT * FROM (SELECT * FROM cte1 @@ -321,38 +297,30 @@ WithCTE : +- Project [t1a#x, t1b#x] : +- Filter (t1b#x IN (list#x []) AND (t1a#x = val1b)) : : +- Project [t2b#x] -: : +- Join LeftOuter, (t2d#xL = t3d#xL) +: : +- Join LeftOuter, (t2d#x = t3d#x) : : :- Join RightOuter, (t1c#x = t2c#x) : : : :- SubqueryAlias t2 -: : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : : : +- SubqueryAlias t2 -: : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- SubqueryAlias t1 -: : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: : : +- SubqueryAlias t1 -: : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t3 -: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) -: : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] -: : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] -: : +- SubqueryAlias t3 -: : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) +: : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Project [t1a#x, t1b#x, t1a#x, t1b#x, t1a#x, t1b#x, t1a#x, t1b#x] +- SubqueryAlias s +- Project [t1a#x, t1b#x, t1a#x, t1b#x, t1a#x, t1b#x, t1a#x, t1b#x] +- Join Inner, (t1b#x = t1b#x) :- Join FullOuter, (t1a#x = t1a#x) - : :- Join Inner, ((cast(t1b#x as int) > 5) AND (t1a#x = t1a#x)) + : :- Join Inner, ((t1b#x > 5) AND (t1a#x = t1a#x)) : : :- SubqueryAlias cte1 : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false : : +- SubqueryAlias cte2 @@ -400,26 +368,20 @@ WithCTE : : +- Project [t2a#x] : : +- Filter (outer(t1b#x) < t2b#x) : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Aggregate [t1b#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x] +- Filter t1b#x IN (list#x []) : +- Project [t1b#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias s +- Project [t1a#x, t1b#x] +- Join Inner, (t1h#x >= t1h#x) @@ -442,7 +404,7 @@ WITH cte1 AS SELECT t2b FROM t2 FULL OUTER JOIN T3 on t2a = t3a WHERE t1c = t2c) AND - t1a = "val1b") + t1a = 'val1b') SELECT * FROM ( SELECT * @@ -461,23 +423,17 @@ WithCTE : : +- Filter (outer(t1c#x) = t2c#x) : : +- Join FullOuter, (t2a#x = t3a#x) : : :- SubqueryAlias t2 -: : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : : +- SubqueryAlias t2 -: : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t3 -: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) -: : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] -: : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] -: : +- SubqueryAlias t3 -: : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +: : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) +: : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Project [t1a#x, t1b#x, t1c#x, t1a#x, t1b#x, t1c#x, t1a#x, t1b#x, t1c#x, t1a#x, t1b#x, t1c#x] +- SubqueryAlias s +- Project [t1a#x, t1b#x, t1c#x, t1a#x, t1b#x, t1c#x, t1a#x, t1b#x, t1c#x, t1a#x, t1b#x, t1c#x] @@ -522,17 +478,13 @@ WithCTE : : +- Project [t2b#x] : : +- Filter (outer(t1c#x) = t2c#x) : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Aggregate [t1b#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x] +- SubqueryAlias s +- Project [t1a#x, t1b#x] @@ -576,28 +528,22 @@ WithCTE : : +- Project [t2b#x] : : +- Filter (outer(t1c#x) = t2c#x) : : +- SubqueryAlias t2 -: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : +- SubqueryAlias t2 -: : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Distinct +- Project [t1b#x] +- Filter t1b#x IN (list#x []) : +- Project [t1b#x] : +- Join Inner, (t1a#x = t1a#x) : :- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias cte1 : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false +- SubqueryAlias s @@ -615,7 +561,7 @@ WITH cte1 AS (SELECT t1a, t1b FROM t1 - WHERE t1a = "val1d") + WHERE t1a = 'val1d') SELECT t1a, t1b, t1c, @@ -632,23 +578,19 @@ WithCTE : +- Project [t1a#x, t1b#x] : +- Filter (t1a#x = val1d) : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Project [t1a#x, t1b#x, t1c#x, t1h#x] +- Filter (NOT t1b#x IN (list#x []) AND (t1c#x > 10)) : +- Project [t1b#x] - : +- Filter (cast(t1b#x as int) < 0) + : +- Filter (t1b#x < 0) : +- SubqueryAlias cte1 : +- CTERelationRef xxxx, true, [t1a#x, t1b#x], false, false +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -685,56 +627,46 @@ ORDER BY t1c DESC WithCTE :- CTERelationDef xxxx, false : +- SubqueryAlias cte1 -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x] -: +- Filter NOT t1d#xL IN (list#x []) -: : +- Project [t2d#xL] +: +- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x] +: +- Filter NOT t1d#x IN (list#x []) +: : +- Project [t2d#x] : : +- Join Inner, (t1b#x = t2b#x) : : :- Join FullOuter, (t2a#x = t3a#x) : : : :- SubqueryAlias t2 -: : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) -: : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] -: : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] -: : : : +- SubqueryAlias t2 -: : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +: : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) +: : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] +: : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : : +- SubqueryAlias t3 -: : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) -: : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] -: : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] -: : : +- SubqueryAlias t3 -: : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +: : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) +: : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] +: : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t1 -: : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: : +- SubqueryAlias t1 -: : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 -: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) -: +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] -: +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] -: +- SubqueryAlias t1 -: +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +: +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) +: +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] +: +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Sort [t1c#x DESC NULLS LAST], true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x] + +- Project [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x] +- Filter (NOT t1b#x IN (list#x []) AND isnotnull(t1c#x)) : +- Project [t1b#x] : +- Join Inner, (t1c#x = t1c#x) : :- Join RightOuter, (t1b#x = t1b#x) : : :- Join Inner, (t1a#x = t1a#x) : : : :- SubqueryAlias cte1 - : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x], false, false + : : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x], false, false : : : +- SubqueryAlias cte2 : : : +- SubqueryAlias cte1 - : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x], false, false + : : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x], false, false : : +- SubqueryAlias cte3 : : +- SubqueryAlias cte1 - : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x], false, false + : : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x], false, false : +- SubqueryAlias cte4 : +- SubqueryAlias cte1 - : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x], false, false + : +- CTERelationRef xxxx, true, [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x], false, false +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/nested-not-in.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/nested-not-in.sql.out index a098d19da594d..1cb46de0f63f6 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/nested-not-in.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/nested-not-in.sql.out @@ -1,122 +1,102 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", 10), - (200, "emp 2", NULL), - (300, "emp 3", 20), - (400, "emp 4", 30), - (500, "emp 5", NULL), - (600, "emp 6", 100), - (800, "emp 8", 70) -AS EMP(id, emp_name, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, dept_id) AS VALUES + (100, 'emp 1', 10), + (200, 'emp 2', NULL), + (300, 'emp 3', 20), + (400, 'emp 4', 30), + (500, 'emp 5', NULL), + (600, 'emp 6', 100), + (800, 'emp 8', 70) -- !query analysis -CreateViewCommand `EMP`, SELECT * FROM VALUES - (100, "emp 1", 10), - (200, "emp 2", NULL), - (300, "emp 3", 20), - (400, "emp 4", 30), - (500, "emp 5", NULL), - (600, "emp 6", 100), - (800, "emp 8", 70) -AS EMP(id, emp_name, dept_id), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] +CreateViewCommand `EMP`, [(id,None), (emp_name,None), (dept_id,None)], VALUES + (100, 'emp 1', 10), + (200, 'emp 2', NULL), + (300, 'emp 3', 20), + (400, 'emp 4', 30), + (500, 'emp 5', NULL), + (600, 'emp 6', 100), + (800, 'emp 8', 70), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query analysis -CreateViewCommand `DEPT`, SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state), false, false, LocalTempView, UNSUPPORTED, true - +- Project [dept_id#x, dept_name#x, state#x] - +- SubqueryAlias DEPT - +- LocalRelation [dept_id#x, dept_name#x, state#x] +CreateViewCommand `DEPT`, [(dept_id,None), (dept_name,None), (state,None)], VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query analysis -CreateViewCommand `BONUS`, SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt), false, false, LocalTempView, UNSUPPORTED, true - +- Project [emp_name#x, bonus_amt#x] - +- SubqueryAlias BONUS - +- LocalRelation [emp_name#x, bonus_amt#x] +CreateViewCommand `BONUS`, [(emp_name,None), (bonus_amt,None)], VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query -CREATE TEMPORARY VIEW ADDRESS AS SELECT * FROM VALUES - (100, "emp 1", "addr1"), - (200, null, "addr2"), - (null, "emp 3", "addr3"), - (null, null, "addr4"), - (600, "emp 6", "addr6"), - (800, "emp 8", "addr8") -AS ADDRESS(id, emp_name, address) +CREATE TEMPORARY VIEW ADDRESS(id, emp_name, address) AS VALUES + (100, 'emp 1', 'addr1'), + (200, null, 'addr2'), + (null, 'emp 3', 'addr3'), + (null, null, 'addr4'), + (600, 'emp 6', 'addr6'), + (800, 'emp 8', 'addr8') -- !query analysis -CreateViewCommand `ADDRESS`, SELECT * FROM VALUES - (100, "emp 1", "addr1"), - (200, null, "addr2"), - (null, "emp 3", "addr3"), - (null, null, "addr4"), - (600, "emp 6", "addr6"), - (800, "emp 8", "addr8") -AS ADDRESS(id, emp_name, address), false, false, LocalTempView, UNSUPPORTED, true - +- Project [id#x, emp_name#x, address#x] - +- SubqueryAlias ADDRESS - +- LocalRelation [id#x, emp_name#x, address#x] +CreateViewCommand `ADDRESS`, [(id,None), (emp_name,None), (address,None)], VALUES + (100, 'emp 1', 'addr1'), + (200, null, 'addr2'), + (null, 'emp 3', 'addr3'), + (null, null, 'addr4'), + (600, 'emp 6', 'addr6'), + (800, 'emp 8', 'addr8'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query -CREATE TEMPORARY VIEW S1 AS SELECT * FROM VALUES - (null, null), (5, 5), (8, 8), (11, 11) AS s1(a, b) +CREATE TEMPORARY VIEW S1(a, b) AS VALUES + (null, null), (5, 5), (8, 8), (11, 11) -- !query analysis -CreateViewCommand `S1`, SELECT * FROM VALUES - (null, null), (5, 5), (8, 8), (11, 11) AS s1(a, b), false, false, LocalTempView, UNSUPPORTED, true - +- Project [a#x, b#x] - +- SubqueryAlias s1 - +- LocalRelation [a#x, b#x] +CreateViewCommand `S1`, [(a,None), (b,None)], VALUES + (null, null), (5, 5), (8, 8), (11, 11), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query -CREATE TEMPORARY VIEW S2 AS SELECT * FROM VALUES - (7, 7), (8, 8), (11, 11), (null, null) AS s2(c, d) +CREATE TEMPORARY VIEW S2(c, d) AS VALUES + (7, 7), (8, 8), (11, 11), (null, null) -- !query analysis -CreateViewCommand `S2`, SELECT * FROM VALUES - (7, 7), (8, 8), (11, 11), (null, null) AS s2(c, d), false, false, LocalTempView, UNSUPPORTED, true - +- Project [c#x, d#x] - +- SubqueryAlias s2 - +- LocalRelation [c#x, d#x] +CreateViewCommand `S2`, [(c,None), (d,None)], VALUES + (7, 7), (8, 8), (11, 11), (null, null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -133,16 +113,12 @@ Project [id#x, dept_id#x] : +- Project [dept_id#x] : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -159,16 +135,12 @@ Project [id#x, dept_id#x] : +- Project [dept_id#x] : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -186,16 +158,12 @@ Project [id#x, dept_id#x] : +- Filter isnotnull(dept_id#x) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -214,16 +182,12 @@ Project [id#x, dept_id#x] : +- Filter isnotnull(dept_id#x) : +- SubqueryAlias emp : +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - : +- Project [id#x, emp_name#x, dept_id#x] - : +- SubqueryAlias EMP - : +- LocalRelation [id#x, emp_name#x, dept_id#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -242,23 +206,17 @@ Project [id#x, dept_id#x, emp_name#x] : :- Project [emp_name#x] : : +- SubqueryAlias bonus : : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : : +- Project [emp_name#x, bonus_amt#x] - : : +- SubqueryAlias BONUS - : : +- LocalRelation [emp_name#x, bonus_amt#x] + : : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : : +- LocalRelation [col1#x, col2#x] : +- Project [dept_id#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -279,23 +237,17 @@ Project [id#x, dept_id#x, emp_name#x] : : +- Filter (outer(emp_name#x) = emp_name#x) : : +- SubqueryAlias bonus : : +- View (`BONUS`, [emp_name#x, bonus_amt#x]) - : : +- Project [cast(emp_name#x as string) AS emp_name#x, cast(bonus_amt#x as double) AS bonus_amt#x] - : : +- Project [emp_name#x, bonus_amt#x] - : : +- SubqueryAlias BONUS - : : +- LocalRelation [emp_name#x, bonus_amt#x] + : : +- Project [cast(col1#x as string) AS emp_name#x, cast(col2#x as decimal(6,2)) AS bonus_amt#x] + : : +- LocalRelation [col1#x, col2#x] : +- Project [dept_id#x] : +- SubqueryAlias dept : +- View (`DEPT`, [dept_id#x, dept_name#x, state#x]) - : +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] - : +- Project [dept_id#x, dept_name#x, state#x] - : +- SubqueryAlias DEPT - : +- LocalRelation [dept_id#x, dept_name#x, state#x] + : +- Project [cast(col1#x as int) AS dept_id#x, cast(col2#x as string) AS dept_name#x, cast(col3#x as string) AS state#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -311,16 +263,12 @@ Project [id#x, dept_id#x, emp_name#x] : +- Project [id#x, emp_name#x] : +- SubqueryAlias address : +- View (`ADDRESS`, [id#x, emp_name#x, address#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(address#x as string) AS address#x] - : +- Project [id#x, emp_name#x, address#x] - : +- SubqueryAlias ADDRESS - : +- LocalRelation [id#x, emp_name#x, address#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as string) AS address#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -342,16 +290,12 @@ Project [id#x, dept_id#x, emp_name#x] : +- Filter (isnotnull(id#x) AND isnotnull(emp_name#x)) : +- SubqueryAlias address : +- View (`ADDRESS`, [id#x, emp_name#x, address#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(address#x as string) AS address#x] - : +- Project [id#x, emp_name#x, address#x] - : +- SubqueryAlias ADDRESS - : +- LocalRelation [id#x, emp_name#x, address#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as string) AS address#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -372,16 +316,12 @@ Project [id#x, dept_id#x, emp_name#x] : +- Filter ((isnotnull(id#x) AND isnotnull(emp_name#x)) AND (outer(id#x) = id#x)) : +- SubqueryAlias address : +- View (`ADDRESS`, [id#x, emp_name#x, address#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(address#x as string) AS address#x] - : +- Project [id#x, emp_name#x, address#x] - : +- SubqueryAlias ADDRESS - : +- LocalRelation [id#x, emp_name#x, address#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as string) AS address#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -407,24 +347,18 @@ Project [id#x, dept_id#x, emp_name#x] : : +- Filter ((isnotnull(id#x) AND isnotnull(emp_name#x)) AND (id#x >= 400)) : : +- SubqueryAlias address : : +- View (`ADDRESS`, [id#x, emp_name#x, address#x]) - : : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(address#x as string) AS address#x] - : : +- Project [id#x, emp_name#x, address#x] - : : +- SubqueryAlias ADDRESS - : : +- LocalRelation [id#x, emp_name#x, address#x] + : : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as string) AS address#x] + : : +- LocalRelation [col1#x, col2#x, col3#x] : +- Project [emp_name#x] : +- Filter ((isnotnull(id#x) AND isnotnull(emp_name#x)) AND ((outer(id#x) = id#x) AND (id#x < 400))) : +- SubqueryAlias address : +- View (`ADDRESS`, [id#x, emp_name#x, address#x]) - : +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(address#x as string) AS address#x] - : +- Project [id#x, emp_name#x, address#x] - : +- SubqueryAlias ADDRESS - : +- LocalRelation [id#x, emp_name#x, address#x] + : +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as string) AS address#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias emp +- View (`EMP`, [id#x, emp_name#x, dept_id#x]) - +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(dept_id#x as int) AS dept_id#x] - +- Project [id#x, emp_name#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, dept_id#x] + +- Project [cast(col1#x as int) AS id#x, cast(col2#x as string) AS emp_name#x, cast(col3#x as int) AS dept_id#x] + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -438,16 +372,12 @@ Project [a#x, b#x] : +- Project [c#x] : +- SubqueryAlias s2 : +- View (`S2`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as int) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s2 - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as int) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias s1 +- View (`S1`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as int) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias s1 - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as int) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -462,16 +392,12 @@ Project [a#x, b#x] : +- Project [c#x] : +- SubqueryAlias s2 : +- View (`S2`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as int) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s2 - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as int) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias s1 +- View (`S1`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as int) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias s1 - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as int) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -486,16 +412,12 @@ Project [a#x, b#x] : +- Project [c#x] : +- SubqueryAlias s2 : +- View (`S2`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as int) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s2 - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as int) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias s1 +- View (`S1`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as int) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias s1 - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as int) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -510,16 +432,12 @@ Project [a#x, b#x] : +- Project [c#x] : +- SubqueryAlias s2 : +- View (`S2`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as int) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s2 - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as int) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias s1 +- View (`S1`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as int) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias s1 - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as int) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -534,13 +452,9 @@ Project [a#x, b#x] : +- Project [c#x] : +- SubqueryAlias s2 : +- View (`S2`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as int) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s2 - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as int) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias s1 +- View (`S1`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as int) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias s1 - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as int) AS b#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-group-by.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-group-by.sql.out index 724f9f29894c1..efcee37dacc0e 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-group-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-group-by.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -118,17 +106,13 @@ Aggregate [t1a#x], [t1a#x, avg(t1b#x) AS avg(t1b)#x] +- Filter NOT t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -141,21 +125,17 @@ WHERE t1d NOT IN (SELECT t2d GROUP BY t1a -- !query analysis Aggregate [t1a#x], [t1a#x, sum(distinct t1b#x) AS sum(DISTINCT t1b)#xL] -+- Filter NOT t1d#xL IN (list#x [t1h#x]) - : +- Project [t2d#xL] ++- Filter NOT t1d#x IN (list#x [t1h#x]) + : +- Project [t2d#x] : +- Filter (outer(t1h#x) < t2h#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -175,28 +155,22 @@ Aggregate [count(1) AS count(1)#xL] : +- Aggregate [t2c#x], [min(t2b#x) AS min(t2b)#x] : +- Filter (t2b#x = t2b#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- Project [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +- Filter NOT t2a#x IN (list#x [t2h#x]) : +- Project [t3a#x] : +- Filter NOT (t3h#x = outer(t2h#x)) : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -211,21 +185,16 @@ GROUP BY t1a -- !query analysis Aggregate [t1a#x], [t1a#x, max(t1b#x) AS max(t1b)#x] +- Filter NOT t1c#x IN (list#x [t1a#x]) - : +- Project [cast(max(t2b)#x as int) AS max(t2b)#x] - : +- Aggregate [t2a#x], [max(t2b#x) AS max(t2b)#x] - : +- Filter (outer(t1a#x) = t2a#x) - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Aggregate [t2a#x], [max(t2b#x) AS max(t2b)#x] + : +- Filter (outer(t1a#x) = t2a#x) + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -241,28 +210,21 @@ WHERE t1c IN (SELECT t2b -- !query analysis Project [t1a#x, t1b#x] +- Filter t1c#x IN (list#x []) - : +- Project [cast(t2b#x as int) AS t2b#x] - : +- Project [t2b#x] - : +- Sort [t2a#x ASC NULLS FIRST], true - : +- Project [t2b#x, t2a#x] - : +- Filter NOT t2a#x IN (list#x [t2a#x]) - : : +- Aggregate [t3b#x], [min(t3a#x) AS min(t3a)#x] - : : +- Filter (t3a#x = outer(t2a#x)) - : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Project [t2b#x] + : +- Sort [t2a#x ASC NULLS FIRST], true + : +- Project [t2b#x, t2a#x] + : +- Filter NOT t2a#x IN (list#x [t2a#x]) + : : +- Aggregate [t3b#x], [min(t3a#x) AS min(t3a)#x] + : : +- Filter (t3a#x = outer(t2a#x)) + : : +- SubqueryAlias t3 + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-joins.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-joins.sql.out index 2c4946dadcf63..531d5e0d14173 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-joins.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-joins.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -123,24 +111,18 @@ Project [t1a#x, t1b#x, t1c#x, t3a#x, t3b#x, t3c#x] +- Filter (NOT t1a#x IN (list#x []) AND (t1b#x = t3b#x)) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Join Inner :- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t3 - +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -171,43 +153,33 @@ ORDER BY t1a, t3b Sort [t1a#x ASC NULLS FIRST, t3b#x ASC NULLS FIRST], true +- Filter (count(DISTINCT t3a)#xL >= cast(1 as bigint)) +- Aggregate [t1a#x, t1b#x, t1c#x, t3a#x, t3b#x, t3c#x], [t1a#x, t1b#x, t1c#x, count(distinct t3a#x) AS count(DISTINCT t3a)#xL, t3b#x, t3c#x] - +- Filter ((NOT t1a#x IN (list#x []) AND NOT (t1b#x = t3b#x)) AND (t1d#xL = t2d#xL)) + +- Filter ((NOT t1a#x IN (list#x []) AND NOT (t1b#x = t3b#x)) AND (t1d#x = t2d#x)) : +- Project [t2a#x] : +- Filter NOT t2c#x IN (list#x [t2a#x]) : : +- Project [t1c#x] : : +- Filter (t1a#x = outer(t2a#x)) : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- Join RightOuter, (t1c#x = t2c#x) :- Join FullOuter, NOT (t1b#x = t3b#x) : :- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t2 - +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -231,44 +203,34 @@ AND t1d NOT IN RIGHT JOIN t1 on t2e = t1e WHERE t1a = t2a) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1h#x] -+- Filter (NOT t1a#x IN (list#x [t1d#xL]) AND NOT t1d#xL IN (list#x [])) +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1h#x] ++- Filter (NOT t1a#x IN (list#x [t1d#x]) AND NOT t1d#x IN (list#x [])) : :- Project [t2a#x] - : : +- Filter (outer(t1d#xL) = t2d#xL) + : : +- Filter (outer(t1d#x) = t2d#x) : : +- Join LeftOuter, (t2b#x = t3b#x) : : :- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- Project [t2d#xL] + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Project [t2d#x] : +- Filter (t1a#x = t2a#x) : +- Join RightOuter, (t2e#x = t1e#x) : :- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -289,39 +251,31 @@ HAVING t1d NOT IN (SELECT t2d WHERE t1d = t2d) ORDER BY t1b DESC, t1d ASC -- !query analysis -Sort [t1b#x DESC NULLS LAST, t1d#xL ASC NULLS FIRST], true -+- Filter NOT t1d#xL IN (list#x [t1d#xL]) - : +- Project [t2d#xL] - : +- Filter (outer(t1d#xL) = t2d#xL) +Sort [t1b#x DESC NULLS LAST, t1d#x ASC NULLS FIRST], true ++- Filter NOT t1d#x IN (list#x [t1d#x]) + : +- Project [t2d#x] + : +- Filter (outer(t1d#x) = t2d#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- Aggregate [t1b#x, t1c#x, t1d#xL], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#xL] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + +- Aggregate [t1b#x, t1c#x, t1d#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#x] +- Filter NOT t1a#x IN (list#x []) : +- Project [t2a#x] : +- Filter NOT (t2b#x = t1b#x) : +- Join Inner : :- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -340,30 +294,24 @@ GROUP BY t1b, t1d HAVING t1b < sum(t1c) -- !query analysis -Project [count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#xL] +Project [count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#x] +- Filter (cast(t1b#x as bigint) < sum(t1c)#xL) - +- Aggregate [t1b#x, t1c#x, t1d#xL], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#xL, sum(t1c#x) AS sum(t1c)#xL] + +- Aggregate [t1b#x, t1c#x, t1d#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#x, sum(t1c#x) AS sum(t1c)#xL] +- Filter NOT t1a#x IN (list#x []) : +- Project [t2a#x] : +- Join Inner, (t1a#x = t2a#x) : :- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t1 - : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- SubqueryAlias t1 - : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -389,41 +337,31 @@ GROUP BY t1b, t1d HAVING t1b < sum(t1c) -- !query analysis -Project [count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#xL] +Project [count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#x] +- Filter (cast(t1b#x as bigint) < sum(t1c)#xL) - +- Aggregate [t1b#x, t1c#x, t1d#xL], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#xL, sum(t1c#x) AS sum(t1c)#xL] - +- Filter (NOT t1a#x IN (list#x []) AND NOT t1d#xL IN (list#x [])) + +- Aggregate [t1b#x, t1c#x, t1d#x], [count(distinct t1a#x) AS count(DISTINCT t1a)#xL, t1b#x, t1c#x, t1d#x, sum(t1c#x) AS sum(t1c)#xL] + +- Filter (NOT t1a#x IN (list#x []) AND NOT t1d#x IN (list#x [])) : :- Project [t2a#x] : : +- Join Inner, (t1a#x = t2a#x) : : :- SubqueryAlias t2 - : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : : +- SubqueryAlias t2 - : : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : : +- SubqueryAlias t1 - : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - : : +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - : : +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : : +- SubqueryAlias t1 - : : +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - : +- Project [t2d#xL] + : : +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + : : +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- Project [t2d#x] : +- Join Inner, (t2b#x = t3b#x) : :- SubqueryAlias t2 - : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as double) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : : +- SubqueryAlias t2 - : : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as double) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] : +- SubqueryAlias t3 - : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as double) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t3 - : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] + : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as double) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as double) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as double) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out index e8a8e46d1d122..e5615e59d69a5 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out @@ -1,21 +1,17 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, null), (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query analysis -CreateViewCommand `m`, SELECT * FROM VALUES +CreateViewCommand `m`, [(a,None), (b,None)], VALUES (null, null), (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b), false, false, LocalTempView, UNSUPPORTED, true - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + (4, 5.0), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -28,10 +24,8 @@ Project [a#x, b#x] +- Filter ((b#x = 1.0) AND NOT named_struct(a, a#x, b, b#x) IN (named_struct(col1, 2, col2, 3.0))) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -44,10 +38,8 @@ Project [a#x, b#x] +- Filter ((b#x = 3.0) AND NOT named_struct(a, a#x, b, b#x) IN (named_struct(col1, 2, col2, 3.0))) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -60,7 +52,5 @@ Project [a#x, b#x] +- Filter ((b#x = 5.0) AND NOT named_struct(a, a#x, b, b#x) IN (named_struct(col1, 2, col2, 3.0))) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out index f7dac3e2c4675..9d30199b2cc2b 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out @@ -1,40 +1,32 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, null), (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query analysis -CreateViewCommand `m`, SELECT * FROM VALUES +CreateViewCommand `m`, [(a,None), (b,None)], VALUES (null, null), (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b), false, false, LocalTempView, UNSUPPORTED, true - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + (4, 5.0), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query -CREATE TEMPORARY VIEW s AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW s(c, d) AS VALUES (null, null), (0, 1.0), (2, 3.0), (4, null) - AS s(c, d) -- !query analysis -CreateViewCommand `s`, SELECT * FROM VALUES +CreateViewCommand `s`, [(c,None), (d,None)], VALUES (null, null), (0, 1.0), (2, 3.0), - (4, null) - AS s(c, d), false, false, LocalTempView, UNSUPPORTED, true - +- Project [c#x, d#x] - +- SubqueryAlias s - +- LocalRelation [c#x, d#x] + (4, null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -50,16 +42,12 @@ Project [a#x, b#x] : +- Filter (d#x > 5.0) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -75,16 +63,12 @@ Project [a#x, b#x] : +- Filter (isnull(c#x) AND isnull(d#x)) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -101,16 +85,12 @@ Project [a#x, b#x] : +- Filter isnotnull(c#x) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -127,16 +107,12 @@ Project [a#x, b#x] : +- Filter isnotnull(c#x) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -153,16 +129,12 @@ Project [a#x, b#x] : +- Filter (c#x = 2) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -179,16 +151,12 @@ Project [a#x, b#x] : +- Filter (c#x = 2) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -205,13 +173,9 @@ Project [a#x, b#x] : +- Filter (c#x = 2) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out index 7de84bb97346a..2812b7643c5b0 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out @@ -1,19 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query analysis -CreateViewCommand `m`, SELECT * FROM VALUES +CreateViewCommand `m`, [(a,None), (b,None)], VALUES (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b), false, false, LocalTempView, UNSUPPORTED, true - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + (4, 5.0), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -25,10 +21,8 @@ Project [a#x, b#x] +- Filter NOT cast(a#x as int) IN (cast(null as int)) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -41,10 +35,8 @@ Project [a#x, b#x] +- Filter ((b#x = 1.0) AND NOT a#x IN (2)) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -57,10 +49,8 @@ Project [a#x, b#x] +- Filter ((b#x = 3.0) AND NOT a#x IN (2)) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -73,7 +63,5 @@ Project [a#x, b#x] +- Filter ((b#x = 3.0) AND NOT a#x IN (6)) +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out index 8c234dd5b7d70..a2296f6f643d0 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out @@ -1,36 +1,28 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query analysis -CreateViewCommand `m`, SELECT * FROM VALUES +CreateViewCommand `m`, [(a,None), (b,None)], VALUES (null, 1.0), (2, 3.0), - (4, 5.0) - AS m(a, b), false, false, LocalTempView, UNSUPPORTED, true - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + (4, 5.0), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query -CREATE TEMPORARY VIEW s AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW s(c, d) AS VALUES (null, 1.0), (2, 3.0), (6, 7.0) - AS s(c, d) -- !query analysis -CreateViewCommand `s`, SELECT * FROM VALUES +CreateViewCommand `s`, [(c,None), (d,None)], VALUES (null, 1.0), (2, 3.0), - (6, 7.0) - AS s(c, d), false, false, LocalTempView, UNSUPPORTED, true - +- Project [c#x, d#x] - +- SubqueryAlias s - +- LocalRelation [c#x, d#x] + (6, 7.0), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query @@ -46,16 +38,12 @@ Project [a#x, b#x] : +- Filter (cast(d#x as decimal(3,1)) > 10.0) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -71,16 +59,12 @@ Project [a#x, b#x] : +- Filter (d#x = 1.0) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -97,16 +81,12 @@ Project [a#x, b#x] : +- Filter (d#x = 3.0) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -123,16 +103,12 @@ Project [a#x, b#x] : +- Filter (d#x = 3.0) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -149,16 +125,12 @@ Project [a#x, b#x] : +- Filter (d#x = 7.0) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -174,16 +146,12 @@ Project [a#x, b#x] : +- Filter (cast(d#x as decimal(4,1)) = (outer(b#x) + cast(10 as decimal(2,0)))) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -200,16 +168,12 @@ Project [a#x, b#x] : +- Filter (cast(d#x as decimal(4,1)) = (outer(b#x) + cast(10 as decimal(2,0)))) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -226,13 +190,9 @@ Project [a#x, b#x] : +- Filter (cast(d#x as decimal(4,1)) = (outer(b#x) + cast(10 as decimal(2,0)))) : +- SubqueryAlias s : +- View (`s`, [c#x, d#x]) - : +- Project [cast(c#x as int) AS c#x, cast(d#x as decimal(2,1)) AS d#x] - : +- Project [c#x, d#x] - : +- SubqueryAlias s - : +- LocalRelation [c#x, d#x] + : +- Project [cast(col1#x as int) AS c#x, cast(col2#x as decimal(2,1)) AS d#x] + : +- LocalRelation [col1#x, col2#x] +- SubqueryAlias m +- View (`m`, [a#x, b#x]) - +- Project [cast(a#x as int) AS a#x, cast(b#x as decimal(2,1)) AS b#x] - +- Project [a#x, b#x] - +- SubqueryAlias m - +- LocalRelation [a#x, b#x] + +- Project [cast(col1#x as int) AS a#x, cast(col2#x as decimal(2,1)) AS b#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/simple-in.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/simple-in.sql.out index f3f5aa7fcade4..3061024550c07 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/simple-in.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/subquery/in-subquery/simple-in.sql.out @@ -1,109 +1,97 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query analysis -CreateViewCommand `t1`, select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +CreateViewCommand `t1`, [(t1a,None), (t1b,None), (t1c,None), (t1d,None), (t1e,None), (t1f,None), (t1g,None), (t1h,None), (t1i,None)], values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t2 as select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query analysis -CreateViewCommand `t2`, select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - +- SubqueryAlias t2 - +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] +CreateViewCommand `t2`, [(t2a,None), (t2b,None), (t2c,None), (t2d,None), (t2e,None), (t2f,None), (t2g,None), (t2h,None), (t2i,None)], values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view t3 as select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query analysis -CreateViewCommand `t3`, select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i), false, false, LocalTempView, UNSUPPORTED, true - +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] +CreateViewCommand `t3`, [(t3a,None), (t3b,None), (t3c,None), (t3d,None), (t3e,None), (t3f,None), (t3g,None), (t3h,None), (t3i,None)], values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04'), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -112,21 +100,17 @@ FROM t1 WHERE t1a IN (SELECT t2a FROM t2) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -136,22 +120,18 @@ WHERE t1b IN (SELECT t2b FROM t2 WHERE t1a = t2a) -- !query analysis -Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +Project [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] +- Filter t1b#x IN (list#x [t1a#x]) : +- Project [t2b#x] : +- Filter (outer(t1a#x) = t2a#x) : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -164,21 +144,16 @@ WHERE t1c IN (SELECT t2b -- !query analysis Project [t1a#x, t1b#x] +- Filter t1c#x IN (list#x [t1a#x]) - : +- Project [cast(t2b#x as int) AS t2b#x] - : +- Project [t2b#x] - : +- Filter NOT (outer(t1a#x) = t2a#x) - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Project [t2b#x] + : +- Filter NOT (outer(t1a#x) = t2a#x) + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -192,21 +167,16 @@ WHERE t1c IN (SELECT t2b -- !query analysis Project [t1a#x, t1b#x] +- Filter t1c#x IN (list#x [t1a#x && t1b#x]) - : +- Project [cast(t2b#x as int) AS t2b#x] - : +- Project [t2b#x] - : +- Filter ((outer(t1a#x) = t2a#x) OR (outer(t1b#x) > t2b#x)) - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Project [t2b#x] + : +- Filter ((outer(t1a#x) = t2a#x) OR (outer(t1b#x) > t2b#x)) + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -221,29 +191,22 @@ WHERE t1c IN (SELECT t2b -- !query analysis Project [t1a#x, t1b#x] +- Filter t1c#x IN (list#x []) - : +- Project [cast(t2b#x as int) AS t2b#x] - : +- Project [t2b#x] - : +- Filter t2i#x IN (list#x [t2c#x]) - : : +- Project [t3i#x] - : : +- Filter (outer(t2c#x) = t3c#x) - : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Project [t2b#x] + : +- Filter t2i#x IN (list#x [t2c#x]) + : : +- Project [t3i#x] + : : +- Filter (outer(t2c#x) = t3c#x) + : : +- SubqueryAlias t3 + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -259,29 +222,22 @@ WHERE t1c IN (SELECT t2b -- !query analysis Project [t1a#x, t1b#x] +- Filter t1c#x IN (list#x []) - : +- Project [cast(t2b#x as int) AS t2b#x] - : +- Project [t2b#x] - : +- Filter t2a#x IN (list#x [t2c#x && t2b#x]) - : : +- Project [t3a#x] - : : +- Filter ((outer(t2c#x) = t3c#x) AND isnotnull(outer(t2b#x))) - : : +- SubqueryAlias t3 - : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) - : : +- Project [cast(t3a#x as string) AS t3a#x, cast(t3b#x as smallint) AS t3b#x, cast(t3c#x as int) AS t3c#x, cast(t3d#xL as bigint) AS t3d#xL, cast(t3e#x as float) AS t3e#x, cast(t3f#x as double) AS t3f#x, cast(t3g#x as decimal(4,0)) AS t3g#x, cast(t3h#x as timestamp) AS t3h#x, cast(t3i#x as date) AS t3i#x] - : : +- Project [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : : +- SubqueryAlias t3 - : : +- LocalRelation [t3a#x, t3b#x, t3c#x, t3d#xL, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x] - : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- Project [t2b#x] + : +- Filter t2a#x IN (list#x [t2c#x && t2b#x]) + : : +- Project [t3a#x] + : : +- Filter ((outer(t2c#x) = t3c#x) AND isnotnull(outer(t2b#x))) + : : +- SubqueryAlias t3 + : : +- View (`t3`, [t3a#x, t3b#x, t3c#x, t3d#x, t3e#x, t3f#x, t3g#x, t3h#x, t3i#x]) + : : +- Project [cast(col1#x as string) AS t3a#x, cast(col2#x as int) AS t3b#x, cast(col3#x as int) AS t3c#x, cast(col4#x as int) AS t3d#x, cast(col5#x as decimal(3,1)) AS t3e#x, cast(col6#x as decimal(3,1)) AS t3f#x, cast(col7#x as decimal(5,1)) AS t3g#x, cast(col8#x as timestamp) AS t3h#x, cast(col9#x as date) AS t3i#x] + : : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] + : +- SubqueryAlias t2 + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query @@ -297,43 +253,31 @@ Distinct +- Filter NOT t1a#x IN (list#x []) : +- Project [t2a#x] : +- SubqueryAlias t2 - : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) - : +- Project [cast(t2a#x as string) AS t2a#x, cast(t2b#x as smallint) AS t2b#x, cast(t2c#x as int) AS t2c#x, cast(t2d#xL as bigint) AS t2d#xL, cast(t2e#x as float) AS t2e#x, cast(t2f#x as double) AS t2f#x, cast(t2g#x as decimal(4,0)) AS t2g#x, cast(t2h#x as timestamp) AS t2h#x, cast(t2i#x as date) AS t2i#x] - : +- Project [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] - : +- SubqueryAlias t2 - : +- LocalRelation [t2a#x, t2b#x, t2c#x, t2d#xL, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x] + : +- View (`t2`, [t2a#x, t2b#x, t2c#x, t2d#x, t2e#x, t2f#x, t2g#x, t2h#x, t2i#x]) + : +- Project [cast(col1#x as string) AS t2a#x, cast(col2#x as int) AS t2b#x, cast(col3#x as int) AS t2c#x, cast(col4#x as int) AS t2d#x, cast(col5#x as decimal(3,1)) AS t2e#x, cast(col6#x as decimal(3,1)) AS t2f#x, cast(col7#x as decimal(5,1)) AS t2g#x, cast(col8#x as timestamp) AS t2h#x, cast(col9#x as date) AS t2i#x] + : +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] +- SubqueryAlias t1 - +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) - +- Project [cast(t1a#x as string) AS t1a#x, cast(t1b#x as smallint) AS t1b#x, cast(t1c#x as int) AS t1c#x, cast(t1d#xL as bigint) AS t1d#xL, cast(t1e#x as float) AS t1e#x, cast(t1f#x as double) AS t1f#x, cast(t1g#x as decimal(4,0)) AS t1g#x, cast(t1h#x as timestamp) AS t1h#x, cast(t1i#x as date) AS t1i#x] - +- Project [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] - +- SubqueryAlias t1 - +- LocalRelation [t1a#x, t1b#x, t1c#x, t1d#xL, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x] + +- View (`t1`, [t1a#x, t1b#x, t1c#x, t1d#x, t1e#x, t1f#x, t1g#x, t1h#x, t1i#x]) + +- Project [cast(col1#x as string) AS t1a#x, cast(col2#x as int) AS t1b#x, cast(col3#x as int) AS t1c#x, cast(col4#x as int) AS t1d#x, cast(col5#x as decimal(3,1)) AS t1e#x, cast(col6#x as decimal(3,1)) AS t1f#x, cast(col7#x as decimal(5,1)) AS t1g#x, cast(col8#x as timestamp) AS t1h#x, cast(col9#x as date) AS t1i#x] + +- LocalRelation [col1#x, col2#x, col3#x, col4#x, col5#x, col6#x, col7#x, col8#x, col9#x] -- !query -create temporary view a as select * from values +create temporary view a(a1, a2) as values (1, 1), (2, 1), (null, 1), (1, 3), (null, 3), (1, null), (null, 2) - as a(a1, a2) -- !query analysis -CreateViewCommand `a`, select * from values - (1, 1), (2, 1), (null, 1), (1, 3), (null, 3), (1, null), (null, 2) - as a(a1, a2), false, false, LocalTempView, UNSUPPORTED, true - +- Project [a1#x, a2#x] - +- SubqueryAlias a - +- LocalRelation [a1#x, a2#x] +CreateViewCommand `a`, [(a1,None), (a2,None)], values + (1, 1), (2, 1), (null, 1), (1, 3), (null, 3), (1, null), (null, 2), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x] -- !query -create temporary view b as select * from values +create temporary view b(b1, b2, b3) as values (1, 1, 2), (null, 3, 2), (1, null, 2), (1, 2, null) - as b(b1, b2, b3) -- !query analysis -CreateViewCommand `b`, select * from values - (1, 1, 2), (null, 3, 2), (1, null, 2), (1, 2, null) - as b(b1, b2, b3), false, false, LocalTempView, UNSUPPORTED, true - +- Project [b1#x, b2#x, b3#x] - +- SubqueryAlias b - +- LocalRelation [b1#x, b2#x, b3#x] +CreateViewCommand `b`, [(b1,None), (b2,None), (b3,None)], values + (1, 1, 2), (null, 3, 2), (1, null, 2), (1, 2, null), false, false, LocalTempView, UNSUPPORTED, true + +- LocalRelation [col1#x, col2#x, col3#x] -- !query @@ -349,16 +293,12 @@ Project [a1#x, a2#x] : +- Filter (outer(a2#x) = b2#x) : +- SubqueryAlias b : +- View (`b`, [b1#x, b2#x, b3#x]) - : +- Project [cast(b1#x as int) AS b1#x, cast(b2#x as int) AS b2#x, cast(b3#x as int) AS b3#x] - : +- Project [b1#x, b2#x, b3#x] - : +- SubqueryAlias b - : +- LocalRelation [b1#x, b2#x, b3#x] + : +- Project [cast(col1#x as int) AS b1#x, cast(col2#x as int) AS b2#x, cast(col3#x as int) AS b3#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias a +- View (`a`, [a1#x, a2#x]) - +- Project [cast(a1#x as int) AS a1#x, cast(a2#x as int) AS a2#x] - +- Project [a1#x, a2#x] - +- SubqueryAlias a - +- LocalRelation [a1#x, a2#x] + +- Project [cast(col1#x as int) AS a1#x, cast(col2#x as int) AS a2#x] + +- LocalRelation [col1#x, col2#x] -- !query @@ -375,13 +315,9 @@ Project [a1#x, a2#x] : +- Filter ((outer(a2#x) = b2#x) AND (b3#x > 1)) : +- SubqueryAlias b : +- View (`b`, [b1#x, b2#x, b3#x]) - : +- Project [cast(b1#x as int) AS b1#x, cast(b2#x as int) AS b2#x, cast(b3#x as int) AS b3#x] - : +- Project [b1#x, b2#x, b3#x] - : +- SubqueryAlias b - : +- LocalRelation [b1#x, b2#x, b3#x] + : +- Project [cast(col1#x as int) AS b1#x, cast(col2#x as int) AS b2#x, cast(col3#x as int) AS b3#x] + : +- LocalRelation [col1#x, col2#x, col3#x] +- SubqueryAlias a +- View (`a`, [a1#x, a2#x]) - +- Project [cast(a1#x as int) AS a1#x, cast(a2#x as int) AS a2#x] - +- Project [a1#x, a2#x] - +- SubqueryAlias a - +- LocalRelation [a1#x, a2#x] + +- Project [cast(col1#x as int) AS a1#x, cast(col2#x as int) AS a2#x] + +- LocalRelation [col1#x, col2#x] diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-basic.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-basic.sql.out index cb806fdaf8205..2a7c53be110cf 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-basic.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-basic.sql.out @@ -1,16 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query schema struct<> -- !query output @@ -18,14 +17,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -33,16 +31,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -57,17 +54,17 @@ WHERE EXISTS (SELECT 1 WHERE dept.dept_id > 10 AND dept.dept_id < 30) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -77,14 +74,14 @@ WHERE EXISTS (SELECT dept.dept_name FROM dept WHERE emp.dept_id = dept.dept_id) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -95,15 +92,15 @@ WHERE EXISTS (SELECT dept.dept_name WHERE emp.dept_id = dept.dept_id OR emp.dept_id IS NULL) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +800 emp 8 2016-01-01 150.00 70 -- !query @@ -114,11 +111,11 @@ WHERE EXISTS (SELECT dept.dept_name WHERE emp.dept_id = dept.dept_id) AND emp.id > 200 -- !query schema -struct +struct -- !query output -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -800 emp 8 2016-01-01 150.0 70 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -170,12 +167,12 @@ WHERE NOT EXISTS (SELECT * WHERE emp.emp_name = emp_name AND bonus_amt > emp.salary) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 4 100.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 4 100.00 -- !query @@ -185,10 +182,10 @@ WHERE NOT EXISTS (SELECT NULL FROM bonus WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -201,11 +198,11 @@ WHERE EXISTS (SELECT emp_name FROM dept WHERE dept.dept_id = emp.dept_id)) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 -emp 4 100.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 +emp 4 100.00 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-cte.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-cte.sql.out index 09d8cb3bccc88..6b33df42c64af 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-cte.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-cte.sql.out @@ -1,16 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query schema struct<> -- !query output @@ -18,14 +17,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -33,16 +31,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -71,12 +68,12 @@ WHERE a.bonus_amt > 30 FROM bonus_cte b WHERE a.emp_name = b.emp_name) -- !query schema -struct +struct -- !query output -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 -emp 4 100.0 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 +emp 4 100.00 -- !query @@ -97,12 +94,12 @@ WHERE EXISTS (SELECT * ON a.dept_id = b.dept_id WHERE bonus.emp_name = a.emp_name) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 -- !query @@ -128,13 +125,13 @@ WHERE e.dept_id = d.dept_id ON a.dept_id = b.dept_id WHERE e.emp_name = a.emp_name) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 -- !query @@ -157,14 +154,14 @@ WHERE EXISTS (SELECT dept_id, HAVING count(*) > 1) GROUP BY emp_name -- !query schema -struct +struct -- !query output -emp 1 30.0 -emp 2 400.0 -emp 3 300.0 -emp 4 100.0 -emp 5 1000.0 -emp 6 - no dept 500.0 +emp 1 30.00 +emp 2 400.00 +emp 3 300.00 +emp 4 100.00 +emp 5 1000.00 +emp 6 - no dept 500.00 -- !query @@ -187,11 +184,11 @@ WHERE NOT EXISTS (SELECT dept_id, HAVING count(*) < 1) GROUP BY emp_name -- !query schema -struct +struct -- !query output -emp 1 30.0 -emp 2 400.0 -emp 3 300.0 -emp 4 100.0 -emp 5 1000.0 -emp 6 - no dept 500.0 +emp 1 30.00 +emp 2 400.00 +emp 3 300.00 +emp 4 100.00 +emp 5 1000.00 +emp 6 - no dept 500.00 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out index d030b92ed4a62..a38c97e1928c4 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-joins-and-set-ops.sql.out @@ -1,16 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query schema struct<> -- !query output @@ -18,14 +17,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -33,16 +31,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -58,13 +55,13 @@ WHERE emp.dept_id = dept.dept_id FROM bonus WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 10 dept 1 CA -100 emp 1 2005-01-01 100.0 10 10 dept 1 CA -200 emp 2 2003-01-01 200.0 10 10 dept 1 CA -300 emp 3 2002-01-01 300.0 20 20 dept 2 NY -400 emp 4 2005-01-01 400.0 30 30 dept 3 TX +100 emp 1 2005-01-01 100.00 10 10 dept 1 CA +100 emp 1 2005-01-01 100.00 10 10 dept 1 CA +200 emp 2 2003-01-01 200.00 10 10 dept 1 CA +300 emp 3 2002-01-01 300.00 20 20 dept 2 NY +400 emp 4 2005-01-01 400.00 30 30 dept 3 TX -- !query @@ -76,13 +73,13 @@ WHERE EXISTS (SELECT * FROM bonus WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 10 dept 1 CA -100 emp 1 2005-01-01 100.0 10 10 dept 1 CA -200 emp 2 2003-01-01 200.0 10 10 dept 1 CA -300 emp 3 2002-01-01 300.0 20 20 dept 2 NY -400 emp 4 2005-01-01 400.0 30 30 dept 3 TX +100 emp 1 2005-01-01 100.00 10 10 dept 1 CA +100 emp 1 2005-01-01 100.00 10 10 dept 1 CA +200 emp 2 2003-01-01 200.00 10 10 dept 1 CA +300 emp 3 2002-01-01 300.00 20 20 dept 2 NY +400 emp 4 2005-01-01 400.00 30 30 dept 3 TX -- !query @@ -94,15 +91,15 @@ WHERE EXISTS (SELECT * FROM bonus WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 10 dept 1 CA -100 emp 1 2005-01-01 100.0 10 10 dept 1 CA -200 emp 2 2003-01-01 200.0 10 10 dept 1 CA -300 emp 3 2002-01-01 300.0 20 20 dept 2 NY -400 emp 4 2005-01-01 400.0 30 30 dept 3 TX -500 emp 5 2001-01-01 400.0 NULL NULL NULL NULL -600 emp 6 - no dept 2001-01-01 400.0 100 NULL NULL NULL +100 emp 1 2005-01-01 100.00 10 10 dept 1 CA +100 emp 1 2005-01-01 100.00 10 10 dept 1 CA +200 emp 2 2003-01-01 200.00 10 10 dept 1 CA +300 emp 3 2002-01-01 300.00 20 20 dept 2 NY +400 emp 4 2005-01-01 400.00 30 30 dept 3 TX +500 emp 5 2001-01-01 400.00 NULL NULL NULL NULL +600 emp 6 - no dept 2001-01-01 400.00 100 NULL NULL NULL -- !query @@ -114,9 +111,9 @@ WHERE emp.dept_id = dept.dept_id FROM bonus WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -800 emp 8 2016-01-01 150.0 70 70 dept 7 FL +800 emp 8 2016-01-01 150.00 70 70 dept 7 FL -- !query @@ -128,14 +125,14 @@ WHERE EXISTS (SELECT * ON dept.dept_id = emp.dept_id WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 -emp 4 100.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 +emp 4 100.00 -- !query @@ -147,14 +144,14 @@ WHERE EXISTS (SELECT * ON dept.dept_id = emp.dept_id WHERE bonus.emp_name = emp.emp_name) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 -emp 4 100.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 +emp 4 100.00 -- !query @@ -172,14 +169,14 @@ WHERE EXISTS (SELECT dept.dept_id, emp.emp_name ORDER BY emp.emp_name) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 -emp 4 100.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 +emp 4 100.00 -- !query @@ -197,9 +194,9 @@ WHERE EXISTS (SELECT emp_name, ORDER BY emp_name) GROUP BY emp_name -- !query schema -struct +struct -- !query output -emp 1 30.0 +emp 1 30.00 -- !query @@ -217,13 +214,13 @@ WHERE NOT EXISTS (SELECT emp_name, ORDER BY emp_name) GROUP BY emp_name -- !query schema -struct +struct -- !query output -emp 2 400.0 -emp 3 300.0 -emp 4 100.0 -emp 5 1000.0 -emp 6 - no dept 500.0 +emp 2 400.00 +emp 3 300.00 +emp 4 100.00 +emp 5 1000.00 +emp 6 - no dept 500.00 -- !query @@ -238,17 +235,17 @@ WHERE EXISTS (SELECT * WHERE dept_id >= 30 AND dept_id <= 50) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -263,7 +260,7 @@ WHERE EXISTS (SELECT * WHERE dept_id >= 30 AND dept_id <= 50) -- !query schema -struct +struct -- !query output @@ -280,17 +277,17 @@ WHERE NOT EXISTS (SELECT * WHERE dept_id >= 30 AND dept_id <= 50) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -314,17 +311,17 @@ WHERE EXISTS (SELECT * WHERE dept_id >= 30 AND dept_id <= 50) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -348,16 +345,16 @@ WHERE EXISTS (SELECT * WHERE dept_id >= 30 AND dept_id <= 50) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -365,18 +362,18 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' UNION SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -400 emp 4 2005-01-01 400.0 30 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +400 emp 4 2005-01-01 400.00 30 -- !query @@ -384,19 +381,19 @@ SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' UNION SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output -300 emp 3 2002-01-01 300.0 20 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +300 emp 3 2002-01-01 300.00 20 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -404,13 +401,13 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output @@ -420,13 +417,13 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output @@ -436,17 +433,17 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 -- !query @@ -454,17 +451,17 @@ SELECT * FROM emp WHERE EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 -- !query @@ -472,23 +469,23 @@ SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' INTERSECT ALL SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -496,17 +493,17 @@ SELECT * FROM emp WHERE NOT EXISTS (SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "CA" + WHERE dept_id = emp.dept_id and state = 'CA' EXCEPT DISTINCT SELECT * FROM dept - WHERE dept_id = emp.dept_id and state = "TX") + WHERE dept_id = emp.dept_id and state = 'TX') -- !query schema -struct +struct -- !query output -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-orderby-limit.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-orderby-limit.sql.out index 7d7537e384412..fbe55a693130e 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-orderby-limit.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-orderby-limit.sql.out @@ -1,16 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query schema struct<> -- !query output @@ -18,14 +17,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -33,16 +31,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -58,14 +55,14 @@ WHERE EXISTS (SELECT dept.dept_id ORDER BY state) ORDER BY hiredate -- !query schema -struct +struct -- !query output -300 emp 3 2002-01-01 300.0 20 -200 emp 2 2003-01-01 200.0 10 -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -400 emp 4 2005-01-01 400.0 30 -800 emp 8 2016-01-01 150.0 70 +300 emp 3 2002-01-01 300.00 20 +200 emp 2 2003-01-01 200.00 10 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +400 emp 4 2005-01-01 400.00 30 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -98,14 +95,14 @@ WHERE EXISTS (SELECT dept.dept_id LIMIT 1) ORDER BY hiredate -- !query schema -struct +struct -- !query output -300 emp 3 2002-01-01 300.0 20 -200 emp 2 2003-01-01 200.0 10 -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -400 emp 4 2005-01-01 400.0 30 -800 emp 8 2016-01-01 150.0 70 +300 emp 3 2002-01-01 300.00 20 +200 emp 2 2003-01-01 200.00 10 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +400 emp 4 2005-01-01 400.00 30 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -118,7 +115,7 @@ WHERE EXISTS (SELECT dept.dept_id LIMIT 0) ORDER BY hiredate -- !query schema -struct +struct -- !query output @@ -132,11 +129,11 @@ WHERE NOT EXISTS (SELECT dept.dept_id ORDER BY state) ORDER BY hiredate -- !query schema -struct +struct -- !query output -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 -- !query @@ -179,11 +176,11 @@ WHERE NOT EXISTS (SELECT dept.dept_id LIMIT 1) ORDER BY hiredate -- !query schema -struct +struct -- !query output -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 -- !query @@ -196,17 +193,17 @@ WHERE NOT EXISTS (SELECT dept.dept_id LIMIT 0) ORDER BY hiredate -- !query schema -struct +struct -- !query output -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -300 emp 3 2002-01-01 300.0 20 -200 emp 2 2003-01-01 200.0 10 -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -400 emp 4 2005-01-01 400.0 30 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +300 emp 3 2002-01-01 300.00 20 +200 emp 2 2003-01-01 200.00 10 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +400 emp 4 2005-01-01 400.00 30 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -217,17 +214,17 @@ WHERE EXISTS (SELECT dept.dept_name WHERE dept.dept_id > 10 LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -238,17 +235,17 @@ WHERE EXISTS (SELECT max(dept.dept_id) GROUP BY state LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -259,17 +256,17 @@ WHERE NOT EXISTS (SELECT dept.dept_name WHERE dept.dept_id > 100 LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -281,17 +278,17 @@ WHERE NOT EXISTS (SELECT max(dept.dept_id) GROUP BY state LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -327,17 +324,17 @@ WHERE EXISTS (SELECT dept.dept_name LIMIT 1 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -348,13 +345,13 @@ WHERE EXISTS (SELECT dept.dept_name WHERE dept.dept_id > emp.dept_id LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 -- !query @@ -366,17 +363,17 @@ WHERE EXISTS (SELECT max(dept.dept_id) LIMIT 1 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -388,16 +385,16 @@ WHERE EXISTS (SELECT max(dept.dept_id) GROUP BY state LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -408,17 +405,17 @@ WHERE EXISTS (SELECT max(dept.dept_id) WHERE emp.salary > 200 LIMIT 1) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -430,13 +427,13 @@ WHERE EXISTS (SELECT state, max(dept.dept_name) GROUP BY state LIMIT 1) -- !query schema -struct +struct -- !query output -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 -- !query @@ -448,17 +445,17 @@ WHERE NOT EXISTS (SELECT dept.dept_name LIMIT 1 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -471,17 +468,17 @@ WHERE NOT EXISTS (SELECT max(dept.dept_id) LIMIT 1 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -493,16 +490,16 @@ WHERE EXISTS (SELECT dept.dept_name LIMIT 1 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -513,17 +510,17 @@ WHERE EXISTS (SELECT dept.dept_name WHERE dept.dept_id > 10 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -534,17 +531,17 @@ WHERE EXISTS (SELECT max(dept.dept_id) GROUP BY state OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -555,17 +552,17 @@ WHERE NOT EXISTS (SELECT dept.dept_name WHERE dept.dept_id > 100 OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 -- !query @@ -577,14 +574,14 @@ WHERE NOT EXISTS (SELECT max(dept.dept_id) GROUP BY state OFFSET 2) -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -600 emp 6 - no dept 2001-01-01 400.0 100 -700 emp 7 2010-01-01 400.0 100 -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +600 emp 6 - no dept 2001-01-01 400.00 100 +700 emp 7 2010-01-01 400.00 100 +800 emp 8 2016-01-01 150.00 70 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-outside-filter.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-outside-filter.sql.out index 8e92017f24dba..03bfd88385d60 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-outside-filter.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-outside-filter.sql.out @@ -1,16 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query schema struct<> -- !query output @@ -18,14 +17,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -33,16 +31,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -101,9 +98,9 @@ SELECT AND dept.dept_id < 30)) FROM emp -- !query schema -struct +struct -- !query output -2450.0 2450.0 +2450.00 2450.00 -- !query @@ -114,9 +111,9 @@ SELECT WHERE emp.dept_id = dept.dept_id)) FROM emp -- !query schema -struct +struct -- !query output -2450.0 1250.0 +2450.00 1250.00 -- !query @@ -130,9 +127,9 @@ SELECT WHERE emp.emp_name = bonus.emp_name)) FROM emp -- !query schema -struct +struct -- !query output -2450.0 2050.0 +2450.00 2050.00 -- !query @@ -143,9 +140,9 @@ SELECT WHERE emp.dept_id = dept.dept_id)) FROM emp -- !query schema -struct +struct -- !query output -1150.0 4 +1150.00 4 -- !query @@ -157,10 +154,10 @@ GROUP BY EXISTS (SELECT 1 FROM dept WHERE emp.dept_id = dept.dept_id) -- !query schema -struct +struct -- !query output -3 1200.0 -6 1250.0 +3 1200.00 +6 1250.00 -- !query @@ -172,10 +169,10 @@ GROUP BY EXISTS (SELECT 1 FROM dept WHERE emp.dept_id = dept.dept_id) -- !query schema -struct +struct -- !query output -2 400.0 -4 1150.0 +2 400.00 +4 1150.00 -- !query @@ -190,9 +187,9 @@ SELECT AND dept.dept_id < 30) THEN salary END) FROM emp -- !query schema -struct +struct -- !query output -9 2450.0 +9 2450.00 -- !query @@ -205,9 +202,9 @@ SELECT WHERE emp.dept_id = dept.dept_id) THEN salary END) FROM emp -- !query schema -struct +struct -- !query output -6 1250.0 +6 1250.00 -- !query @@ -219,17 +216,17 @@ SELECT AND dept.dept_id < 30)) FROM emp -- !query schema -struct +struct -- !query output -emp 1 2450.0 -emp 1 2450.0 -emp 2 2450.0 -emp 3 2450.0 -emp 4 2450.0 -emp 5 2450.0 -emp 6 - no dept 2450.0 -emp 7 2450.0 -emp 8 2450.0 +emp 1 2450.00 +emp 1 2450.00 +emp 2 2450.00 +emp 3 2450.00 +emp 4 2450.00 +emp 5 2450.00 +emp 6 - no dept 2450.00 +emp 7 2450.00 +emp 8 2450.00 -- !query @@ -240,14 +237,14 @@ SELECT WHERE emp.dept_id = dept.dept_id)) FROM emp -- !query schema -struct +struct -- !query output -emp 1 1250.0 -emp 1 1250.0 -emp 2 1250.0 -emp 3 1250.0 -emp 4 1250.0 -emp 5 1200.0 -emp 6 - no dept 1200.0 -emp 7 1200.0 -emp 8 1250.0 +emp 1 1250.00 +emp 1 1250.00 +emp 2 1250.00 +emp 3 1250.00 +emp 4 1250.00 +emp 5 1200.00 +emp 6 - no dept 1200.00 +emp 7 1200.00 +emp 8 1250.00 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-within-and-or.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-within-and-or.sql.out index b6f4c5c5c319d..cbede0663032f 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-within-and-or.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/exists-subquery/exists-within-and-or.sql.out @@ -1,16 +1,15 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (100, "emp 1", date "2005-01-01", 100.00D, 10), - (200, "emp 2", date "2003-01-01", 200.00D, 10), - (300, "emp 3", date "2002-01-01", 300.00D, 20), - (400, "emp 4", date "2005-01-01", 400.00D, 30), - (500, "emp 5", date "2001-01-01", 400.00D, NULL), - (600, "emp 6 - no dept", date "2001-01-01", 400.00D, 100), - (700, "emp 7", date "2010-01-01", 400.00D, 100), - (800, "emp 8", date "2016-01-01", 150.00D, 70) -AS EMP(id, emp_name, hiredate, salary, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, hiredate, salary, dept_id) AS VALUES + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (100, 'emp 1', DATE '2005-01-01', 100.00, 10), + (200, 'emp 2', DATE '2003-01-01', 200.00, 10), + (300, 'emp 3', DATE '2002-01-01', 300.00, 20), + (400, 'emp 4', DATE '2005-01-01', 400.00, 30), + (500, 'emp 5', DATE '2001-01-01', 400.00, NULL), + (600, 'emp 6 - no dept', DATE '2001-01-01', 400.00, 100), + (700, 'emp 7', DATE '2010-01-01', 400.00, 100), + (800, 'emp 8', DATE '2016-01-01', 150.00, 70) -- !query schema struct<> -- !query output @@ -18,14 +17,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -33,16 +31,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -78,15 +75,15 @@ WHERE EXISTS (SELECT dept.dept_name WHERE emp.dept_id = dept.dept_id) OR emp.dept_id IS NULL -- !query schema -struct +struct -- !query output -100 emp 1 2005-01-01 100.0 10 -100 emp 1 2005-01-01 100.0 10 -200 emp 2 2003-01-01 200.0 10 -300 emp 3 2002-01-01 300.0 20 -400 emp 4 2005-01-01 400.0 30 -500 emp 5 2001-01-01 400.0 NULL -800 emp 8 2016-01-01 150.0 70 +100 emp 1 2005-01-01 100.00 10 +100 emp 1 2005-01-01 100.00 10 +200 emp 2 2003-01-01 200.00 10 +300 emp 3 2002-01-01 300.00 20 +400 emp 4 2005-01-01 400.00 30 +500 emp 5 2001-01-01 400.00 NULL +800 emp 8 2016-01-01 150.00 70 -- !query @@ -119,16 +116,16 @@ WHERE ( NOT EXISTS (SELECT * WHERE emp.emp_name = emp_name OR bonus_amt < emp.salary) ) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 2 300.0 -emp 3 300.0 -emp 4 100.0 -emp 5 1000.0 -emp 6 - no dept 500.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 2 300.00 +emp 3 300.00 +emp 4 100.00 +emp 5 1000.00 +emp 6 - no dept 500.00 -- !query @@ -145,9 +142,9 @@ emp_name IN FROM emp WHERE bonus_amt < emp.salary) -- !query schema -struct +struct -- !query output -emp 1 10.0 -emp 1 20.0 -emp 2 100.0 -emp 4 100.0 +emp 1 10.00 +emp 1 20.00 +emp 2 100.00 +emp 4 100.00 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-group-by.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-group-by.sql.out index 42abf286d45dd..03dc6bf01afd1 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-group-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-group-by.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -88,7 +85,7 @@ WHERE t1b IN (SELECT t2b GROUP BY t1a, t1d -- !query schema -struct +struct -- !query output t1b 8 @@ -103,7 +100,7 @@ WHERE t1c IN (SELECT t2c GROUP BY t1a, t1b -- !query schema -struct +struct -- !query output t1b 8 t1c 8 @@ -155,7 +152,7 @@ WHERE t1c IN (SELECT t2c WHERE t1a = t2a) GROUP BY t1a, t1c -HAVING t1a = "t1b" +HAVING t1a = 't1b' -- !query schema struct -- !query output @@ -169,16 +166,16 @@ WHERE t1b IN (SELECT Max(t2b) FROM t2 GROUP BY t2a) -- !query schema -struct +struct -- !query output -t1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -t1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -t1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -t1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -t1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -t1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -t1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -t1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +t1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +t1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +t1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +t1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +t1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +t1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +t1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +t1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -192,7 +189,7 @@ FROM (SELECT t2a, GROUP BY t2a, t2b) t2 -- !query schema -struct +struct -- !query output t1b 8 @@ -222,7 +219,7 @@ WHERE t1c IN (SELECT Max(t2c) t2c HAVING t2c > 8) -- !query schema -struct +struct -- !query output t1b 8 t1c 8 @@ -240,7 +237,7 @@ WHERE t1c IN (SELECT t2c GROUP BY t3b) GROUP BY t2c) -- !query schema -struct +struct -- !query output t1a 16 t1a 16 @@ -260,7 +257,7 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t2a) GROUP BY t1a -- !query schema -struct +struct -- !query output t1b 8 t1c 8 @@ -280,7 +277,7 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t1a, t1d -- !query schema -struct +struct -- !query output t1b 8 t1c 8 @@ -302,7 +299,7 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t3d) GROUP BY t1a -- !query schema -struct +struct -- !query output t1b 8 t1c 8 @@ -322,7 +319,7 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t3d) GROUP BY t1a -- !query schema -struct +struct -- !query output t1a 16 t1b 8 @@ -347,7 +344,7 @@ WHERE t1c IN (SELECT Min(t2c) GROUP BY t1a HAVING Min(t1b) IS NOT NULL -- !query schema -struct +struct -- !query output t1a 16 t1b 8 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-having.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-having.sql.out index e4b5db98c5605..156940d424cf0 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-having.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-having.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -73,7 +70,7 @@ WHERE t1b IN (SELECT t2b GROUP BY t2b HAVING t2b < 10) -- !query schema -struct +struct -- !query output val1a 6 2014-04-04 01:00:00 val1a 6 2014-04-04 01:02:00.001 @@ -92,7 +89,7 @@ WHERE t1b IN (SELECT Min(t2b) GROUP BY t2b HAVING t2b > 1) -- !query schema -struct +struct -- !query output val1b 8 16 @@ -106,7 +103,7 @@ WHERE t1b IN (SELECT t2b GROUP BY t1a, t1b, t1c HAVING t1b < 10 -- !query schema -struct +struct -- !query output val1a 6 8 @@ -120,7 +117,7 @@ WHERE t1b IN (SELECT t2b GROUP BY t1a, t1b, t1c HAVING COUNT (DISTINCT t1b) < 10 -- !query schema -struct +struct -- !query output val1b 8 16 val1c 8 16 @@ -138,7 +135,7 @@ WHERE t1c IN (SELECT t2c GROUP BY t1b HAVING t1b >= 8 -- !query schema -struct +struct -- !query output 2 8 @@ -156,7 +153,7 @@ HAVING t1a IN (SELECT t2a WHERE t2c = t3c) ) -- !query schema -struct +struct -- !query output val1b 8 @@ -173,7 +170,7 @@ WHERE t1a NOT IN (SELECT t2a GROUP BY t1a, t1c HAVING Min(t1d) > t1c -- !query schema -struct +struct -- !query output val1a 8 10 val1b 16 19 @@ -193,7 +190,7 @@ WHERE t1d NOT IN (SELECT t2d GROUP BY t1a, t1b HAVING t1b < 10 -- !query schema -struct +struct -- !query output val1a 6 @@ -208,7 +205,7 @@ HAVING t1a NOT IN (SELECT t2a FROM t2 WHERE t2b > 3) -- !query schema -struct +struct -- !query output val1a 16 val1d 10 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-order-by.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-order-by.sql.out index b06fd3dd6fc2f..122ecd8a7c037 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-order-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-order-by.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -70,13 +67,13 @@ WHERE t1a IN (SELECT t2a FROM t2) ORDER BY t1a -- !query schema -struct +struct -- !query output -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -101,7 +98,7 @@ WHERE t1c IN (SELECT t2c WHERE t1a = t2a) ORDER BY 2 DESC nulls last -- !query schema -struct +struct -- !query output val1b 8 val1c 8 @@ -127,10 +124,10 @@ WHERE t1b IN (SELECT t2c FROM t2 ORDER BY t2d) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 -- !query @@ -142,16 +139,16 @@ WHERE t1b IN (SELECT Min(t2b) ORDER BY Min(t2b)) ORDER BY t1c DESC nulls first, t1a DESC, t1d DESC, t1h -- !query schema -struct +struct -- !query output -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 -- !query @@ -168,7 +165,7 @@ WHERE t1c IN (SELECT t2c WHERE t1h > t2h) ORDER BY t1h DESC nulls last -- !query schema -struct +struct -- !query output val1c 8 2014-05-04 01:02:00.001 val1b 8 2014-05-04 01:01:00 @@ -181,15 +178,15 @@ WHERE t1a NOT IN (SELECT t2a FROM t2) ORDER BY t1a -- !query schema -struct +struct -- !query output -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 -- !query @@ -201,7 +198,7 @@ WHERE t1a NOT IN (SELECT t2a WHERE t1a = t2a) ORDER BY t1b DESC nulls last -- !query schema -struct +struct -- !query output val1a 16 val1a 16 @@ -223,12 +220,12 @@ WHERE t1a NOT IN (SELECT t2a ORDER BY t2b DESC nulls last) ORDER BY t1c DESC nulls last -- !query schema -struct +struct -- !query output -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 -- !query @@ -239,12 +236,12 @@ WHERE t1b IN (SELECT Min(t2b) GROUP BY t2a ORDER BY t2a DESC) -- !query schema -struct +struct -- !query output -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 -- !query @@ -273,14 +270,14 @@ WHERE t1b NOT IN (SELECT Min(t2b) GROUP BY t2a ORDER BY t2a) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -315,7 +312,7 @@ GROUP BY t1a, t1b ORDER BY t1b DESC nulls last -- !query schema -struct +struct -- !query output 1 16 1 10 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-set-operations.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-set-operations.sql.out index 0669cdf0cf61c..2ff792af6336d 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-set-operations.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-set-operations.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -82,7 +79,7 @@ WHERE t2i IS NOT NULL AND 2 * t2b = t2c ORDER BY t2c DESC nulls first -- !query schema -struct +struct -- !query output val1b 8 16 2015-05-04 01:01:00 2015-05-04 val1b 8 16 2014-07-04 01:01:00 2014-07-04 @@ -113,11 +110,11 @@ GROUP BY t2a, t2i ORDER BY t2d DESC -- !query schema -struct +struct -- !query output val1b 8 119 1 2015-05-04 -val1b 8 19 1 2014-07-04 val1b 8 19 1 2014-05-04 +val1b 8 19 1 2014-07-04 -- !query @@ -161,7 +158,7 @@ WHERE t1a IN (SELECT t3a WHERE t3d = t1d) GROUP BY t1a, t1b, t1c -- !query schema -struct +struct -- !query output val1b 10 12 19 val1b 8 16 119 @@ -207,7 +204,7 @@ GROUP BY t2a, t2i HAVING t2b IS NOT NULL -- !query schema -struct +struct -- !query output val1b 8 1 119 2015-05-04 01:01:00 2015-05-04 val1b 8 1 19 2014-07-04 01:01:00 2014-07-04 @@ -263,7 +260,7 @@ WHERE t2d IN (SELECT min(t1d) FROM t1 WHERE t2c = t1c) -- !query schema -struct +struct -- !query output val1b 8 1 119 2015-05-04 01:01:00 2015-05-04 val1b 8 1 19 2014-07-04 01:01:00 2014-07-04 @@ -310,7 +307,7 @@ WHERE t2c IN (SELECT Max(t1c) FROM t1 WHERE t1d = t2d) -- !query schema -struct +struct -- !query output val1b 8 16 119 val1b 8 16 19 @@ -352,7 +349,7 @@ GROUP BY t1a, t1b, t1c, t1d HAVING t1c IS NOT NULL AND t1b IS NOT NULL ORDER BY t1c DESC, t1a DESC -- !query schema -struct +struct -- !query output val1c 8 16 19 val1b 8 16 19 @@ -376,7 +373,7 @@ WHERE t1b IN (SELECT t2b WHERE t1b > 6) AS t3 WHERE t2b = t1b) -- !query schema -struct +struct -- !query output val1b 8 16 val1c 8 16 @@ -399,7 +396,7 @@ WHERE t1h IN (SELECT t2h FROM t3) AS t3) ORDER BY t1b DESC NULLs first, t1c DESC NULLs last -- !query schema -struct +struct -- !query output val1d NULL 16 val1a 16 12 @@ -444,7 +441,7 @@ WHERE t1b IN WHERE t2b = t1b) ORDER BY t1c DESC NULLS last, t1a DESC -- !query schema -struct +struct -- !query output val1c 8 16 val1b 8 16 @@ -495,9 +492,9 @@ FROM (SELECT * FROM t3 WHERE t4.t2a = t3a)) -- !query schema -struct +struct -- !query output -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -528,7 +525,7 @@ WHERE t3.t2a NOT IN (SELECT t1a AND t2c IS NOT NULL ORDER BY t2a -- !query schema -struct +struct -- !query output val2a 6 12 2014-04-04 val2a 6 12 2014-04-04 @@ -579,7 +576,7 @@ HAVING t1b NOT IN FROM t3) ORDER BY t1c DESC NULLS LAST, t1i -- !query schema -struct +struct -- !query output 1 8 16 2014-05-04 1 8 16 2014-05-05 @@ -602,9 +599,9 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -617,9 +614,9 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -632,9 +629,9 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -647,9 +644,9 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -662,7 +659,7 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output @@ -677,7 +674,7 @@ WHERE t1a IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output @@ -692,19 +689,19 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -717,19 +714,19 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -742,19 +739,19 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -767,19 +764,19 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -792,20 +789,20 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -818,17 +815,17 @@ WHERE t1a NOT IN (SELECT t2a SELECT t3a FROM t3) -- !query schema -struct +struct -- !query output -val1a 16 12 10 15.0 20.0 2000 2014-07-04 01:01:00 2014-07-04 -val1a 16 12 21 15.0 20.0 2000 2014-06-04 01:02:00.001 2014-06-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:00:00 2014-04-04 -val1a 6 8 10 15.0 20.0 2000 2014-04-04 01:02:00.001 2014-04-04 -val1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -val1d 10 NULL 12 17.0 25.0 2600 2015-05-04 01:01:00 2015-05-04 -val1d NULL 16 19 17.0 25.0 2600 2014-07-04 01:02:00.001 NULL -val1d NULL 16 22 17.0 25.0 2600 2014-06-04 01:01:00 NULL -val1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -val1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -val1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +val1a 16 12 10 15.0 20.0 2000.0 2014-07-04 01:01:00 2014-07-04 +val1a 16 12 21 15.0 20.0 2000.0 2014-06-04 01:02:00.001 2014-06-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:00:00 2014-04-04 +val1a 6 8 10 15.0 20.0 2000.0 2014-04-04 01:02:00.001 2014-04-04 +val1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +val1d 10 NULL 12 17.0 25.0 2600.0 2015-05-04 01:01:00 2015-05-04 +val1d NULL 16 19 17.0 25.0 2600.0 2014-07-04 01:02:00.001 NULL +val1d NULL 16 22 17.0 25.0 2600.0 2014-06-04 01:01:00 NULL +val1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +val1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +val1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-with-cte.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-with-cte.sql.out index 562b8302e1c33..5bdd42a5a7d12 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-with-cte.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-with-cte.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -68,7 +65,7 @@ WITH cte1 AS (SELECT t1a, t1b FROM t1 - WHERE t1a = "val1a") + WHERE t1a = 'val1a') SELECT t1a, t1b, t1c, @@ -79,7 +76,7 @@ WHERE t1b IN (SELECT cte1.t1b FROM cte1 WHERE cte1.t1b > 0) -- !query schema -struct +struct -- !query output val1a 16 12 10 2014-07-04 01:01:00 val1a 16 12 21 2014-06-04 01:02:00.001 @@ -116,7 +113,7 @@ WHERE t1b IN GROUP BY t1a, t1b, t1c HAVING t1c IS NOT NULL -- !query schema -struct +struct -- !query output 1 16 12 1 6 8 @@ -153,7 +150,7 @@ WHERE t1c IN LEFT OUTER JOIN cte1 cte6 ON cte1.t1d > cte6.t1d) -- !query schema -struct +struct -- !query output val1b 8 16 2014-05-04 01:01:00 val1c 8 16 2014-05-04 01:02:00.001 @@ -172,7 +169,7 @@ WITH cte1 ON t1c = t2c LEFT JOIN t3 ON t2d = t3d) - AND t1a = "val1b") + AND t1a = 'val1b') SELECT * FROM (SELECT * FROM cte1 @@ -184,7 +181,7 @@ FROM (SELECT * INNER JOIN cte1 cte4 ON cte1.t1b = cte4.t1b) s -- !query schema -struct +struct -- !query output val1b 8 val1b 8 val1b 8 val1b 8 @@ -215,7 +212,7 @@ WHERE t1b IN FROM t1) GROUP BY t1b -- !query schema -struct +struct -- !query output 2 8 @@ -232,7 +229,7 @@ WITH cte1 AS SELECT t2b FROM t2 FULL OUTER JOIN T3 on t2a = t3a WHERE t1c = t2c) AND - t1a = "val1b") + t1a = 'val1b') SELECT * FROM ( SELECT * @@ -242,7 +239,7 @@ FROM ( LEFT OUTER JOIN cte1 cte4 ON cte1.t1c = cte4.t1c ) s -- !query schema -struct +struct -- !query output val1b 8 16 val1b 8 16 val1b 8 16 val1b 8 16 @@ -264,7 +261,7 @@ FROM (SELECT cte1.t1a, ON cte1.t1a = cte2.t1a) s GROUP BY s.t1b -- !query schema -struct +struct -- !query output 2 8 @@ -293,7 +290,7 @@ WHERE s.t1b IN JOIN cte1 ON t1.t1a = cte1.t1a) -- !query schema -struct +struct -- !query output 8 @@ -303,7 +300,7 @@ WITH cte1 AS (SELECT t1a, t1b FROM t1 - WHERE t1a = "val1d") + WHERE t1a = 'val1d') SELECT t1a, t1b, t1c, @@ -314,7 +311,7 @@ WHERE t1b NOT IN (SELECT cte1.t1b WHERE cte1.t1b < 0) AND t1c > 10 -- !query schema -struct +struct -- !query output val1a 16 12 2014-06-04 01:02:00.001 val1a 16 12 2014-07-04 01:01:00 @@ -355,7 +352,7 @@ WHERE t1b NOT IN t1c IS NOT NULL ORDER BY t1c DESC -- !query schema -struct +struct -- !query output val1b 8 16 19 2014-05-04 01:01:00 val1c 8 16 19 2014-05-04 01:02:00.001 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/nested-not-in.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/nested-not-in.sql.out index 874e7a602e766..9f80710b4d418 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/nested-not-in.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/nested-not-in.sql.out @@ -1,14 +1,13 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES - (100, "emp 1", 10), - (200, "emp 2", NULL), - (300, "emp 3", 20), - (400, "emp 4", 30), - (500, "emp 5", NULL), - (600, "emp 6", 100), - (800, "emp 8", 70) -AS EMP(id, emp_name, dept_id) +CREATE TEMPORARY VIEW EMP(id, emp_name, dept_id) AS VALUES + (100, 'emp 1', 10), + (200, 'emp 2', NULL), + (300, 'emp 3', 20), + (400, 'emp 4', 30), + (500, 'emp 5', NULL), + (600, 'emp 6', 100), + (800, 'emp 8', 70) -- !query schema struct<> -- !query output @@ -16,14 +15,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW DEPT AS SELECT * FROM VALUES - (10, "dept 1", "CA"), - (20, "dept 2", "NY"), - (30, "dept 3", "TX"), - (40, "dept 4 - unassigned", "OR"), - (50, "dept 5 - unassigned", "NJ"), - (70, "dept 7", "FL") -AS DEPT(dept_id, dept_name, state) +CREATE TEMPORARY VIEW DEPT(dept_id, dept_name, state) AS VALUES + (10, 'dept 1', 'CA'), + (20, 'dept 2', 'NY'), + (30, 'dept 3', 'TX'), + (40, 'dept 4 - unassigned', 'OR'), + (50, 'dept 5 - unassigned', 'NJ'), + (70, 'dept 7', 'FL') -- !query schema struct<> -- !query output @@ -31,16 +29,15 @@ struct<> -- !query -CREATE TEMPORARY VIEW BONUS AS SELECT * FROM VALUES - ("emp 1", 10.00D), - ("emp 1", 20.00D), - ("emp 2", 300.00D), - ("emp 2", 100.00D), - ("emp 3", 300.00D), - ("emp 4", 100.00D), - ("emp 5", 1000.00D), - ("emp 6 - no dept", 500.00D) -AS BONUS(emp_name, bonus_amt) +CREATE TEMPORARY VIEW BONUS(emp_name, bonus_amt) AS VALUES + ('emp 1', 10.00), + ('emp 1', 20.00), + ('emp 2', 300.00), + ('emp 2', 100.00), + ('emp 3', 300.00), + ('emp 4', 100.00), + ('emp 5', 1000.00), + ('emp 6 - no dept', 500.00) -- !query schema struct<> -- !query output @@ -48,14 +45,13 @@ struct<> -- !query -CREATE TEMPORARY VIEW ADDRESS AS SELECT * FROM VALUES - (100, "emp 1", "addr1"), - (200, null, "addr2"), - (null, "emp 3", "addr3"), - (null, null, "addr4"), - (600, "emp 6", "addr6"), - (800, "emp 8", "addr8") -AS ADDRESS(id, emp_name, address) +CREATE TEMPORARY VIEW ADDRESS(id, emp_name, address) AS VALUES + (100, 'emp 1', 'addr1'), + (200, null, 'addr2'), + (null, 'emp 3', 'addr3'), + (null, null, 'addr4'), + (600, 'emp 6', 'addr6'), + (800, 'emp 8', 'addr8') -- !query schema struct<> -- !query output @@ -63,8 +59,8 @@ struct<> -- !query -CREATE TEMPORARY VIEW S1 AS SELECT * FROM VALUES - (null, null), (5, 5), (8, 8), (11, 11) AS s1(a, b) +CREATE TEMPORARY VIEW S1(a, b) AS VALUES + (null, null), (5, 5), (8, 8), (11, 11) -- !query schema struct<> -- !query output @@ -72,8 +68,8 @@ struct<> -- !query -CREATE TEMPORARY VIEW S2 AS SELECT * FROM VALUES - (7, 7), (8, 8), (11, 11), (null, null) AS s2(c, d) +CREATE TEMPORARY VIEW S2(c, d) AS VALUES + (7, 7), (8, 8), (11, 11), (null, null) -- !query schema struct<> -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-group-by.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-group-by.sql.out index 1b51206950c27..24593393df3d0 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-group-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-group-by.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -120,7 +117,7 @@ WHERE t1c NOT IN (SELECT Max(t2b) GROUP BY t2a) GROUP BY t1a -- !query schema -struct +struct -- !query output val1a 16 val1b 8 @@ -139,7 +136,7 @@ WHERE t1c IN (SELECT t2b WHERE t3a = t2a GROUP BY t3b) order by t2a) -- !query schema -struct +struct -- !query output val1a 16 val1a 16 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-joins.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-joins.sql.out index 9aeff336c6d9b..ada43cef7e9b4 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-joins.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-joins.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1a", 16S, 12, 21L, float(15.0), 20D, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("val1a", 16S, 12, 10L, float(15.0), 20D, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("val1d", null, 16, 22L, float(17.0), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', null), - ("val1d", null, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-07-04 01:02:00.001', null), - ("val1e", 10S, null, 25L, float(17.0), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("val1d", 10S, null, 12L, float(17.0), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("val1e", 10S, null, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1a', 16, 12, 21, 15.0, 20.0, 20E2, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('val1a', 16, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('val1d', null, 16, 22, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', null), + ('val1d', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.001', null), + ('val1e', 10, null, 25, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('val1d', 10, null, 12, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('val1e', 10, null, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("val2a", 6S, 12, 14L, float(15), 20D, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 119L, float(17), 25D, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("val1c", 12S, 16, 219L, float(17), 25D, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("val1b", null, 16, 319L, float(17), 25D, 26E2, timestamp '2017-05-04 01:01:00.000', null), - ("val2e", 8S, null, 419L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1f", 19S, null, 519L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("val1c", 12S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("val1e", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("val1f", 19S, null, 19L, float(17), 25D, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('val2a', 6, 12, 14, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 8, 16, 119, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('val1c', 12, 16, 219, 17.0, 25.0, 26E2, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('val1b', null, 16, 319, 17.0, 25.0, 26E2, timestamp '2017-05-04 01:01:00.000', null), + ('val2e', 8, null, 419, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1f', 19, null, 519, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('val1c', 12, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('val1e', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('val1f', 19, null, 19, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("val3a", 6S, 12, 110L, float(15), 20D, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("val3a", 6S, 12, 10L, float(15), 20D, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 219L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 10S, 12, 19L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val1b", 8S, 16, 319L, float(17), 25D, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("val1b", 8S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("val3c", 17S, 16, 519L, float(17), 25D, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("val3c", 17S, 16, 19L, float(17), 25D, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("val1b", null, 16, 419L, float(17), 25D, 26E2, timestamp '2014-10-04 01:02:00.000', null), - ("val1b", null, 16, 19L, float(17), 25D, 26E2, timestamp '2014-11-04 01:02:00.000', null), - ("val3b", 8S, null, 719L, float(17), 25D, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("val3b", 8S, null, 19L, float(17), 25D, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('val3a', 6, 12, 110, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('val3a', 6, 12, 10, 15.0, 20.0, 20E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 219, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 10, 12, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val1b', 8, 16, 319, 17.0, 25.0, 26E2, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('val3c', 17, 16, 519, 17.0, 25.0, 26E2, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('val3c', 17, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('val1b', null, 16, 419, 17.0, 25.0, 26E2, timestamp '2014-10-04 01:02:00.000', null), + ('val1b', null, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-11-04 01:02:00.000', null), + ('val3b', 8, null, 719, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('val3b', 8, null, 19, 17.0, 25.0, 26E2, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -76,7 +73,7 @@ WHERE t1a NOT IN (SELECT t2a FROM t2) AND t1b = t3b -- !query schema -struct +struct -- !query output val1a 6 8 val3a 6 12 val1a 6 8 val3a 6 12 @@ -111,7 +108,7 @@ GROUP BY t1a, t1b, t1c, t3a, t3b, t3c HAVING count(distinct(t3a)) >= 1 ORDER BY t1a, t3b -- !query schema -struct +struct -- !query output val1c 8 16 1 6 12 val1c 8 16 1 10 12 @@ -139,7 +136,7 @@ AND t1d NOT IN RIGHT JOIN t1 on t2e = t1e WHERE t1a = t2a) -- !query schema -struct +struct -- !query output val1a 16 12 10 2014-07-04 01:01:00 val1a 16 12 21 2014-06-04 01:02:00.001 @@ -168,7 +165,7 @@ HAVING t1d NOT IN (SELECT t2d WHERE t1d = t2d) ORDER BY t1b DESC, t1d ASC -- !query schema -struct +struct -- !query output 1 16 12 10 1 16 12 21 @@ -193,7 +190,7 @@ GROUP BY t1b, t1d HAVING t1b < sum(t1c) -- !query schema -struct +struct -- !query output 1 6 8 10 @@ -221,6 +218,6 @@ GROUP BY t1b, t1d HAVING t1b < sum(t1c) -- !query schema -struct +struct -- !query output 1 6 8 10 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out index 2dc9d63c42b5f..e820a982b7a61 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql.out @@ -1,11 +1,10 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, null), (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query schema struct<> -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out index 525179f7ffcbd..84145242e0cf8 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-multi-column.sql.out @@ -1,11 +1,10 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, null), (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query schema struct<> -- !query output @@ -13,12 +12,11 @@ struct<> -- !query -CREATE TEMPORARY VIEW s AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW s(c, d) AS VALUES (null, null), (0, 1.0), (2, 3.0), (4, null) - AS s(c, d) -- !query schema struct<> -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out index 084a4fdbee28f..338e3331aa2e7 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql.out @@ -1,10 +1,9 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query schema struct<> -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out index fe115fb9753ec..12aaf6b60f398 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/not-in-unit-tests-single-column.sql.out @@ -1,10 +1,9 @@ -- Automatically generated by SQLQueryTestSuite -- !query -CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW m(a, b) AS VALUES (null, 1.0), (2, 3.0), (4, 5.0) - AS m(a, b) -- !query schema struct<> -- !query output @@ -12,11 +11,10 @@ struct<> -- !query -CREATE TEMPORARY VIEW s AS SELECT * FROM VALUES +CREATE TEMPORARY VIEW s(c, d) AS VALUES (null, 1.0), (2, 3.0), (6, 7.0) - AS s(c, d) -- !query schema struct<> -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/simple-in.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/simple-in.sql.out index c917bba4dbf47..610896d95b91a 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/simple-in.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/simple-in.sql.out @@ -1,19 +1,18 @@ -- Automatically generated by SQLQueryTestSuite -- !query -create temporary view t1 as select * from values - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), - ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1a", 16S, 12, 21L, float(15.0), 20D, 20E2BD, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), - ("t1a", 16S, 12, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), - ("t1d", null, 16, 22L, float(17.0), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', null), - ("t1d", null, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.001', null), - ("t1e", 10S, null, 25L, float(17.0), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), - ("t1d", 10S, null, 12L, float(17.0), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), - ("t1e", 10S, null, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') - as t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) +create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1a', 16, 12, 21, 15.0, 20.0, 2000.0, timestamp '2014-06-04 01:02:00.001', date '2014-06-04'), + ('t1a', 16, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.001', date '2014-05-05'), + ('t1d', null, 16, 22, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', null), + ('t1d', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.001', null), + ('t1e', 10, null, 25, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.001', date '2014-09-04'), + ('t1d', 10, null, 12, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.001', date '2014-04-04'), + ('t1e', 10, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04') -- !query schema struct<> -- !query output @@ -21,21 +20,20 @@ struct<> -- !query -create temporary view t2 as select * from values - ("t2a", 6S, 12, 14L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 119L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), - ("t1c", 12S, 16, 219L, float(17), 25D, 26E2BD, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), - ("t1b", null, 16, 319L, float(17), 25D, 26E2BD, timestamp '2017-05-04 01:01:00.000', null), - ("t2e", 8S, null, 419L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1f", 19S, null, 519L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), - ("t1c", 12S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), - ("t1e", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), - ("t1f", 19S, null, 19L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', null) - as t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) +create temporary view t2(t2a, t2b, t2c, t2d, t2e, t2f, t2g, t2h, t2i) as values + ('t2a', 6, 12, 14, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:01:00.000', date '2014-04-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 8, 16, 119, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:01:00.000', date '2015-05-04'), + ('t1c', 12, 16, 219, 17.0, 25.0, 2600.0, timestamp '2016-05-04 01:01:00.000', date '2016-05-04'), + ('t1b', null, 16, 319, 17.0, 25.0, 2600.0, timestamp '2017-05-04 01:01:00.000', null), + ('t2e', 8, null, 419, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1f', 19, null, 519, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:01:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:01:00.000', date '2014-07-04'), + ('t1c', 12, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:01:00.000', date '2014-08-05'), + ('t1e', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:01:00.000', date '2014-09-04'), + ('t1f', 19, null, 19, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:01:00.000', date '2014-10-04'), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', null) -- !query schema struct<> -- !query output @@ -43,20 +41,19 @@ struct<> -- !query -create temporary view t3 as select * from values - ("t3a", 6S, 12, 110L, float(15), 20D, 20E2BD, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), - ("t3a", 6S, 12, 10L, float(15), 20D, 20E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 219L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 10S, 12, 19L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t1b", 8S, 16, 319L, float(17), 25D, 26E2BD, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), - ("t1b", 8S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), - ("t3c", 17S, 16, 519L, float(17), 25D, 26E2BD, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), - ("t3c", 17S, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), - ("t1b", null, 16, 419L, float(17), 25D, 26E2BD, timestamp '2014-10-04 01:02:00.000', null), - ("t1b", null, 16, 19L, float(17), 25D, 26E2BD, timestamp '2014-11-04 01:02:00.000', null), - ("t3b", 8S, null, 719L, float(17), 25D, 26E2BD, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), - ("t3b", 8S, null, 19L, float(17), 25D, 26E2BD, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') - as t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) +create temporary view t3(t3a, t3b, t3c, t3d, t3e, t3f, t3g, t3h, t3i) as values + ('t3a', 6, 12, 110, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:02:00.000', date '2014-04-04'), + ('t3a', 6, 12, 10, 15.0, 20.0, 2000.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 219, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 10, 12, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t1b', 8, 16, 319, 17.0, 25.0, 2600.0, timestamp '2014-06-04 01:02:00.000', date '2014-06-04'), + ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-07-04 01:02:00.000', date '2014-07-04'), + ('t3c', 17, 16, 519, 17.0, 25.0, 2600.0, timestamp '2014-08-04 01:02:00.000', date '2014-08-04'), + ('t3c', 17, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-09-04 01:02:00.000', date '2014-09-05'), + ('t1b', null, 16, 419, 17.0, 25.0, 2600.0, timestamp '2014-10-04 01:02:00.000', null), + ('t1b', null, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-11-04 01:02:00.000', null), + ('t3b', 8, null, 719, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:02:00.000', date '2014-05-04'), + ('t3b', 8, null, 19, 17.0, 25.0, 2600.0, timestamp '2015-05-04 01:02:00.000', date '2015-05-04') -- !query schema struct<> -- !query output @@ -69,13 +66,13 @@ FROM t1 WHERE t1a IN (SELECT t2a FROM t2) -- !query schema -struct +struct -- !query output -t1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -t1c 8 16 19 17.0 25.0 2600 2014-05-04 01:02:00.001 2014-05-05 -t1e 10 NULL 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 -t1e 10 NULL 19 17.0 25.0 2600 2014-09-04 01:02:00.001 2014-09-04 -t1e 10 NULL 25 17.0 25.0 2600 2014-08-04 01:01:00 2014-08-04 +t1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +t1c 8 16 19 17.0 25.0 2600.0 2014-05-04 01:02:00.001 2014-05-05 +t1e 10 NULL 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 +t1e 10 NULL 19 17.0 25.0 2600.0 2014-09-04 01:02:00.001 2014-09-04 +t1e 10 NULL 25 17.0 25.0 2600.0 2014-08-04 01:01:00 2014-08-04 -- !query @@ -85,9 +82,9 @@ WHERE t1b IN (SELECT t2b FROM t2 WHERE t1a = t2a) -- !query schema -struct +struct -- !query output -t1b 8 16 19 17.0 25.0 2600 2014-05-04 01:01:00 2014-05-04 +t1b 8 16 19 17.0 25.0 2600.0 2014-05-04 01:01:00 2014-05-04 -- !query @@ -98,7 +95,7 @@ WHERE t1c IN (SELECT t2b FROM t2 WHERE t1a != t2a) -- !query schema -struct +struct -- !query output t1a 16 t1a 16 @@ -115,7 +112,7 @@ WHERE t1c IN (SELECT t2b WHERE t1a = t2a OR t1b > t2b) -- !query schema -struct +struct -- !query output t1a 16 t1a 16 @@ -131,7 +128,7 @@ WHERE t1c IN (SELECT t2b FROM t3 WHERE t2c = t3c)) -- !query schema -struct +struct -- !query output t1a 6 t1a 6 @@ -148,7 +145,7 @@ WHERE t1c IN (SELECT t2b WHERE t2c = t3c AND t2b IS NOT NULL)) -- !query schema -struct +struct -- !query output t1a 6 t1a 6 @@ -162,7 +159,7 @@ FROM t1 WHERE t1a NOT IN (SELECT t2a FROM t2) -- !query schema -struct +struct -- !query output t1a 16 2014-06-04 01:02:00.001 t1a 16 2014-07-04 01:01:00 @@ -174,9 +171,8 @@ t1d NULL 2014-07-04 01:02:00.001 -- !query -create temporary view a as select * from values +create temporary view a(a1, a2) as values (1, 1), (2, 1), (null, 1), (1, 3), (null, 3), (1, null), (null, 2) - as a(a1, a2) -- !query schema struct<> -- !query output @@ -184,9 +180,8 @@ struct<> -- !query -create temporary view b as select * from values +create temporary view b(b1, b2, b3) as values (1, 1, 2), (null, 3, 2), (1, null, 2), (1, 2, null) - as b(b1, b2, b3) -- !query schema struct<> -- !query output From 42e2911ccd7b6386e7db401c2985b23b309c6485 Mon Sep 17 00:00:00 2001 From: Andy Lam Date: Fri, 10 Jul 2026 17:35:38 +0000 Subject: [PATCH 3/3] Keep 8 subquery files Spark-only via --ONLY_IF spark These 8 files produce genuine Spark-vs-PostgreSQL divergences when run through PostgresSQLQueryTestSuite: timestamp fractional-second formatting (Spark '...00.0' vs Postgres '...00'), AVG decimal scale (Spark '8.0' vs Postgres '8.0000000000000000'), and implicit-cross-join syntax (FROM t1 JOIN t3 WHERE ... which Postgres rejects). Since --ONLY_IF is a whole-file directive with no per-query granularity, restore it on these files to keep them Spark-only, matching the option documented in PostgresSQLQueryTestSuite. The portable view DDL is retained (harmless). The remaining subquery files still run cross-DBMS against Postgres. --- .../sql-tests/inputs/subquery/in-subquery/in-group-by.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/in-having.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/in-order-by.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/in-set-operations.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/in-with-cte.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/not-in-joins.sql | 1 + .../sql-tests/inputs/subquery/in-subquery/simple-in.sql | 1 + 8 files changed, 8 insertions(+) diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql index e7318aefc9f43..4516b14ee6d32 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-group-by.sql @@ -6,6 +6,7 @@ --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN +--ONLY_IF spark create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ('t1b', 8, 16, 19, 17.0, 25.0, 2600.0, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql index ebb99f47ef5cc..2fe7c6470b0c3 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql @@ -4,6 +4,7 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false +--ONLY_IF spark create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values ('val1a', 6, 8, 10, 15.0, 20.0, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ('val1b', 8, 16, 19, 17.0, 25.0, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql index 3007ec61698af..77a4622795265 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql @@ -9,6 +9,7 @@ --CONFIG_DIM2 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM2 spark.sql.optimizeNullAwareAntiJoin=false +--ONLY_IF spark create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values ('val1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql index de7539228f78e..c2a686fa86823 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-set-operations.sql @@ -1,5 +1,6 @@ -- A test suite for set-operations in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--ONLY_IF spark --SET spark.sql.autoBroadcastJoinThreshold=-1 create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql index 7ef34d5454c7a..c16836914034c 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql @@ -1,5 +1,6 @@ -- A test suite for in with cte in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--ONLY_IF spark --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql index 6df3f0ae43084..c81b52c9fbf3a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-group-by.sql @@ -1,5 +1,6 @@ -- A test suite for NOT IN GROUP BY in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--ONLY_IF spark -- Test aggregate operator with codegen on and off. --CONFIG_DIM1 spark.sql.codegen.wholeStage=true diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql index e380fea328a69..2c4b6aa9bc90f 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql @@ -1,5 +1,6 @@ -- A test suite for not-in-joins in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--ONLY_IF spark --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql index 93aca803f56d3..6e479bffc6bab 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql @@ -3,6 +3,7 @@ --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true --CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false +--ONLY_IF spark create temporary view t1(t1a, t1b, t1c, t1d, t1e, t1f, t1g, t1h, t1i) as values ('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'),