diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala index 316aebdeaffa..86a429e06bb4 100644 --- a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala +++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/TypeCoercion.scala @@ -469,7 +469,7 @@ object TypeCoercion { val commonTypes = lhs.zip(rhs).flatMap { case (l, r) => findCommonTypeForBinaryComparison(l.dataType, r.dataType, conf) - .orElse(findTightestCommonType(l.dataType, r.dataType)) + .orElse(findWiderTypeWithoutStringPromotionForTwo(l.dataType, r.dataType)) } // The number of columns/expressions must match between LHS and RHS of an diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/negative-cases/subq-input-typecheck.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/negative-cases/subq-input-typecheck.sql index 95b115a8dd09..369a16989296 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/negative-cases/subq-input-typecheck.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/negative-cases/subq-input-typecheck.sql @@ -14,7 +14,7 @@ CREATE TEMPORARY VIEW t3 AS SELECT * FROM VALUES AS t3(t3a, t3b, t3c); CREATE TEMPORARY VIEW t4 AS SELECT * FROM VALUES - (CAST(1 AS DOUBLE), CAST(2 AS STRING), CAST(3 AS STRING)) + (CAST('2017-12-11' AS DATE), CAST(2 AS STRING), CAST('2017-12-11' AS DATE)) AS t1(t4a, t4b, t4c); CREATE TEMPORARY VIEW t5 AS SELECT * FROM VALUES diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/inConversion.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/inConversion.sql index 39dbe7268fba..f4bd2e44e752 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/inConversion.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/inConversion.sql @@ -328,3 +328,159 @@ SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as dat SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as date), cast(1 as boolean)) FROM t; SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp)) FROM t; SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as date), cast('2017-12-11 09:30:00' as date)) FROM t; + +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); + +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as tinyint) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as smallint) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as int) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as bigint) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as float) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as double) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as decimal(10, 0)) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as string) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast('1' as binary) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as boolean) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t); +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t); diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out index dcd30055bca1..f25f1227b30f 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out @@ -34,7 +34,7 @@ struct<> -- !query 3 CREATE TEMPORARY VIEW t4 AS SELECT * FROM VALUES - (CAST(1 AS DOUBLE), CAST(2 AS STRING), CAST(3 AS STRING)) + (CAST('2017-12-11' AS DATE), CAST(2 AS STRING), CAST('2017-12-11' AS DATE)) AS t1(t4a, t4b, t4c) -- !query 3 schema struct<> @@ -139,8 +139,8 @@ cannot resolve '(named_struct('t4a', t4.`t4a`, 't4b', t4.`t4b`, 't4c', t4.`t4c`) The data type of one or more elements in the left hand side of an IN subquery is not compatible with the data type of the output of the subquery Mismatched columns: -[(t4.`t4a`:double, t5.`t5a`:decimal(18,0)), (t4.`t4c`:string, t5.`t5c`:bigint)] +[(t4.`t4a`:date, t5.`t5a`:decimal(18,0)), (t4.`t4c`:date, t5.`t5c`:bigint)] Left side: -[double, string, string]. +[date, string, date]. Right side: [decimal(18,0), string, bigint].; diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out index 875ccc1341ec..507e79d06cbf 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 289 +-- Number of queries: 433 -- !query 0 @@ -2452,3 +2452,1749 @@ SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as dat struct<(CAST(2017-12-12 09:30:00 AS DATE) IN (CAST(2017-12-12 09:30:00 AS DATE), CAST(2017-12-11 09:30:00 AS DATE))):boolean> -- !query 288 output true + + +-- !query 289 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 289 schema +struct<1:int> +-- !query 289 output +1 + + +-- !query 290 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 290 schema +struct<1:int> +-- !query 290 output +1 + + +-- !query 291 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as int) FROM t) +-- !query 291 schema +struct<1:int> +-- !query 291 output +1 + + +-- !query 292 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 292 schema +struct<1:int> +-- !query 292 output +1 + + +-- !query 293 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as float) FROM t) +-- !query 293 schema +struct<1:int> +-- !query 293 output +1 + + +-- !query 294 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as double) FROM t) +-- !query 294 schema +struct<1:int> +-- !query 294 output +1 + + +-- !query 295 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 295 schema +struct<1:int> +-- !query 295 output +1 + + +-- !query 296 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as string) FROM t) +-- !query 296 schema +struct<1:int> +-- !query 296 output +1 + + +-- !query 297 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast('1' as binary) FROM t) +-- !query 297 schema +struct<> +-- !query 297 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS TINYINT):tinyint, `CAST(1 AS BINARY)`:binary)] +Left side: +[tinyint]. +Right side: +[binary].; + + +-- !query 298 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 298 schema +struct<> +-- !query 298 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS TINYINT):tinyint, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[tinyint]. +Right side: +[boolean].; + + +-- !query 299 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 299 schema +struct<> +-- !query 299 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS TINYINT):tinyint, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[tinyint]. +Right side: +[timestamp].; + + +-- !query 300 +SELECT * FROM t WHERE (cast(1 as tinyint)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 300 schema +struct<> +-- !query 300 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS TINYINT):tinyint, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[tinyint]. +Right side: +[date].; + + +-- !query 301 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 301 schema +struct<1:int> +-- !query 301 output +1 + + +-- !query 302 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 302 schema +struct<1:int> +-- !query 302 output +1 + + +-- !query 303 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as int) FROM t) +-- !query 303 schema +struct<1:int> +-- !query 303 output +1 + + +-- !query 304 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 304 schema +struct<1:int> +-- !query 304 output +1 + + +-- !query 305 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as float) FROM t) +-- !query 305 schema +struct<1:int> +-- !query 305 output +1 + + +-- !query 306 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as double) FROM t) +-- !query 306 schema +struct<1:int> +-- !query 306 output +1 + + +-- !query 307 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 307 schema +struct<1:int> +-- !query 307 output +1 + + +-- !query 308 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as string) FROM t) +-- !query 308 schema +struct<1:int> +-- !query 308 output +1 + + +-- !query 309 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast('1' as binary) FROM t) +-- !query 309 schema +struct<> +-- !query 309 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS SMALLINT):smallint, `CAST(1 AS BINARY)`:binary)] +Left side: +[smallint]. +Right side: +[binary].; + + +-- !query 310 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 310 schema +struct<> +-- !query 310 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS SMALLINT):smallint, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[smallint]. +Right side: +[boolean].; + + +-- !query 311 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 311 schema +struct<> +-- !query 311 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS SMALLINT):smallint, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[smallint]. +Right side: +[timestamp].; + + +-- !query 312 +SELECT * FROM t WHERE (cast(1 as smallint)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 312 schema +struct<> +-- !query 312 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS SMALLINT):smallint, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[smallint]. +Right side: +[date].; + + +-- !query 313 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 313 schema +struct<1:int> +-- !query 313 output +1 + + +-- !query 314 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 314 schema +struct<1:int> +-- !query 314 output +1 + + +-- !query 315 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as int) FROM t) +-- !query 315 schema +struct<1:int> +-- !query 315 output +1 + + +-- !query 316 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 316 schema +struct<1:int> +-- !query 316 output +1 + + +-- !query 317 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as float) FROM t) +-- !query 317 schema +struct<1:int> +-- !query 317 output +1 + + +-- !query 318 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as double) FROM t) +-- !query 318 schema +struct<1:int> +-- !query 318 output +1 + + +-- !query 319 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 319 schema +struct<1:int> +-- !query 319 output +1 + + +-- !query 320 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as string) FROM t) +-- !query 320 schema +struct<1:int> +-- !query 320 output +1 + + +-- !query 321 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast('1' as binary) FROM t) +-- !query 321 schema +struct<> +-- !query 321 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS INT):int, `CAST(1 AS BINARY)`:binary)] +Left side: +[int]. +Right side: +[binary].; + + +-- !query 322 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 322 schema +struct<> +-- !query 322 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS INT):int, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[int]. +Right side: +[boolean].; + + +-- !query 323 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 323 schema +struct<> +-- !query 323 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS INT):int, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[int]. +Right side: +[timestamp].; + + +-- !query 324 +SELECT * FROM t WHERE (cast(1 as int)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 324 schema +struct<> +-- !query 324 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS INT):int, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[int]. +Right side: +[date].; + + +-- !query 325 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 325 schema +struct<1:int> +-- !query 325 output +1 + + +-- !query 326 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 326 schema +struct<1:int> +-- !query 326 output +1 + + +-- !query 327 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as int) FROM t) +-- !query 327 schema +struct<1:int> +-- !query 327 output +1 + + +-- !query 328 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 328 schema +struct<1:int> +-- !query 328 output +1 + + +-- !query 329 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as float) FROM t) +-- !query 329 schema +struct<1:int> +-- !query 329 output +1 + + +-- !query 330 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as double) FROM t) +-- !query 330 schema +struct<1:int> +-- !query 330 output +1 + + +-- !query 331 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 331 schema +struct<1:int> +-- !query 331 output +1 + + +-- !query 332 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as string) FROM t) +-- !query 332 schema +struct<1:int> +-- !query 332 output +1 + + +-- !query 333 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast('1' as binary) FROM t) +-- !query 333 schema +struct<> +-- !query 333 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BIGINT):bigint, `CAST(1 AS BINARY)`:binary)] +Left side: +[bigint]. +Right side: +[binary].; + + +-- !query 334 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 334 schema +struct<> +-- !query 334 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BIGINT):bigint, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[bigint]. +Right side: +[boolean].; + + +-- !query 335 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 335 schema +struct<> +-- !query 335 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BIGINT):bigint, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[bigint]. +Right side: +[timestamp].; + + +-- !query 336 +SELECT * FROM t WHERE (cast(1 as bigint)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 336 schema +struct<> +-- !query 336 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BIGINT):bigint, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[bigint]. +Right side: +[date].; + + +-- !query 337 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 337 schema +struct<1:int> +-- !query 337 output +1 + + +-- !query 338 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 338 schema +struct<1:int> +-- !query 338 output +1 + + +-- !query 339 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as int) FROM t) +-- !query 339 schema +struct<1:int> +-- !query 339 output +1 + + +-- !query 340 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 340 schema +struct<1:int> +-- !query 340 output +1 + + +-- !query 341 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as float) FROM t) +-- !query 341 schema +struct<1:int> +-- !query 341 output +1 + + +-- !query 342 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as double) FROM t) +-- !query 342 schema +struct<1:int> +-- !query 342 output +1 + + +-- !query 343 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 343 schema +struct<1:int> +-- !query 343 output +1 + + +-- !query 344 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as string) FROM t) +-- !query 344 schema +struct<1:int> +-- !query 344 output +1 + + +-- !query 345 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast('1' as binary) FROM t) +-- !query 345 schema +struct<> +-- !query 345 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS FLOAT):float, `CAST(1 AS BINARY)`:binary)] +Left side: +[float]. +Right side: +[binary].; + + +-- !query 346 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 346 schema +struct<> +-- !query 346 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS FLOAT):float, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[float]. +Right side: +[boolean].; + + +-- !query 347 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 347 schema +struct<> +-- !query 347 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS FLOAT):float, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[float]. +Right side: +[timestamp].; + + +-- !query 348 +SELECT * FROM t WHERE (cast(1 as float)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 348 schema +struct<> +-- !query 348 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS FLOAT):float, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[float]. +Right side: +[date].; + + +-- !query 349 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 349 schema +struct<1:int> +-- !query 349 output +1 + + +-- !query 350 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 350 schema +struct<1:int> +-- !query 350 output +1 + + +-- !query 351 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as int) FROM t) +-- !query 351 schema +struct<1:int> +-- !query 351 output +1 + + +-- !query 352 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 352 schema +struct<1:int> +-- !query 352 output +1 + + +-- !query 353 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as float) FROM t) +-- !query 353 schema +struct<1:int> +-- !query 353 output +1 + + +-- !query 354 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as double) FROM t) +-- !query 354 schema +struct<1:int> +-- !query 354 output +1 + + +-- !query 355 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 355 schema +struct<1:int> +-- !query 355 output +1 + + +-- !query 356 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as string) FROM t) +-- !query 356 schema +struct<1:int> +-- !query 356 output +1 + + +-- !query 357 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast('1' as binary) FROM t) +-- !query 357 schema +struct<> +-- !query 357 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DOUBLE):double, `CAST(1 AS BINARY)`:binary)] +Left side: +[double]. +Right side: +[binary].; + + +-- !query 358 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 358 schema +struct<> +-- !query 358 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DOUBLE):double, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[double]. +Right side: +[boolean].; + + +-- !query 359 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 359 schema +struct<> +-- !query 359 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DOUBLE):double, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[double]. +Right side: +[timestamp].; + + +-- !query 360 +SELECT * FROM t WHERE (cast(1 as double)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 360 schema +struct<> +-- !query 360 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DOUBLE):double, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[double]. +Right side: +[date].; + + +-- !query 361 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 361 schema +struct<1:int> +-- !query 361 output +1 + + +-- !query 362 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as smallint) FROM t) +-- !query 362 schema +struct<1:int> +-- !query 362 output +1 + + +-- !query 363 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as int) FROM t) +-- !query 363 schema +struct<1:int> +-- !query 363 output +1 + + +-- !query 364 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as bigint) FROM t) +-- !query 364 schema +struct<1:int> +-- !query 364 output +1 + + +-- !query 365 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as float) FROM t) +-- !query 365 schema +struct<1:int> +-- !query 365 output +1 + + +-- !query 366 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as double) FROM t) +-- !query 366 schema +struct<1:int> +-- !query 366 output +1 + + +-- !query 367 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 367 schema +struct<1:int> +-- !query 367 output +1 + + +-- !query 368 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as string) FROM t) +-- !query 368 schema +struct<1:int> +-- !query 368 output +1 + + +-- !query 369 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast('1' as binary) FROM t) +-- !query 369 schema +struct<> +-- !query 369 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DECIMAL(10,0)):decimal(10,0), `CAST(1 AS BINARY)`:binary)] +Left side: +[decimal(10,0)]. +Right side: +[binary].; + + +-- !query 370 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast(1 as boolean) FROM t) +-- !query 370 schema +struct<> +-- !query 370 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DECIMAL(10,0)):decimal(10,0), `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[decimal(10,0)]. +Right side: +[boolean].; + + +-- !query 371 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 371 schema +struct<> +-- !query 371 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DECIMAL(10,0)):decimal(10,0), `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[decimal(10,0)]. +Right side: +[timestamp].; + + +-- !query 372 +SELECT * FROM t WHERE (cast(1 as decimal(10, 0))) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 372 schema +struct<> +-- !query 372 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS DECIMAL(10,0)):decimal(10,0), `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[decimal(10,0)]. +Right side: +[date].; + + +-- !query 373 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 373 schema +struct<1:int> +-- !query 373 output +1 + + +-- !query 374 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 374 schema +struct<1:int> +-- !query 374 output +1 + + +-- !query 375 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as int) FROM t) +-- !query 375 schema +struct<1:int> +-- !query 375 output +1 + + +-- !query 376 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 376 schema +struct<1:int> +-- !query 376 output +1 + + +-- !query 377 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as float) FROM t) +-- !query 377 schema +struct<1:int> +-- !query 377 output +1 + + +-- !query 378 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as double) FROM t) +-- !query 378 schema +struct<1:int> +-- !query 378 output +1 + + +-- !query 379 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 379 schema +struct<1:int> +-- !query 379 output +1 + + +-- !query 380 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as string) FROM t) +-- !query 380 schema +struct<1:int> +-- !query 380 output +1 + + +-- !query 381 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast('1' as binary) FROM t) +-- !query 381 schema +struct<1:int> +-- !query 381 output +1 + + +-- !query 382 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 382 schema +struct<1:int> +-- !query 382 output +1 + + +-- !query 383 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 383 schema +struct<1:int> +-- !query 383 output + + + +-- !query 384 +SELECT * FROM t WHERE (cast(1 as string)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 384 schema +struct<1:int> +-- !query 384 output + + + +-- !query 385 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 385 schema +struct<> +-- !query 385 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS TINYINT)`:tinyint)] +Left side: +[binary]. +Right side: +[tinyint].; + + +-- !query 386 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 386 schema +struct<> +-- !query 386 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS SMALLINT)`:smallint)] +Left side: +[binary]. +Right side: +[smallint].; + + +-- !query 387 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as int) FROM t) +-- !query 387 schema +struct<> +-- !query 387 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS INT)`:int)] +Left side: +[binary]. +Right side: +[int].; + + +-- !query 388 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 388 schema +struct<> +-- !query 388 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS BIGINT)`:bigint)] +Left side: +[binary]. +Right side: +[bigint].; + + +-- !query 389 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as float) FROM t) +-- !query 389 schema +struct<> +-- !query 389 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS FLOAT)`:float)] +Left side: +[binary]. +Right side: +[float].; + + +-- !query 390 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as double) FROM t) +-- !query 390 schema +struct<> +-- !query 390 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS DOUBLE)`:double)] +Left side: +[binary]. +Right side: +[double].; + + +-- !query 391 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 391 schema +struct<> +-- !query 391 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS DECIMAL(10,0))`:decimal(10,0))] +Left side: +[binary]. +Right side: +[decimal(10,0)].; + + +-- !query 392 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as string) FROM t) +-- !query 392 schema +struct<1:int> +-- !query 392 output +1 + + +-- !query 393 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast('1' as binary) FROM t) +-- !query 393 schema +struct<1:int> +-- !query 393 output +1 + + +-- !query 394 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 394 schema +struct<> +-- !query 394 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[binary]. +Right side: +[boolean].; + + +-- !query 395 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 395 schema +struct<> +-- !query 395 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[binary]. +Right side: +[timestamp].; + + +-- !query 396 +SELECT * FROM t WHERE (cast('1' as binary)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 396 schema +struct<> +-- !query 396 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('1' AS BINARY):binary, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[binary]. +Right side: +[date].; + + +-- !query 397 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 397 schema +struct<> +-- !query 397 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS TINYINT)`:tinyint)] +Left side: +[boolean]. +Right side: +[tinyint].; + + +-- !query 398 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 398 schema +struct<> +-- !query 398 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS SMALLINT)`:smallint)] +Left side: +[boolean]. +Right side: +[smallint].; + + +-- !query 399 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as int) FROM t) +-- !query 399 schema +struct<> +-- !query 399 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS INT)`:int)] +Left side: +[boolean]. +Right side: +[int].; + + +-- !query 400 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 400 schema +struct<> +-- !query 400 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS BIGINT)`:bigint)] +Left side: +[boolean]. +Right side: +[bigint].; + + +-- !query 401 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as float) FROM t) +-- !query 401 schema +struct<> +-- !query 401 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS FLOAT)`:float)] +Left side: +[boolean]. +Right side: +[float].; + + +-- !query 402 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as double) FROM t) +-- !query 402 schema +struct<> +-- !query 402 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS DOUBLE)`:double)] +Left side: +[boolean]. +Right side: +[double].; + + +-- !query 403 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 403 schema +struct<> +-- !query 403 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS DECIMAL(10,0))`:decimal(10,0))] +Left side: +[boolean]. +Right side: +[decimal(10,0)].; + + +-- !query 404 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as string) FROM t) +-- !query 404 schema +struct<1:int> +-- !query 404 output +1 + + +-- !query 405 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast('1' as binary) FROM t) +-- !query 405 schema +struct<> +-- !query 405 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(1 AS BINARY)`:binary)] +Left side: +[boolean]. +Right side: +[binary].; + + +-- !query 406 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 406 schema +struct<1:int> +-- !query 406 output +1 + + +-- !query 407 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 407 schema +struct<> +-- !query 407 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)`:timestamp)] +Left side: +[boolean]. +Right side: +[timestamp].; + + +-- !query 408 +SELECT * FROM t WHERE (cast(1 as boolean)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 408 schema +struct<> +-- !query 408 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST(1 AS BOOLEAN):boolean, `CAST(2017-12-11 09:30:00 AS DATE)`:date)] +Left side: +[boolean]. +Right side: +[date].; + + +-- !query 409 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 409 schema +struct<> +-- !query 409 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS TINYINT)`:tinyint)] +Left side: +[timestamp]. +Right side: +[tinyint].; + + +-- !query 410 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 410 schema +struct<> +-- !query 410 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS SMALLINT)`:smallint)] +Left side: +[timestamp]. +Right side: +[smallint].; + + +-- !query 411 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as int) FROM t) +-- !query 411 schema +struct<> +-- !query 411 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS INT)`:int)] +Left side: +[timestamp]. +Right side: +[int].; + + +-- !query 412 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 412 schema +struct<> +-- !query 412 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS BIGINT)`:bigint)] +Left side: +[timestamp]. +Right side: +[bigint].; + + +-- !query 413 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as float) FROM t) +-- !query 413 schema +struct<> +-- !query 413 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS FLOAT)`:float)] +Left side: +[timestamp]. +Right side: +[float].; + + +-- !query 414 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as double) FROM t) +-- !query 414 schema +struct<> +-- !query 414 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS DOUBLE)`:double)] +Left side: +[timestamp]. +Right side: +[double].; + + +-- !query 415 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 415 schema +struct<> +-- !query 415 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS DECIMAL(10,0))`:decimal(10,0))] +Left side: +[timestamp]. +Right side: +[decimal(10,0)].; + + +-- !query 416 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as string) FROM t) +-- !query 416 schema +struct<1:int> +-- !query 416 output + + + +-- !query 417 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast('1' as binary) FROM t) +-- !query 417 schema +struct<> +-- !query 417 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS BINARY)`:binary)] +Left side: +[timestamp]. +Right side: +[binary].; + + +-- !query 418 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 418 schema +struct<> +-- !query 418 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP):timestamp, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[timestamp]. +Right side: +[boolean].; + + +-- !query 419 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 419 schema +struct<1:int> +-- !query 419 output +1 + + +-- !query 420 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00.0' as timestamp)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 420 schema +struct<1:int> +-- !query 420 output + + + +-- !query 421 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as tinyint) FROM t) +-- !query 421 schema +struct<> +-- !query 421 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS TINYINT)`:tinyint)] +Left side: +[date]. +Right side: +[tinyint].; + + +-- !query 422 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as smallint) FROM t) +-- !query 422 schema +struct<> +-- !query 422 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS SMALLINT)`:smallint)] +Left side: +[date]. +Right side: +[smallint].; + + +-- !query 423 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as int) FROM t) +-- !query 423 schema +struct<> +-- !query 423 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS INT)`:int)] +Left side: +[date]. +Right side: +[int].; + + +-- !query 424 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as bigint) FROM t) +-- !query 424 schema +struct<> +-- !query 424 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS BIGINT)`:bigint)] +Left side: +[date]. +Right side: +[bigint].; + + +-- !query 425 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as float) FROM t) +-- !query 425 schema +struct<> +-- !query 425 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS FLOAT)`:float)] +Left side: +[date]. +Right side: +[float].; + + +-- !query 426 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as double) FROM t) +-- !query 426 schema +struct<> +-- !query 426 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS DOUBLE)`:double)] +Left side: +[date]. +Right side: +[double].; + + +-- !query 427 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as decimal(10, 0)) FROM t) +-- !query 427 schema +struct<> +-- !query 427 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS DECIMAL(10,0))`:decimal(10,0))] +Left side: +[date]. +Right side: +[decimal(10,0)].; + + +-- !query 428 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as string) FROM t) +-- !query 428 schema +struct<1:int> +-- !query 428 output + + + +-- !query 429 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast('1' as binary) FROM t) +-- !query 429 schema +struct<> +-- !query 429 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS BINARY)`:binary)] +Left side: +[date]. +Right side: +[binary].; + + +-- !query 430 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast(1 as boolean) FROM t) +-- !query 430 schema +struct<> +-- !query 430 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) IN (listquery()))' due to data type mismatch: +The data type of one or more elements in the left hand side of an IN subquery +is not compatible with the data type of the output of the subquery +Mismatched columns: +[(CAST('2017-12-11 09:30:00' AS DATE):date, `CAST(1 AS BOOLEAN)`:boolean)] +Left side: +[date]. +Right side: +[boolean].; + + +-- !query 431 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t) +-- !query 431 schema +struct<1:int> +-- !query 431 output + + + +-- !query 432 +SELECT * FROM t WHERE (cast('2017-12-11 09:30:00' as date)) IN (SELECT cast('2017-12-11 09:30:00' as date) FROM t) +-- !query 432 schema +struct<1:int> +-- !query 432 output +1