From 7ee9aeccfc5adc6107c33401ef0c5212a65d9577 Mon Sep 17 00:00:00 2001 From: Yuming Wang Date: Mon, 18 Dec 2017 12:43:55 +0800 Subject: [PATCH 1/3] Basic tests for WidenSetOperationTypes, BooleanEquality, StackCoercion and Division --- .../typeCoercion/native/booleanEquality.sql | 70 + .../inputs/typeCoercion/native/division.sql | 187 + .../typeCoercion/native/stackCoercion.sql | 174 + .../native/widenSetOperationTypes.sql | 489 +++ .../native/booleanEquality.sql.out | 406 ++ .../typeCoercion/native/division.sql.out | 1342 ++++++ .../typeCoercion/native/stackCoercion.sql.out | 1294 ++++++ .../native/widenSetOperationTypes.sql.out | 3749 +++++++++++++++++ 8 files changed, 7711 insertions(+) create mode 100644 sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql create mode 100644 sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql create mode 100644 sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql create mode 100644 sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql create mode 100644 sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out create mode 100644 sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out create mode 100644 sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out create mode 100644 sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql new file mode 100644 index 0000000000000..726aa482c6c0a --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql @@ -0,0 +1,70 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +CREATE TEMPORARY VIEW t AS SELECT 1; + +SELECT true = cast(1 as tinyint) FROM t; +SELECT true = cast(1 as smallint) FROM t; +SELECT true = cast(1 as int) FROM t; +SELECT true = cast(1 as bigint) FROM t; +SELECT true = cast(1 as float) FROM t; +SELECT true = cast(1 as double) FROM t; +SELECT true = cast(1 as decimal(10, 0)) FROM t; +SELECT true = cast(1 as string) FROM t; +SELECT true = cast('1' as binary) FROM t; +SELECT true = cast('1' as boolean) FROM t; +SELECT true = cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT true = cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT true <=> cast(1 as tinyint) FROM t; +SELECT true <=> cast(1 as smallint) FROM t; +SELECT true <=> cast(1 as int) FROM t; +SELECT true <=> cast(1 as bigint) FROM t; +SELECT true <=> cast(1 as float) FROM t; +SELECT true <=> cast(1 as double) FROM t; +SELECT true <=> cast(1 as decimal(10, 0)) FROM t; +SELECT true <=> cast(1 as string) FROM t; +SELECT true <=> cast('1' as binary) FROM t; +SELECT true <=> cast('1' as boolean) FROM t; +SELECT true <=> cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT true <=> cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as tinyint) = true FROM t; +SELECT cast(1 as smallint) = true FROM t; +SELECT cast(1 as int) = true FROM t; +SELECT cast(1 as bigint) = true FROM t; +SELECT cast(1 as float) = true FROM t; +SELECT cast(1 as double) = true FROM t; +SELECT cast(1 as decimal(10, 0)) = true FROM t; +SELECT cast(1 as string) = true FROM t; +SELECT cast('1' as binary) = true FROM t; +SELECT cast('1' as boolean) = true FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) = true FROM t; +SELECT cast('2017-12-11 09:30:00' as date) = true FROM t; + +SELECT cast(1 as tinyint) <=> true FROM t; +SELECT cast(1 as smallint) <=> true FROM t; +SELECT cast(1 as int) <=> true FROM t; +SELECT cast(1 as bigint) <=> true FROM t; +SELECT cast(1 as float) <=> true FROM t; +SELECT cast(1 as double) <=> true FROM t; +SELECT cast(1 as decimal(10, 0)) <=> true FROM t; +SELECT cast(1 as string) <=> true FROM t; +SELECT cast('1' as binary) <=> true FROM t; +SELECT cast('1' as boolean) <=> true FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) <=> true FROM t; +SELECT cast('2017-12-11 09:30:00' as date) <=> true FROM t; diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql new file mode 100644 index 0000000000000..04b50a2ae232f --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql @@ -0,0 +1,187 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +CREATE TEMPORARY VIEW t AS SELECT 1; + +SELECT cast(1 as tinyint) / cast(1 as tinyint) FROM t; +SELECT cast(1 as tinyint) / cast(1 as smallint) FROM t; +SELECT cast(1 as tinyint) / cast(1 as int) FROM t; +SELECT cast(1 as tinyint) / cast(1 as bigint) FROM t; +SELECT cast(1 as tinyint) / cast(1 as float) FROM t; +SELECT cast(1 as tinyint) / cast(1 as double) FROM t; +SELECT cast(1 as tinyint) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as tinyint) / cast(1 as string) FROM t; +SELECT cast(1 as tinyint) / cast('1' as binary) FROM t; +SELECT cast(1 as tinyint) / cast(1 as boolean) FROM t; +SELECT cast(1 as tinyint) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as tinyint) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as smallint) / cast(1 as tinyint) FROM t; +SELECT cast(1 as smallint) / cast(1 as smallint) FROM t; +SELECT cast(1 as smallint) / cast(1 as int) FROM t; +SELECT cast(1 as smallint) / cast(1 as bigint) FROM t; +SELECT cast(1 as smallint) / cast(1 as float) FROM t; +SELECT cast(1 as smallint) / cast(1 as double) FROM t; +SELECT cast(1 as smallint) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as smallint) / cast(1 as string) FROM t; +SELECT cast(1 as smallint) / cast('1' as binary) FROM t; +SELECT cast(1 as smallint) / cast(1 as boolean) FROM t; +SELECT cast(1 as smallint) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as smallint) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as int) / cast(1 as tinyint) FROM t; +SELECT cast(1 as int) / cast(1 as smallint) FROM t; +SELECT cast(1 as int) / cast(1 as int) FROM t; +SELECT cast(1 as int) / cast(1 as bigint) FROM t; +SELECT cast(1 as int) / cast(1 as float) FROM t; +SELECT cast(1 as int) / cast(1 as double) FROM t; +SELECT cast(1 as int) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as int) / cast(1 as string) FROM t; +SELECT cast(1 as int) / cast('1' as binary) FROM t; +SELECT cast(1 as int) / cast(1 as boolean) FROM t; +SELECT cast(1 as int) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as int) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as bigint) / cast(1 as tinyint) FROM t; +SELECT cast(1 as bigint) / cast(1 as smallint) FROM t; +SELECT cast(1 as bigint) / cast(1 as int) FROM t; +SELECT cast(1 as bigint) / cast(1 as bigint) FROM t; +SELECT cast(1 as bigint) / cast(1 as float) FROM t; +SELECT cast(1 as bigint) / cast(1 as double) FROM t; +SELECT cast(1 as bigint) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as bigint) / cast(1 as string) FROM t; +SELECT cast(1 as bigint) / cast('1' as binary) FROM t; +SELECT cast(1 as bigint) / cast(1 as boolean) FROM t; +SELECT cast(1 as bigint) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as bigint) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as float) / cast(1 as tinyint) FROM t; +SELECT cast(1 as float) / cast(1 as smallint) FROM t; +SELECT cast(1 as float) / cast(1 as int) FROM t; +SELECT cast(1 as float) / cast(1 as bigint) FROM t; +SELECT cast(1 as float) / cast(1 as float) FROM t; +SELECT cast(1 as float) / cast(1 as double) FROM t; +SELECT cast(1 as float) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as float) / cast(1 as string) FROM t; +SELECT cast(1 as float) / cast('1' as binary) FROM t; +SELECT cast(1 as float) / cast(1 as boolean) FROM t; +SELECT cast(1 as float) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as float) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as double) / cast(1 as tinyint) FROM t; +SELECT cast(1 as double) / cast(1 as smallint) FROM t; +SELECT cast(1 as double) / cast(1 as int) FROM t; +SELECT cast(1 as double) / cast(1 as bigint) FROM t; +SELECT cast(1 as double) / cast(1 as float) FROM t; +SELECT cast(1 as double) / cast(1 as double) FROM t; +SELECT cast(1 as double) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as double) / cast(1 as string) FROM t; +SELECT cast(1 as double) / cast('1' as binary) FROM t; +SELECT cast(1 as double) / cast(1 as boolean) FROM t; +SELECT cast(1 as double) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as double) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as decimal(10, 0)) / cast(1 as tinyint) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as smallint) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as int) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as bigint) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as float) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as double) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as string) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast('1' as binary) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast(1 as boolean) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as decimal(10, 0)) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as string) / cast(1 as tinyint) FROM t; +SELECT cast(1 as string) / cast(1 as smallint) FROM t; +SELECT cast(1 as string) / cast(1 as int) FROM t; +SELECT cast(1 as string) / cast(1 as bigint) FROM t; +SELECT cast(1 as string) / cast(1 as float) FROM t; +SELECT cast(1 as string) / cast(1 as double) FROM t; +SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as string) / cast(1 as string) FROM t; +SELECT cast(1 as string) / cast('1' as binary) FROM t; +SELECT cast(1 as string) / cast(1 as boolean) FROM t; +SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as string) / cast(1 as tinyint) FROM t; +SELECT cast(1 as string) / cast(1 as smallint) FROM t; +SELECT cast(1 as string) / cast(1 as int) FROM t; +SELECT cast(1 as string) / cast(1 as bigint) FROM t; +SELECT cast(1 as string) / cast(1 as float) FROM t; +SELECT cast(1 as string) / cast(1 as double) FROM t; +SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as string) / cast(1 as string) FROM t; +SELECT cast(1 as string) / cast('1' as binary) FROM t; +SELECT cast(1 as string) / cast(1 as boolean) FROM t; +SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('1' as binary) / cast(1 as tinyint) FROM t; +SELECT cast('1' as binary) / cast(1 as smallint) FROM t; +SELECT cast('1' as binary) / cast(1 as int) FROM t; +SELECT cast('1' as binary) / cast(1 as bigint) FROM t; +SELECT cast('1' as binary) / cast(1 as float) FROM t; +SELECT cast('1' as binary) / cast(1 as double) FROM t; +SELECT cast('1' as binary) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast('1' as binary) / cast(1 as string) FROM t; +SELECT cast('1' as binary) / cast('1' as binary) FROM t; +SELECT cast('1' as binary) / cast(1 as boolean) FROM t; +SELECT cast('1' as binary) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('1' as binary) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as boolean) / cast(1 as tinyint) FROM t; +SELECT cast(1 as boolean) / cast(1 as smallint) FROM t; +SELECT cast(1 as boolean) / cast(1 as int) FROM t; +SELECT cast(1 as boolean) / cast(1 as bigint) FROM t; +SELECT cast(1 as boolean) / cast(1 as float) FROM t; +SELECT cast(1 as boolean) / cast(1 as double) FROM t; +SELECT cast(1 as boolean) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as boolean) / cast(1 as string) FROM t; +SELECT cast(1 as boolean) / cast('1' as binary) FROM t; +SELECT cast(1 as boolean) / cast(1 as boolean) FROM t; +SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as tinyint) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as smallint) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as int) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as bigint) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as float) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as double) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as string) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('1' as binary) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as boolean) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as tinyint) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as smallint) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as int) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as bigint) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as float) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as double) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as string) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast('1' as binary) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as boolean) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00' as date) FROM t; diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql new file mode 100644 index 0000000000000..09700b08b2e3e --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql @@ -0,0 +1,174 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +CREATE TEMPORARY VIEW t AS SELECT 1; + +SELECT stack(cast(1 as tinyint), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as tinyint), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as tinyint), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as smallint), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as smallint), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as smallint), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as int), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as int), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as int), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as bigint), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as bigint), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as bigint), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as float), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as float), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as float), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as double), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as double), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as double), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as string), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as string), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as string), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast('1' as binary), cast(1 as tinyint), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as smallint), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as int), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as bigint), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as float), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as double), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as string), null) FROM t; +SELECT stack(cast('1' as binary), cast('1' as binary), null) FROM t; +SELECT stack(cast('1' as binary), cast(1 as boolean), null) FROM t; +SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast(1 as boolean), cast(1 as tinyint), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as smallint), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as int), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as bigint), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as float), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as double), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as string), null) FROM t; +SELECT stack(cast(1 as boolean), cast('1' as binary), null) FROM t; +SELECT stack(cast(1 as boolean), cast(1 as boolean), null) FROM t; +SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as tinyint), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as smallint), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as int), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as bigint), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as float), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as double), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as string), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('1' as binary), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as boolean), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00' as date), null) FROM t; + +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as tinyint), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as smallint), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as int), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as bigint), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as float), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as double), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as decimal(10, 0)), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as string), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast('1' as binary), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as boolean), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; +SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00' as date), null) FROM t; diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql new file mode 100644 index 0000000000000..bd6860e9e3a05 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql @@ -0,0 +1,489 @@ +-- +-- Licensed to the Apache Software Foundation (ASF) under one or more +-- contributor license agreements. See the NOTICE file distributed with +-- this work for additional information regarding copyright ownership. +-- The ASF licenses this file to You under the Apache License, Version 2.0 +-- (the "License"); you may not use this file except in compliance with +-- the License. You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +CREATE TEMPORARY VIEW t AS SELECT 1; + +-- UNION +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as smallint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as int) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as bigint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as float) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as double) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as string) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('1' as binary) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as boolean) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as tinyint) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as smallint) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as int) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as bigint) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as float) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as double) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as string) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2' as binary) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as boolean) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +-- EXCEPT +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as int) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as float) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as double) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as string) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2' as binary) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +-- INTERSECT +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as int) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as float) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as double) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as int) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as float) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as double) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as string) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('1' as binary) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out new file mode 100644 index 0000000000000..3e2acafc3c8ce --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out @@ -0,0 +1,406 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 49 + + +-- !query 0 +CREATE TEMPORARY VIEW t AS SELECT 1 +-- !query 0 schema +struct<> +-- !query 0 output + + + +-- !query 1 +SELECT true = cast(1 as tinyint) FROM t +-- !query 1 schema +struct<(CAST(true AS TINYINT) = CAST(1 AS TINYINT)):boolean> +-- !query 1 output +true + + +-- !query 2 +SELECT true = cast(1 as smallint) FROM t +-- !query 2 schema +struct<(CAST(true AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +-- !query 2 output +true + + +-- !query 3 +SELECT true = cast(1 as int) FROM t +-- !query 3 schema +struct<(CAST(true AS INT) = CAST(1 AS INT)):boolean> +-- !query 3 output +true + + +-- !query 4 +SELECT true = cast(1 as bigint) FROM t +-- !query 4 schema +struct<(CAST(true AS BIGINT) = CAST(1 AS BIGINT)):boolean> +-- !query 4 output +true + + +-- !query 5 +SELECT true = cast(1 as float) FROM t +-- !query 5 schema +struct<(CAST(true AS FLOAT) = CAST(1 AS FLOAT)):boolean> +-- !query 5 output +true + + +-- !query 6 +SELECT true = cast(1 as double) FROM t +-- !query 6 schema +struct<(CAST(true AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +-- !query 6 output +true + + +-- !query 7 +SELECT true = cast(1 as decimal(10, 0)) FROM t +-- !query 7 schema +struct<(CAST(true AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(10,0))):boolean> +-- !query 7 output +true + + +-- !query 8 +SELECT true = cast(1 as string) FROM t +-- !query 8 schema +struct<(true = CAST(CAST(1 AS STRING) AS BOOLEAN)):boolean> +-- !query 8 output +true + + +-- !query 9 +SELECT true = cast('1' as binary) FROM t +-- !query 9 schema +struct<> +-- !query 9 output +org.apache.spark.sql.AnalysisException +cannot resolve '(true = CAST('1' AS BINARY))' due to data type mismatch: differing types in '(true = CAST('1' AS BINARY))' (boolean and binary).; line 1 pos 7 + + +-- !query 10 +SELECT true = cast('1' as boolean) FROM t +-- !query 10 schema +struct<(true = CAST(1 AS BOOLEAN)):boolean> +-- !query 10 output +true + + +-- !query 11 +SELECT true = cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 11 schema +struct<> +-- !query 11 output +org.apache.spark.sql.AnalysisException +cannot resolve '(true = CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(true = CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 + + +-- !query 12 +SELECT true = cast('2017-12-11 09:30:00' as date) FROM t +-- !query 12 schema +struct<> +-- !query 12 output +org.apache.spark.sql.AnalysisException +cannot resolve '(true = CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(true = CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 + + +-- !query 13 +SELECT true <=> cast(1 as tinyint) FROM t +-- !query 13 schema +struct<(CAST(true AS TINYINT) <=> CAST(1 AS TINYINT)):boolean> +-- !query 13 output +true + + +-- !query 14 +SELECT true <=> cast(1 as smallint) FROM t +-- !query 14 schema +struct<(CAST(true AS SMALLINT) <=> CAST(1 AS SMALLINT)):boolean> +-- !query 14 output +true + + +-- !query 15 +SELECT true <=> cast(1 as int) FROM t +-- !query 15 schema +struct<(CAST(true AS INT) <=> CAST(1 AS INT)):boolean> +-- !query 15 output +true + + +-- !query 16 +SELECT true <=> cast(1 as bigint) FROM t +-- !query 16 schema +struct<(CAST(true AS BIGINT) <=> CAST(1 AS BIGINT)):boolean> +-- !query 16 output +true + + +-- !query 17 +SELECT true <=> cast(1 as float) FROM t +-- !query 17 schema +struct<(CAST(true AS FLOAT) <=> CAST(1 AS FLOAT)):boolean> +-- !query 17 output +true + + +-- !query 18 +SELECT true <=> cast(1 as double) FROM t +-- !query 18 schema +struct<(CAST(true AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +-- !query 18 output +true + + +-- !query 19 +SELECT true <=> cast(1 as decimal(10, 0)) FROM t +-- !query 19 schema +struct<(CAST(true AS DECIMAL(10,0)) <=> CAST(1 AS DECIMAL(10,0))):boolean> +-- !query 19 output +true + + +-- !query 20 +SELECT true <=> cast(1 as string) FROM t +-- !query 20 schema +struct<(true <=> CAST(CAST(1 AS STRING) AS BOOLEAN)):boolean> +-- !query 20 output +true + + +-- !query 21 +SELECT true <=> cast('1' as binary) FROM t +-- !query 21 schema +struct<> +-- !query 21 output +org.apache.spark.sql.AnalysisException +cannot resolve '(true <=> CAST('1' AS BINARY))' due to data type mismatch: differing types in '(true <=> CAST('1' AS BINARY))' (boolean and binary).; line 1 pos 7 + + +-- !query 22 +SELECT true <=> cast('1' as boolean) FROM t +-- !query 22 schema +struct<(true <=> CAST(1 AS BOOLEAN)):boolean> +-- !query 22 output +true + + +-- !query 23 +SELECT true <=> cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 23 schema +struct<> +-- !query 23 output +org.apache.spark.sql.AnalysisException +cannot resolve '(true <=> CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(true <=> CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 + + +-- !query 24 +SELECT true <=> cast('2017-12-11 09:30:00' as date) FROM t +-- !query 24 schema +struct<> +-- !query 24 output +org.apache.spark.sql.AnalysisException +cannot resolve '(true <=> CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(true <=> CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 + + +-- !query 25 +SELECT cast(1 as tinyint) = true FROM t +-- !query 25 schema +struct<(CAST(1 AS TINYINT) = CAST(true AS TINYINT)):boolean> +-- !query 25 output +true + + +-- !query 26 +SELECT cast(1 as smallint) = true FROM t +-- !query 26 schema +struct<(CAST(1 AS SMALLINT) = CAST(true AS SMALLINT)):boolean> +-- !query 26 output +true + + +-- !query 27 +SELECT cast(1 as int) = true FROM t +-- !query 27 schema +struct<(CAST(1 AS INT) = CAST(true AS INT)):boolean> +-- !query 27 output +true + + +-- !query 28 +SELECT cast(1 as bigint) = true FROM t +-- !query 28 schema +struct<(CAST(1 AS BIGINT) = CAST(true AS BIGINT)):boolean> +-- !query 28 output +true + + +-- !query 29 +SELECT cast(1 as float) = true FROM t +-- !query 29 schema +struct<(CAST(1 AS FLOAT) = CAST(true AS FLOAT)):boolean> +-- !query 29 output +true + + +-- !query 30 +SELECT cast(1 as double) = true FROM t +-- !query 30 schema +struct<(CAST(1 AS DOUBLE) = CAST(true AS DOUBLE)):boolean> +-- !query 30 output +true + + +-- !query 31 +SELECT cast(1 as decimal(10, 0)) = true FROM t +-- !query 31 schema +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(true AS DECIMAL(10,0))):boolean> +-- !query 31 output +true + + +-- !query 32 +SELECT cast(1 as string) = true FROM t +-- !query 32 schema +struct<(CAST(CAST(1 AS STRING) AS BOOLEAN) = true):boolean> +-- !query 32 output +true + + +-- !query 33 +SELECT cast('1' as binary) = true FROM t +-- !query 33 schema +struct<> +-- !query 33 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) = true)' due to data type mismatch: differing types in '(CAST('1' AS BINARY) = true)' (binary and boolean).; line 1 pos 7 + + +-- !query 34 +SELECT cast('1' as boolean) = true FROM t +-- !query 34 schema +struct<(CAST(1 AS BOOLEAN) = true):boolean> +-- !query 34 output +true + + +-- !query 35 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) = true FROM t +-- !query 35 schema +struct<> +-- !query 35 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) = true)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) = true)' (timestamp and boolean).; line 1 pos 7 + + +-- !query 36 +SELECT cast('2017-12-11 09:30:00' as date) = true FROM t +-- !query 36 schema +struct<> +-- !query 36 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) = true)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) = true)' (date and boolean).; line 1 pos 7 + + +-- !query 37 +SELECT cast(1 as tinyint) <=> true FROM t +-- !query 37 schema +struct<(CAST(1 AS TINYINT) <=> CAST(true AS TINYINT)):boolean> +-- !query 37 output +true + + +-- !query 38 +SELECT cast(1 as smallint) <=> true FROM t +-- !query 38 schema +struct<(CAST(1 AS SMALLINT) <=> CAST(true AS SMALLINT)):boolean> +-- !query 38 output +true + + +-- !query 39 +SELECT cast(1 as int) <=> true FROM t +-- !query 39 schema +struct<(CAST(1 AS INT) <=> CAST(true AS INT)):boolean> +-- !query 39 output +true + + +-- !query 40 +SELECT cast(1 as bigint) <=> true FROM t +-- !query 40 schema +struct<(CAST(1 AS BIGINT) <=> CAST(true AS BIGINT)):boolean> +-- !query 40 output +true + + +-- !query 41 +SELECT cast(1 as float) <=> true FROM t +-- !query 41 schema +struct<(CAST(1 AS FLOAT) <=> CAST(true AS FLOAT)):boolean> +-- !query 41 output +true + + +-- !query 42 +SELECT cast(1 as double) <=> true FROM t +-- !query 42 schema +struct<(CAST(1 AS DOUBLE) <=> CAST(true AS DOUBLE)):boolean> +-- !query 42 output +true + + +-- !query 43 +SELECT cast(1 as decimal(10, 0)) <=> true FROM t +-- !query 43 schema +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(true AS DECIMAL(10,0))):boolean> +-- !query 43 output +true + + +-- !query 44 +SELECT cast(1 as string) <=> true FROM t +-- !query 44 schema +struct<(CAST(CAST(1 AS STRING) AS BOOLEAN) <=> true):boolean> +-- !query 44 output +true + + +-- !query 45 +SELECT cast('1' as binary) <=> true FROM t +-- !query 45 schema +struct<> +-- !query 45 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) <=> true)' due to data type mismatch: differing types in '(CAST('1' AS BINARY) <=> true)' (binary and boolean).; line 1 pos 7 + + +-- !query 46 +SELECT cast('1' as boolean) <=> true FROM t +-- !query 46 schema +struct<(CAST(1 AS BOOLEAN) <=> true):boolean> +-- !query 46 output +true + + +-- !query 47 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) <=> true FROM t +-- !query 47 schema +struct<> +-- !query 47 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) <=> true)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) <=> true)' (timestamp and boolean).; line 1 pos 7 + + +-- !query 48 +SELECT cast('2017-12-11 09:30:00' as date) <=> true FROM t +-- !query 48 schema +struct<> +-- !query 48 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) <=> true)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) <=> true)' (date and boolean).; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out new file mode 100644 index 0000000000000..69c1d9a7a9b2e --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out @@ -0,0 +1,1342 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 157 + + +-- !query 0 +CREATE TEMPORARY VIEW t AS SELECT 1 +-- !query 0 schema +struct<> +-- !query 0 output + + + +-- !query 1 +SELECT cast(1 as tinyint) / cast(1 as tinyint) FROM t +-- !query 1 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 1 output +1.0 + + +-- !query 2 +SELECT cast(1 as tinyint) / cast(1 as smallint) FROM t +-- !query 2 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 2 output +1.0 + + +-- !query 3 +SELECT cast(1 as tinyint) / cast(1 as int) FROM t +-- !query 3 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 3 output +1.0 + + +-- !query 4 +SELECT cast(1 as tinyint) / cast(1 as bigint) FROM t +-- !query 4 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 4 output +1.0 + + +-- !query 5 +SELECT cast(1 as tinyint) / cast(1 as float) FROM t +-- !query 5 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 5 output +1.0 + + +-- !query 6 +SELECT cast(1 as tinyint) / cast(1 as double) FROM t +-- !query 6 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +-- !query 6 output +1.0 + + +-- !query 7 +SELECT cast(1 as tinyint) / cast(1 as decimal(10, 0)) FROM t +-- !query 7 schema +struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)> +-- !query 7 output +1 + + +-- !query 8 +SELECT cast(1 as tinyint) / cast(1 as string) FROM t +-- !query 8 schema +struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +-- !query 8 output +1.0 + + +-- !query 9 +SELECT cast(1 as tinyint) / cast('1' as binary) FROM t +-- !query 9 schema +struct<> +-- !query 9 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS TINYINT) / CAST('1' AS BINARY))' (tinyint and binary).; line 1 pos 7 + + +-- !query 10 +SELECT cast(1 as tinyint) / cast(1 as boolean) FROM t +-- !query 10 schema +struct<> +-- !query 10 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS TINYINT) / CAST(1 AS BOOLEAN))' (tinyint and boolean).; line 1 pos 7 + + +-- !query 11 +SELECT cast(1 as tinyint) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 11 schema +struct<> +-- !query 11 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS TINYINT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (tinyint and timestamp).; line 1 pos 7 + + +-- !query 12 +SELECT cast(1 as tinyint) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 12 schema +struct<> +-- !query 12 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS TINYINT) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS TINYINT) / CAST('2017-12-11 09:30:00' AS DATE))' (tinyint and date).; line 1 pos 7 + + +-- !query 13 +SELECT cast(1 as smallint) / cast(1 as tinyint) FROM t +-- !query 13 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 13 output +1.0 + + +-- !query 14 +SELECT cast(1 as smallint) / cast(1 as smallint) FROM t +-- !query 14 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 14 output +1.0 + + +-- !query 15 +SELECT cast(1 as smallint) / cast(1 as int) FROM t +-- !query 15 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 15 output +1.0 + + +-- !query 16 +SELECT cast(1 as smallint) / cast(1 as bigint) FROM t +-- !query 16 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 16 output +1.0 + + +-- !query 17 +SELECT cast(1 as smallint) / cast(1 as float) FROM t +-- !query 17 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 17 output +1.0 + + +-- !query 18 +SELECT cast(1 as smallint) / cast(1 as double) FROM t +-- !query 18 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +-- !query 18 output +1.0 + + +-- !query 19 +SELECT cast(1 as smallint) / cast(1 as decimal(10, 0)) FROM t +-- !query 19 schema +struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)> +-- !query 19 output +1 + + +-- !query 20 +SELECT cast(1 as smallint) / cast(1 as string) FROM t +-- !query 20 schema +struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +-- !query 20 output +1.0 + + +-- !query 21 +SELECT cast(1 as smallint) / cast('1' as binary) FROM t +-- !query 21 schema +struct<> +-- !query 21 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS SMALLINT) / CAST('1' AS BINARY))' (smallint and binary).; line 1 pos 7 + + +-- !query 22 +SELECT cast(1 as smallint) / cast(1 as boolean) FROM t +-- !query 22 schema +struct<> +-- !query 22 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS SMALLINT) / CAST(1 AS BOOLEAN))' (smallint and boolean).; line 1 pos 7 + + +-- !query 23 +SELECT cast(1 as smallint) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 23 schema +struct<> +-- !query 23 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS SMALLINT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (smallint and timestamp).; line 1 pos 7 + + +-- !query 24 +SELECT cast(1 as smallint) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 24 schema +struct<> +-- !query 24 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS SMALLINT) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS SMALLINT) / CAST('2017-12-11 09:30:00' AS DATE))' (smallint and date).; line 1 pos 7 + + +-- !query 25 +SELECT cast(1 as int) / cast(1 as tinyint) FROM t +-- !query 25 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 25 output +1.0 + + +-- !query 26 +SELECT cast(1 as int) / cast(1 as smallint) FROM t +-- !query 26 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 26 output +1.0 + + +-- !query 27 +SELECT cast(1 as int) / cast(1 as int) FROM t +-- !query 27 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 27 output +1.0 + + +-- !query 28 +SELECT cast(1 as int) / cast(1 as bigint) FROM t +-- !query 28 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 28 output +1.0 + + +-- !query 29 +SELECT cast(1 as int) / cast(1 as float) FROM t +-- !query 29 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 29 output +1.0 + + +-- !query 30 +SELECT cast(1 as int) / cast(1 as double) FROM t +-- !query 30 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +-- !query 30 output +1.0 + + +-- !query 31 +SELECT cast(1 as int) / cast(1 as decimal(10, 0)) FROM t +-- !query 31 schema +struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> +-- !query 31 output +1 + + +-- !query 32 +SELECT cast(1 as int) / cast(1 as string) FROM t +-- !query 32 schema +struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +-- !query 32 output +1.0 + + +-- !query 33 +SELECT cast(1 as int) / cast('1' as binary) FROM t +-- !query 33 schema +struct<> +-- !query 33 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS INT) / CAST('1' AS BINARY))' (int and binary).; line 1 pos 7 + + +-- !query 34 +SELECT cast(1 as int) / cast(1 as boolean) FROM t +-- !query 34 schema +struct<> +-- !query 34 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS INT) / CAST(1 AS BOOLEAN))' (int and boolean).; line 1 pos 7 + + +-- !query 35 +SELECT cast(1 as int) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 35 schema +struct<> +-- !query 35 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS INT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (int and timestamp).; line 1 pos 7 + + +-- !query 36 +SELECT cast(1 as int) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 36 schema +struct<> +-- !query 36 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS INT) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS INT) / CAST('2017-12-11 09:30:00' AS DATE))' (int and date).; line 1 pos 7 + + +-- !query 37 +SELECT cast(1 as bigint) / cast(1 as tinyint) FROM t +-- !query 37 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 37 output +1.0 + + +-- !query 38 +SELECT cast(1 as bigint) / cast(1 as smallint) FROM t +-- !query 38 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 38 output +1.0 + + +-- !query 39 +SELECT cast(1 as bigint) / cast(1 as int) FROM t +-- !query 39 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 39 output +1.0 + + +-- !query 40 +SELECT cast(1 as bigint) / cast(1 as bigint) FROM t +-- !query 40 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 40 output +1.0 + + +-- !query 41 +SELECT cast(1 as bigint) / cast(1 as float) FROM t +-- !query 41 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 41 output +1.0 + + +-- !query 42 +SELECT cast(1 as bigint) / cast(1 as double) FROM t +-- !query 42 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +-- !query 42 output +1.0 + + +-- !query 43 +SELECT cast(1 as bigint) / cast(1 as decimal(10, 0)) FROM t +-- !query 43 schema +struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)> +-- !query 43 output +1 + + +-- !query 44 +SELECT cast(1 as bigint) / cast(1 as string) FROM t +-- !query 44 schema +struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +-- !query 44 output +1.0 + + +-- !query 45 +SELECT cast(1 as bigint) / cast('1' as binary) FROM t +-- !query 45 schema +struct<> +-- !query 45 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS BIGINT) / CAST('1' AS BINARY))' (bigint and binary).; line 1 pos 7 + + +-- !query 46 +SELECT cast(1 as bigint) / cast(1 as boolean) FROM t +-- !query 46 schema +struct<> +-- !query 46 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS BIGINT) / CAST(1 AS BOOLEAN))' (bigint and boolean).; line 1 pos 7 + + +-- !query 47 +SELECT cast(1 as bigint) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 47 schema +struct<> +-- !query 47 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS BIGINT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (bigint and timestamp).; line 1 pos 7 + + +-- !query 48 +SELECT cast(1 as bigint) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 48 schema +struct<> +-- !query 48 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BIGINT) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS BIGINT) / CAST('2017-12-11 09:30:00' AS DATE))' (bigint and date).; line 1 pos 7 + + +-- !query 49 +SELECT cast(1 as float) / cast(1 as tinyint) FROM t +-- !query 49 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 49 output +1.0 + + +-- !query 50 +SELECT cast(1 as float) / cast(1 as smallint) FROM t +-- !query 50 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 50 output +1.0 + + +-- !query 51 +SELECT cast(1 as float) / cast(1 as int) FROM t +-- !query 51 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 51 output +1.0 + + +-- !query 52 +SELECT cast(1 as float) / cast(1 as bigint) FROM t +-- !query 52 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 52 output +1.0 + + +-- !query 53 +SELECT cast(1 as float) / cast(1 as float) FROM t +-- !query 53 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 53 output +1.0 + + +-- !query 54 +SELECT cast(1 as float) / cast(1 as double) FROM t +-- !query 54 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +-- !query 54 output +1.0 + + +-- !query 55 +SELECT cast(1 as float) / cast(1 as decimal(10, 0)) FROM t +-- !query 55 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) AS DOUBLE)):double> +-- !query 55 output +1.0 + + +-- !query 56 +SELECT cast(1 as float) / cast(1 as string) FROM t +-- !query 56 schema +struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +-- !query 56 output +1.0 + + +-- !query 57 +SELECT cast(1 as float) / cast('1' as binary) FROM t +-- !query 57 schema +struct<> +-- !query 57 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS FLOAT) / CAST('1' AS BINARY))' (float and binary).; line 1 pos 7 + + +-- !query 58 +SELECT cast(1 as float) / cast(1 as boolean) FROM t +-- !query 58 schema +struct<> +-- !query 58 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS FLOAT) / CAST(1 AS BOOLEAN))' (float and boolean).; line 1 pos 7 + + +-- !query 59 +SELECT cast(1 as float) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 59 schema +struct<> +-- !query 59 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS FLOAT) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (float and timestamp).; line 1 pos 7 + + +-- !query 60 +SELECT cast(1 as float) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 60 schema +struct<> +-- !query 60 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS FLOAT) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS FLOAT) / CAST('2017-12-11 09:30:00' AS DATE))' (float and date).; line 1 pos 7 + + +-- !query 61 +SELECT cast(1 as double) / cast(1 as tinyint) FROM t +-- !query 61 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 61 output +1.0 + + +-- !query 62 +SELECT cast(1 as double) / cast(1 as smallint) FROM t +-- !query 62 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 62 output +1.0 + + +-- !query 63 +SELECT cast(1 as double) / cast(1 as int) FROM t +-- !query 63 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 63 output +1.0 + + +-- !query 64 +SELECT cast(1 as double) / cast(1 as bigint) FROM t +-- !query 64 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 64 output +1.0 + + +-- !query 65 +SELECT cast(1 as double) / cast(1 as float) FROM t +-- !query 65 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 65 output +1.0 + + +-- !query 66 +SELECT cast(1 as double) / cast(1 as double) FROM t +-- !query 66 schema +struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> +-- !query 66 output +1.0 + + +-- !query 67 +SELECT cast(1 as double) / cast(1 as decimal(10, 0)) FROM t +-- !query 67 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +-- !query 67 output +1.0 + + +-- !query 68 +SELECT cast(1 as double) / cast(1 as string) FROM t +-- !query 68 schema +struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +-- !query 68 output +1.0 + + +-- !query 69 +SELECT cast(1 as double) / cast('1' as binary) FROM t +-- !query 69 schema +struct<> +-- !query 69 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS DOUBLE) / CAST('1' AS BINARY))' (double and binary).; line 1 pos 7 + + +-- !query 70 +SELECT cast(1 as double) / cast(1 as boolean) FROM t +-- !query 70 schema +struct<> +-- !query 70 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS DOUBLE) / CAST(1 AS BOOLEAN))' (double and boolean).; line 1 pos 7 + + +-- !query 71 +SELECT cast(1 as double) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 71 schema +struct<> +-- !query 71 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (double and timestamp).; line 1 pos 7 + + +-- !query 72 +SELECT cast(1 as double) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 72 schema +struct<> +-- !query 72 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' (double and date).; line 1 pos 7 + + +-- !query 73 +SELECT cast(1 as decimal(10, 0)) / cast(1 as tinyint) FROM t +-- !query 73 schema +struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)> +-- !query 73 output +1 + + +-- !query 74 +SELECT cast(1 as decimal(10, 0)) / cast(1 as smallint) FROM t +-- !query 74 schema +struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)> +-- !query 74 output +1 + + +-- !query 75 +SELECT cast(1 as decimal(10, 0)) / cast(1 as int) FROM t +-- !query 75 schema +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(21,11)> +-- !query 75 output +1 + + +-- !query 76 +SELECT cast(1 as decimal(10, 0)) / cast(1 as bigint) FROM t +-- !query 76 schema +struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)> +-- !query 76 output +1 + + +-- !query 77 +SELECT cast(1 as decimal(10, 0)) / cast(1 as float) FROM t +-- !query 77 schema +struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 77 output +1.0 + + +-- !query 78 +SELECT cast(1 as decimal(10, 0)) / cast(1 as double) FROM t +-- !query 78 schema +struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +-- !query 78 output +1.0 + + +-- !query 79 +SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(10, 0)) FROM t +-- !query 79 schema +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> +-- !query 79 output +1 + + +-- !query 80 +SELECT cast(1 as decimal(10, 0)) / cast(1 as string) FROM t +-- !query 80 schema +struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +-- !query 80 output +1.0 + + +-- !query 81 +SELECT cast(1 as decimal(10, 0)) / cast('1' as binary) FROM t +-- !query 81 schema +struct<> +-- !query 81 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS DECIMAL(10,0)) / CAST('1' AS BINARY))' (decimal(10,0) and binary).; line 1 pos 7 + + +-- !query 82 +SELECT cast(1 as decimal(10, 0)) / cast(1 as boolean) FROM t +-- !query 82 schema +struct<> +-- !query 82 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS BOOLEAN))' (decimal(10,0) and boolean).; line 1 pos 7 + + +-- !query 83 +SELECT cast(1 as decimal(10, 0)) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 83 schema +struct<> +-- !query 83 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS DECIMAL(10,0)) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (decimal(10,0) and timestamp).; line 1 pos 7 + + +-- !query 84 +SELECT cast(1 as decimal(10, 0)) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 84 schema +struct<> +-- !query 84 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS DECIMAL(10,0)) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS DECIMAL(10,0)) / CAST('2017-12-11 09:30:00' AS DATE))' (decimal(10,0) and date).; line 1 pos 7 + + +-- !query 85 +SELECT cast(1 as string) / cast(1 as tinyint) FROM t +-- !query 85 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 85 output +1.0 + + +-- !query 86 +SELECT cast(1 as string) / cast(1 as smallint) FROM t +-- !query 86 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 86 output +1.0 + + +-- !query 87 +SELECT cast(1 as string) / cast(1 as int) FROM t +-- !query 87 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 87 output +1.0 + + +-- !query 88 +SELECT cast(1 as string) / cast(1 as bigint) FROM t +-- !query 88 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 88 output +1.0 + + +-- !query 89 +SELECT cast(1 as string) / cast(1 as float) FROM t +-- !query 89 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 89 output +1.0 + + +-- !query 90 +SELECT cast(1 as string) / cast(1 as double) FROM t +-- !query 90 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +-- !query 90 output +1.0 + + +-- !query 91 +SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t +-- !query 91 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +-- !query 91 output +1.0 + + +-- !query 92 +SELECT cast(1 as string) / cast(1 as string) FROM t +-- !query 92 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +-- !query 92 output +1.0 + + +-- !query 93 +SELECT cast(1 as string) / cast('1' as binary) FROM t +-- !query 93 schema +struct<> +-- !query 93 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('1' AS BINARY))' (double and binary).; line 1 pos 7 + + +-- !query 94 +SELECT cast(1 as string) / cast(1 as boolean) FROM t +-- !query 94 schema +struct<> +-- !query 94 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS BOOLEAN))' (double and boolean).; line 1 pos 7 + + +-- !query 95 +SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 95 schema +struct<> +-- !query 95 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (double and timestamp).; line 1 pos 7 + + +-- !query 96 +SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 96 schema +struct<> +-- !query 96 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' (double and date).; line 1 pos 7 + + +-- !query 97 +SELECT cast(1 as string) / cast(1 as tinyint) FROM t +-- !query 97 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +-- !query 97 output +1.0 + + +-- !query 98 +SELECT cast(1 as string) / cast(1 as smallint) FROM t +-- !query 98 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +-- !query 98 output +1.0 + + +-- !query 99 +SELECT cast(1 as string) / cast(1 as int) FROM t +-- !query 99 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +-- !query 99 output +1.0 + + +-- !query 100 +SELECT cast(1 as string) / cast(1 as bigint) FROM t +-- !query 100 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +-- !query 100 output +1.0 + + +-- !query 101 +SELECT cast(1 as string) / cast(1 as float) FROM t +-- !query 101 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +-- !query 101 output +1.0 + + +-- !query 102 +SELECT cast(1 as string) / cast(1 as double) FROM t +-- !query 102 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +-- !query 102 output +1.0 + + +-- !query 103 +SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t +-- !query 103 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +-- !query 103 output +1.0 + + +-- !query 104 +SELECT cast(1 as string) / cast(1 as string) FROM t +-- !query 104 schema +struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +-- !query 104 output +1.0 + + +-- !query 105 +SELECT cast(1 as string) / cast('1' as binary) FROM t +-- !query 105 schema +struct<> +-- !query 105 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('1' AS BINARY))' (double and binary).; line 1 pos 7 + + +-- !query 106 +SELECT cast(1 as string) / cast(1 as boolean) FROM t +-- !query 106 schema +struct<> +-- !query 106 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS BOOLEAN))' (double and boolean).; line 1 pos 7 + + +-- !query 107 +SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 107 schema +struct<> +-- !query 107 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (double and timestamp).; line 1 pos 7 + + +-- !query 108 +SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 108 schema +struct<> +-- !query 108 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' (double and date).; line 1 pos 7 + + +-- !query 109 +SELECT cast('1' as binary) / cast(1 as tinyint) FROM t +-- !query 109 schema +struct<> +-- !query 109 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS TINYINT))' (binary and tinyint).; line 1 pos 7 + + +-- !query 110 +SELECT cast('1' as binary) / cast(1 as smallint) FROM t +-- !query 110 schema +struct<> +-- !query 110 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS SMALLINT))' (binary and smallint).; line 1 pos 7 + + +-- !query 111 +SELECT cast('1' as binary) / cast(1 as int) FROM t +-- !query 111 schema +struct<> +-- !query 111 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS INT))' (binary and int).; line 1 pos 7 + + +-- !query 112 +SELECT cast('1' as binary) / cast(1 as bigint) FROM t +-- !query 112 schema +struct<> +-- !query 112 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS BIGINT))' (binary and bigint).; line 1 pos 7 + + +-- !query 113 +SELECT cast('1' as binary) / cast(1 as float) FROM t +-- !query 113 schema +struct<> +-- !query 113 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS FLOAT))' (binary and float).; line 1 pos 7 + + +-- !query 114 +SELECT cast('1' as binary) / cast(1 as double) FROM t +-- !query 114 schema +struct<> +-- !query 114 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS DOUBLE))' (binary and double).; line 1 pos 7 + + +-- !query 115 +SELECT cast('1' as binary) / cast(1 as decimal(10, 0)) FROM t +-- !query 115 schema +struct<> +-- !query 115 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS DECIMAL(10,0)))' (binary and decimal(10,0)).; line 1 pos 7 + + +-- !query 116 +SELECT cast('1' as binary) / cast(1 as string) FROM t +-- !query 116 schema +struct<> +-- !query 116 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(CAST(1 AS STRING) AS DOUBLE))' (binary and double).; line 1 pos 7 + + +-- !query 117 +SELECT cast('1' as binary) / cast('1' as binary) FROM t +-- !query 117 schema +struct<> +-- !query 117 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST('1' AS BINARY))' due to data type mismatch: '(CAST('1' AS BINARY) / CAST('1' AS BINARY))' requires (double or decimal) type, not binary; line 1 pos 7 + + +-- !query 118 +SELECT cast('1' as binary) / cast(1 as boolean) FROM t +-- !query 118 schema +struct<> +-- !query 118 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS BOOLEAN))' (binary and boolean).; line 1 pos 7 + + +-- !query 119 +SELECT cast('1' as binary) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 119 schema +struct<> +-- !query 119 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (binary and timestamp).; line 1 pos 7 + + +-- !query 120 +SELECT cast('1' as binary) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 120 schema +struct<> +-- !query 120 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00' AS DATE))' (binary and date).; line 1 pos 7 + + +-- !query 121 +SELECT cast(1 as boolean) / cast(1 as tinyint) FROM t +-- !query 121 schema +struct<> +-- !query 121 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS TINYINT))' (boolean and tinyint).; line 1 pos 7 + + +-- !query 122 +SELECT cast(1 as boolean) / cast(1 as smallint) FROM t +-- !query 122 schema +struct<> +-- !query 122 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS SMALLINT))' (boolean and smallint).; line 1 pos 7 + + +-- !query 123 +SELECT cast(1 as boolean) / cast(1 as int) FROM t +-- !query 123 schema +struct<> +-- !query 123 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS INT))' (boolean and int).; line 1 pos 7 + + +-- !query 124 +SELECT cast(1 as boolean) / cast(1 as bigint) FROM t +-- !query 124 schema +struct<> +-- !query 124 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS BIGINT))' (boolean and bigint).; line 1 pos 7 + + +-- !query 125 +SELECT cast(1 as boolean) / cast(1 as float) FROM t +-- !query 125 schema +struct<> +-- !query 125 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS FLOAT))' (boolean and float).; line 1 pos 7 + + +-- !query 126 +SELECT cast(1 as boolean) / cast(1 as double) FROM t +-- !query 126 schema +struct<> +-- !query 126 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS DOUBLE))' (boolean and double).; line 1 pos 7 + + +-- !query 127 +SELECT cast(1 as boolean) / cast(1 as decimal(10, 0)) FROM t +-- !query 127 schema +struct<> +-- !query 127 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS DECIMAL(10,0)))' (boolean and decimal(10,0)).; line 1 pos 7 + + +-- !query 128 +SELECT cast(1 as boolean) / cast(1 as string) FROM t +-- !query 128 schema +struct<> +-- !query 128 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(CAST(1 AS STRING) AS DOUBLE))' (boolean and double).; line 1 pos 7 + + +-- !query 129 +SELECT cast(1 as boolean) / cast('1' as binary) FROM t +-- !query 129 schema +struct<> +-- !query 129 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('1' AS BINARY))' (boolean and binary).; line 1 pos 7 + + +-- !query 130 +SELECT cast(1 as boolean) / cast(1 as boolean) FROM t +-- !query 130 schema +struct<> +-- !query 130 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS BOOLEAN))' due to data type mismatch: '(CAST(1 AS BOOLEAN) / CAST(1 AS BOOLEAN))' requires (double or decimal) type, not boolean; line 1 pos 7 + + +-- !query 131 +SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 131 schema +struct<> +-- !query 131 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 + + +-- !query 132 +SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 132 schema +struct<> +-- !query 132 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 + + +-- !query 133 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as tinyint) FROM t +-- !query 133 schema +struct<> +-- !query 133 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS TINYINT))' (timestamp and tinyint).; line 1 pos 7 + + +-- !query 134 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as smallint) FROM t +-- !query 134 schema +struct<> +-- !query 134 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS SMALLINT))' (timestamp and smallint).; line 1 pos 7 + + +-- !query 135 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as int) FROM t +-- !query 135 schema +struct<> +-- !query 135 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS INT))' (timestamp and int).; line 1 pos 7 + + +-- !query 136 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as bigint) FROM t +-- !query 136 schema +struct<> +-- !query 136 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BIGINT))' (timestamp and bigint).; line 1 pos 7 + + +-- !query 137 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as float) FROM t +-- !query 137 schema +struct<> +-- !query 137 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS FLOAT))' (timestamp and float).; line 1 pos 7 + + +-- !query 138 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as double) FROM t +-- !query 138 schema +struct<> +-- !query 138 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DOUBLE))' (timestamp and double).; line 1 pos 7 + + +-- !query 139 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as decimal(10, 0)) FROM t +-- !query 139 schema +struct<> +-- !query 139 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DECIMAL(10,0)))' (timestamp and decimal(10,0)).; line 1 pos 7 + + +-- !query 140 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as string) FROM t +-- !query 140 schema +struct<> +-- !query 140 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(CAST(1 AS STRING) AS DOUBLE))' (timestamp and double).; line 1 pos 7 + + +-- !query 141 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('1' as binary) FROM t +-- !query 141 schema +struct<> +-- !query 141 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('1' AS BINARY))' (timestamp and binary).; line 1 pos 7 + + +-- !query 142 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as boolean) FROM t +-- !query 142 schema +struct<> +-- !query 142 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BOOLEAN))' (timestamp and boolean).; line 1 pos 7 + + +-- !query 143 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 143 schema +struct<> +-- !query 143 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' requires (double or decimal) type, not timestamp; line 1 pos 7 + + +-- !query 144 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 144 schema +struct<> +-- !query 144 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00' AS DATE))' (timestamp and date).; line 1 pos 7 + + +-- !query 145 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as tinyint) FROM t +-- !query 145 schema +struct<> +-- !query 145 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS TINYINT))' (date and tinyint).; line 1 pos 7 + + +-- !query 146 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as smallint) FROM t +-- !query 146 schema +struct<> +-- !query 146 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS SMALLINT))' (date and smallint).; line 1 pos 7 + + +-- !query 147 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as int) FROM t +-- !query 147 schema +struct<> +-- !query 147 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS INT))' (date and int).; line 1 pos 7 + + +-- !query 148 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as bigint) FROM t +-- !query 148 schema +struct<> +-- !query 148 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BIGINT))' (date and bigint).; line 1 pos 7 + + +-- !query 149 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as float) FROM t +-- !query 149 schema +struct<> +-- !query 149 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS FLOAT))' (date and float).; line 1 pos 7 + + +-- !query 150 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as double) FROM t +-- !query 150 schema +struct<> +-- !query 150 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DOUBLE))' (date and double).; line 1 pos 7 + + +-- !query 151 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as decimal(10, 0)) FROM t +-- !query 151 schema +struct<> +-- !query 151 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(10,0)))' (date and decimal(10,0)).; line 1 pos 7 + + +-- !query 152 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as string) FROM t +-- !query 152 schema +struct<> +-- !query 152 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(CAST(1 AS STRING) AS DOUBLE))' (date and double).; line 1 pos 7 + + +-- !query 153 +SELECT cast('2017-12-11 09:30:00' as date) / cast('1' as binary) FROM t +-- !query 153 schema +struct<> +-- !query 153 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS BINARY))' (date and binary).; line 1 pos 7 + + +-- !query 154 +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as boolean) FROM t +-- !query 154 schema +struct<> +-- !query 154 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BOOLEAN))' (date and boolean).; line 1 pos 7 + + +-- !query 155 +SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 155 schema +struct<> +-- !query 155 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (date and timestamp).; line 1 pos 7 + + +-- !query 156 +SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00' as date) FROM t +-- !query 156 schema +struct<> +-- !query 156 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00' AS DATE))' requires (double or decimal) type, not date; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out new file mode 100644 index 0000000000000..99695aa2db6ca --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out @@ -0,0 +1,1294 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 145 + + +-- !query 0 +CREATE TEMPORARY VIEW t AS SELECT 1 +-- !query 0 schema +struct<> +-- !query 0 output + + + +-- !query 1 +SELECT stack(cast(1 as tinyint), cast(1 as tinyint), null) FROM t +-- !query 1 schema +struct<> +-- !query 1 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 2 +SELECT stack(cast(1 as tinyint), cast(1 as smallint), null) FROM t +-- !query 2 schema +struct<> +-- !query 2 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 3 +SELECT stack(cast(1 as tinyint), cast(1 as int), null) FROM t +-- !query 3 schema +struct<> +-- !query 3 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 4 +SELECT stack(cast(1 as tinyint), cast(1 as bigint), null) FROM t +-- !query 4 schema +struct<> +-- !query 4 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 5 +SELECT stack(cast(1 as tinyint), cast(1 as float), null) FROM t +-- !query 5 schema +struct<> +-- !query 5 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 6 +SELECT stack(cast(1 as tinyint), cast(1 as double), null) FROM t +-- !query 6 schema +struct<> +-- !query 6 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 7 +SELECT stack(cast(1 as tinyint), cast(1 as decimal(10, 0)), null) FROM t +-- !query 7 schema +struct<> +-- !query 7 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 8 +SELECT stack(cast(1 as tinyint), cast(1 as string), null) FROM t +-- !query 8 schema +struct<> +-- !query 8 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 9 +SELECT stack(cast(1 as tinyint), cast('1' as binary), null) FROM t +-- !query 9 schema +struct<> +-- !query 9 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 10 +SELECT stack(cast(1 as tinyint), cast(1 as boolean), null) FROM t +-- !query 10 schema +struct<> +-- !query 10 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 11 +SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 11 schema +struct<> +-- !query 11 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 12 +SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 12 schema +struct<> +-- !query 12 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS TINYINT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 13 +SELECT stack(cast(1 as smallint), cast(1 as tinyint), null) FROM t +-- !query 13 schema +struct<> +-- !query 13 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 14 +SELECT stack(cast(1 as smallint), cast(1 as smallint), null) FROM t +-- !query 14 schema +struct<> +-- !query 14 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 15 +SELECT stack(cast(1 as smallint), cast(1 as int), null) FROM t +-- !query 15 schema +struct<> +-- !query 15 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 16 +SELECT stack(cast(1 as smallint), cast(1 as bigint), null) FROM t +-- !query 16 schema +struct<> +-- !query 16 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 17 +SELECT stack(cast(1 as smallint), cast(1 as float), null) FROM t +-- !query 17 schema +struct<> +-- !query 17 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 18 +SELECT stack(cast(1 as smallint), cast(1 as double), null) FROM t +-- !query 18 schema +struct<> +-- !query 18 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 19 +SELECT stack(cast(1 as smallint), cast(1 as decimal(10, 0)), null) FROM t +-- !query 19 schema +struct<> +-- !query 19 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 20 +SELECT stack(cast(1 as smallint), cast(1 as string), null) FROM t +-- !query 20 schema +struct<> +-- !query 20 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 21 +SELECT stack(cast(1 as smallint), cast('1' as binary), null) FROM t +-- !query 21 schema +struct<> +-- !query 21 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 22 +SELECT stack(cast(1 as smallint), cast(1 as boolean), null) FROM t +-- !query 22 schema +struct<> +-- !query 22 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 23 +SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 23 schema +struct<> +-- !query 23 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 24 +SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 24 schema +struct<> +-- !query 24 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS SMALLINT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 25 +SELECT stack(cast(1 as int), cast(1 as tinyint), null) FROM t +-- !query 25 schema +struct +-- !query 25 output +1 NULL + + +-- !query 26 +SELECT stack(cast(1 as int), cast(1 as smallint), null) FROM t +-- !query 26 schema +struct +-- !query 26 output +1 NULL + + +-- !query 27 +SELECT stack(cast(1 as int), cast(1 as int), null) FROM t +-- !query 27 schema +struct +-- !query 27 output +1 NULL + + +-- !query 28 +SELECT stack(cast(1 as int), cast(1 as bigint), null) FROM t +-- !query 28 schema +struct +-- !query 28 output +1 NULL + + +-- !query 29 +SELECT stack(cast(1 as int), cast(1 as float), null) FROM t +-- !query 29 schema +struct +-- !query 29 output +1.0 NULL + + +-- !query 30 +SELECT stack(cast(1 as int), cast(1 as double), null) FROM t +-- !query 30 schema +struct +-- !query 30 output +1.0 NULL + + +-- !query 31 +SELECT stack(cast(1 as int), cast(1 as decimal(10, 0)), null) FROM t +-- !query 31 schema +struct +-- !query 31 output +1 NULL + + +-- !query 32 +SELECT stack(cast(1 as int), cast(1 as string), null) FROM t +-- !query 32 schema +struct +-- !query 32 output +1 NULL + + +-- !query 33 +SELECT stack(cast(1 as int), cast('1' as binary), null) FROM t +-- !query 33 schema +struct +-- !query 33 output +1 NULL + + +-- !query 34 +SELECT stack(cast(1 as int), cast(1 as boolean), null) FROM t +-- !query 34 schema +struct +-- !query 34 output +true NULL + + +-- !query 35 +SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 35 schema +struct +-- !query 35 output +2017-12-11 09:30:00 NULL + + +-- !query 36 +SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 36 schema +struct +-- !query 36 output +2017-12-11 NULL + + +-- !query 37 +SELECT stack(cast(1 as bigint), cast(1 as tinyint), null) FROM t +-- !query 37 schema +struct<> +-- !query 37 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 38 +SELECT stack(cast(1 as bigint), cast(1 as smallint), null) FROM t +-- !query 38 schema +struct<> +-- !query 38 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 39 +SELECT stack(cast(1 as bigint), cast(1 as int), null) FROM t +-- !query 39 schema +struct<> +-- !query 39 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 40 +SELECT stack(cast(1 as bigint), cast(1 as bigint), null) FROM t +-- !query 40 schema +struct<> +-- !query 40 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 41 +SELECT stack(cast(1 as bigint), cast(1 as float), null) FROM t +-- !query 41 schema +struct<> +-- !query 41 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 42 +SELECT stack(cast(1 as bigint), cast(1 as double), null) FROM t +-- !query 42 schema +struct<> +-- !query 42 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 43 +SELECT stack(cast(1 as bigint), cast(1 as decimal(10, 0)), null) FROM t +-- !query 43 schema +struct<> +-- !query 43 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 44 +SELECT stack(cast(1 as bigint), cast(1 as string), null) FROM t +-- !query 44 schema +struct<> +-- !query 44 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 45 +SELECT stack(cast(1 as bigint), cast('1' as binary), null) FROM t +-- !query 45 schema +struct<> +-- !query 45 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 46 +SELECT stack(cast(1 as bigint), cast(1 as boolean), null) FROM t +-- !query 46 schema +struct<> +-- !query 46 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 47 +SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 47 schema +struct<> +-- !query 47 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 48 +SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 48 schema +struct<> +-- !query 48 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BIGINT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 49 +SELECT stack(cast(1 as float), cast(1 as tinyint), null) FROM t +-- !query 49 schema +struct<> +-- !query 49 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 50 +SELECT stack(cast(1 as float), cast(1 as smallint), null) FROM t +-- !query 50 schema +struct<> +-- !query 50 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 51 +SELECT stack(cast(1 as float), cast(1 as int), null) FROM t +-- !query 51 schema +struct<> +-- !query 51 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 52 +SELECT stack(cast(1 as float), cast(1 as bigint), null) FROM t +-- !query 52 schema +struct<> +-- !query 52 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 53 +SELECT stack(cast(1 as float), cast(1 as float), null) FROM t +-- !query 53 schema +struct<> +-- !query 53 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 54 +SELECT stack(cast(1 as float), cast(1 as double), null) FROM t +-- !query 54 schema +struct<> +-- !query 54 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 55 +SELECT stack(cast(1 as float), cast(1 as decimal(10, 0)), null) FROM t +-- !query 55 schema +struct<> +-- !query 55 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 56 +SELECT stack(cast(1 as float), cast(1 as string), null) FROM t +-- !query 56 schema +struct<> +-- !query 56 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 57 +SELECT stack(cast(1 as float), cast('1' as binary), null) FROM t +-- !query 57 schema +struct<> +-- !query 57 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 58 +SELECT stack(cast(1 as float), cast(1 as boolean), null) FROM t +-- !query 58 schema +struct<> +-- !query 58 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 59 +SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 59 schema +struct<> +-- !query 59 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 60 +SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 60 schema +struct<> +-- !query 60 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS FLOAT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 61 +SELECT stack(cast(1 as double), cast(1 as tinyint), null) FROM t +-- !query 61 schema +struct<> +-- !query 61 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 62 +SELECT stack(cast(1 as double), cast(1 as smallint), null) FROM t +-- !query 62 schema +struct<> +-- !query 62 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 63 +SELECT stack(cast(1 as double), cast(1 as int), null) FROM t +-- !query 63 schema +struct<> +-- !query 63 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 64 +SELECT stack(cast(1 as double), cast(1 as bigint), null) FROM t +-- !query 64 schema +struct<> +-- !query 64 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 65 +SELECT stack(cast(1 as double), cast(1 as float), null) FROM t +-- !query 65 schema +struct<> +-- !query 65 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 66 +SELECT stack(cast(1 as double), cast(1 as double), null) FROM t +-- !query 66 schema +struct<> +-- !query 66 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 67 +SELECT stack(cast(1 as double), cast(1 as decimal(10, 0)), null) FROM t +-- !query 67 schema +struct<> +-- !query 67 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 68 +SELECT stack(cast(1 as double), cast(1 as string), null) FROM t +-- !query 68 schema +struct<> +-- !query 68 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 69 +SELECT stack(cast(1 as double), cast('1' as binary), null) FROM t +-- !query 69 schema +struct<> +-- !query 69 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 70 +SELECT stack(cast(1 as double), cast(1 as boolean), null) FROM t +-- !query 70 schema +struct<> +-- !query 70 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 71 +SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 71 schema +struct<> +-- !query 71 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 72 +SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 72 schema +struct<> +-- !query 72 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DOUBLE), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 73 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as tinyint), null) FROM t +-- !query 73 schema +struct<> +-- !query 73 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 74 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as smallint), null) FROM t +-- !query 74 schema +struct<> +-- !query 74 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 75 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as int), null) FROM t +-- !query 75 schema +struct<> +-- !query 75 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 76 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as bigint), null) FROM t +-- !query 76 schema +struct<> +-- !query 76 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 77 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as float), null) FROM t +-- !query 77 schema +struct<> +-- !query 77 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 78 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as double), null) FROM t +-- !query 78 schema +struct<> +-- !query 78 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 79 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as decimal(10, 0)), null) FROM t +-- !query 79 schema +struct<> +-- !query 79 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 80 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as string), null) FROM t +-- !query 80 schema +struct<> +-- !query 80 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 81 +SELECT stack(cast(1 as decimal(10, 0)), cast('1' as binary), null) FROM t +-- !query 81 schema +struct<> +-- !query 81 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 82 +SELECT stack(cast(1 as decimal(10, 0)), cast(1 as boolean), null) FROM t +-- !query 82 schema +struct<> +-- !query 82 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 83 +SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 83 schema +struct<> +-- !query 83 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 84 +SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 84 schema +struct<> +-- !query 84 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 85 +SELECT stack(cast(1 as string), cast(1 as tinyint), null) FROM t +-- !query 85 schema +struct<> +-- !query 85 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 86 +SELECT stack(cast(1 as string), cast(1 as smallint), null) FROM t +-- !query 86 schema +struct<> +-- !query 86 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 87 +SELECT stack(cast(1 as string), cast(1 as int), null) FROM t +-- !query 87 schema +struct<> +-- !query 87 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 88 +SELECT stack(cast(1 as string), cast(1 as bigint), null) FROM t +-- !query 88 schema +struct<> +-- !query 88 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 89 +SELECT stack(cast(1 as string), cast(1 as float), null) FROM t +-- !query 89 schema +struct<> +-- !query 89 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 90 +SELECT stack(cast(1 as string), cast(1 as double), null) FROM t +-- !query 90 schema +struct<> +-- !query 90 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 91 +SELECT stack(cast(1 as string), cast(1 as decimal(10, 0)), null) FROM t +-- !query 91 schema +struct<> +-- !query 91 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 92 +SELECT stack(cast(1 as string), cast(1 as string), null) FROM t +-- !query 92 schema +struct<> +-- !query 92 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 93 +SELECT stack(cast(1 as string), cast('1' as binary), null) FROM t +-- !query 93 schema +struct<> +-- !query 93 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 94 +SELECT stack(cast(1 as string), cast(1 as boolean), null) FROM t +-- !query 94 schema +struct<> +-- !query 94 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 95 +SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 95 schema +struct<> +-- !query 95 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 96 +SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 96 schema +struct<> +-- !query 96 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS STRING), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 97 +SELECT stack(cast('1' as binary), cast(1 as tinyint), null) FROM t +-- !query 97 schema +struct<> +-- !query 97 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 98 +SELECT stack(cast('1' as binary), cast(1 as smallint), null) FROM t +-- !query 98 schema +struct<> +-- !query 98 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 99 +SELECT stack(cast('1' as binary), cast(1 as int), null) FROM t +-- !query 99 schema +struct<> +-- !query 99 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 100 +SELECT stack(cast('1' as binary), cast(1 as bigint), null) FROM t +-- !query 100 schema +struct<> +-- !query 100 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 101 +SELECT stack(cast('1' as binary), cast(1 as float), null) FROM t +-- !query 101 schema +struct<> +-- !query 101 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 102 +SELECT stack(cast('1' as binary), cast(1 as double), null) FROM t +-- !query 102 schema +struct<> +-- !query 102 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 103 +SELECT stack(cast('1' as binary), cast(1 as decimal(10, 0)), null) FROM t +-- !query 103 schema +struct<> +-- !query 103 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 104 +SELECT stack(cast('1' as binary), cast(1 as string), null) FROM t +-- !query 104 schema +struct<> +-- !query 104 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 105 +SELECT stack(cast('1' as binary), cast('1' as binary), null) FROM t +-- !query 105 schema +struct<> +-- !query 105 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 106 +SELECT stack(cast('1' as binary), cast(1 as boolean), null) FROM t +-- !query 106 schema +struct<> +-- !query 106 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 107 +SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 107 schema +struct<> +-- !query 107 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 108 +SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 108 schema +struct<> +-- !query 108 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('1' AS BINARY), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 109 +SELECT stack(cast(1 as boolean), cast(1 as tinyint), null) FROM t +-- !query 109 schema +struct<> +-- !query 109 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 110 +SELECT stack(cast(1 as boolean), cast(1 as smallint), null) FROM t +-- !query 110 schema +struct<> +-- !query 110 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 111 +SELECT stack(cast(1 as boolean), cast(1 as int), null) FROM t +-- !query 111 schema +struct<> +-- !query 111 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 112 +SELECT stack(cast(1 as boolean), cast(1 as bigint), null) FROM t +-- !query 112 schema +struct<> +-- !query 112 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 113 +SELECT stack(cast(1 as boolean), cast(1 as float), null) FROM t +-- !query 113 schema +struct<> +-- !query 113 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 114 +SELECT stack(cast(1 as boolean), cast(1 as double), null) FROM t +-- !query 114 schema +struct<> +-- !query 114 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 115 +SELECT stack(cast(1 as boolean), cast(1 as decimal(10, 0)), null) FROM t +-- !query 115 schema +struct<> +-- !query 115 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 116 +SELECT stack(cast(1 as boolean), cast(1 as string), null) FROM t +-- !query 116 schema +struct<> +-- !query 116 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 117 +SELECT stack(cast(1 as boolean), cast('1' as binary), null) FROM t +-- !query 117 schema +struct<> +-- !query 117 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 118 +SELECT stack(cast(1 as boolean), cast(1 as boolean), null) FROM t +-- !query 118 schema +struct<> +-- !query 118 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 119 +SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 119 schema +struct<> +-- !query 119 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 120 +SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 120 schema +struct<> +-- !query 120 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 121 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as tinyint), null) FROM t +-- !query 121 schema +struct<> +-- !query 121 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 122 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as smallint), null) FROM t +-- !query 122 schema +struct<> +-- !query 122 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 123 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as int), null) FROM t +-- !query 123 schema +struct<> +-- !query 123 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 124 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as bigint), null) FROM t +-- !query 124 schema +struct<> +-- !query 124 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 125 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as float), null) FROM t +-- !query 125 schema +struct<> +-- !query 125 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 126 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as double), null) FROM t +-- !query 126 schema +struct<> +-- !query 126 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 127 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as decimal(10, 0)), null) FROM t +-- !query 127 schema +struct<> +-- !query 127 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 128 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as string), null) FROM t +-- !query 128 schema +struct<> +-- !query 128 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 129 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('1' as binary), null) FROM t +-- !query 129 schema +struct<> +-- !query 129 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 130 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as boolean), null) FROM t +-- !query 130 schema +struct<> +-- !query 130 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 131 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 131 schema +struct<> +-- !query 131 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 132 +SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 132 schema +struct<> +-- !query 132 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 133 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as tinyint), null) FROM t +-- !query 133 schema +struct<> +-- !query 133 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 134 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as smallint), null) FROM t +-- !query 134 schema +struct<> +-- !query 134 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 135 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as int), null) FROM t +-- !query 135 schema +struct<> +-- !query 135 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 136 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as bigint), null) FROM t +-- !query 136 schema +struct<> +-- !query 136 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 137 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as float), null) FROM t +-- !query 137 schema +struct<> +-- !query 137 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 138 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as double), null) FROM t +-- !query 138 schema +struct<> +-- !query 138 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 139 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as decimal(10, 0)), null) FROM t +-- !query 139 schema +struct<> +-- !query 139 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 140 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as string), null) FROM t +-- !query 140 schema +struct<> +-- !query 140 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 141 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast('1' as binary), null) FROM t +-- !query 141 schema +struct<> +-- !query 141 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 142 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as boolean), null) FROM t +-- !query 142 schema +struct<> +-- !query 142 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 143 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t +-- !query 143 schema +struct<> +-- !query 143 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 + + +-- !query 144 +SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00' as date), null) FROM t +-- !query 144 schema +struct<> +-- !query 144 output +org.apache.spark.sql.AnalysisException +cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out new file mode 100644 index 0000000000000..a0933da1d8a28 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out @@ -0,0 +1,3749 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 433 + + +-- !query 0 +CREATE TEMPORARY VIEW t AS SELECT 1 +-- !query 0 schema +struct<> +-- !query 0 output + + + +-- !query 1 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 1 schema +struct +-- !query 1 output +1 +2 + + +-- !query 2 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 2 schema +struct +-- !query 2 output +1 +2 + + +-- !query 3 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 3 schema +struct +-- !query 3 output +1 +2 + + +-- !query 4 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 4 schema +struct +-- !query 4 output +1 +2 + + +-- !query 5 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 5 schema +struct +-- !query 5 output +1.0 +2.0 + + +-- !query 6 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 6 schema +struct +-- !query 6 output +1.0 +2.0 + + +-- !query 7 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 7 schema +struct +-- !query 7 output +1 +2 + + +-- !query 8 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 8 schema +struct +-- !query 8 output +1 +2 + + +-- !query 9 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 9 schema +struct<> +-- !query 9 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table; + + +-- !query 10 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 10 schema +struct<> +-- !query 10 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table; + + +-- !query 11 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 11 schema +struct<> +-- !query 11 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table; + + +-- !query 12 +SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 12 schema +struct<> +-- !query 12 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table; + + +-- !query 13 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 13 schema +struct +-- !query 13 output +1 +2 + + +-- !query 14 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 14 schema +struct +-- !query 14 output +1 +2 + + +-- !query 15 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 15 schema +struct +-- !query 15 output +1 +2 + + +-- !query 16 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 16 schema +struct +-- !query 16 output +1 +2 + + +-- !query 17 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 17 schema +struct +-- !query 17 output +1.0 +2.0 + + +-- !query 18 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 18 schema +struct +-- !query 18 output +1.0 +2.0 + + +-- !query 19 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 19 schema +struct +-- !query 19 output +1 +2 + + +-- !query 20 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 20 schema +struct +-- !query 20 output +1 +2 + + +-- !query 21 +SELECT cast(1 as smallint) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 21 schema +struct<> +-- !query 21 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table; + + +-- !query 22 +SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 22 schema +struct<> +-- !query 22 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table; + + +-- !query 23 +SELECT cast(1 as smallint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 23 schema +struct<> +-- !query 23 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table; + + +-- !query 24 +SELECT cast(1 as smallint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 24 schema +struct<> +-- !query 24 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table; + + +-- !query 25 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 25 schema +struct +-- !query 25 output +1 +2 + + +-- !query 26 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 26 schema +struct +-- !query 26 output +1 +2 + + +-- !query 27 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 27 schema +struct +-- !query 27 output +1 +2 + + +-- !query 28 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 28 schema +struct +-- !query 28 output +1 +2 + + +-- !query 29 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 29 schema +struct +-- !query 29 output +1.0 +2.0 + + +-- !query 30 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 30 schema +struct +-- !query 30 output +1.0 +2.0 + + +-- !query 31 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 31 schema +struct +-- !query 31 output +1 +2 + + +-- !query 32 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 32 schema +struct +-- !query 32 output +1 +2 + + +-- !query 33 +SELECT cast(1 as int) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 33 schema +struct<> +-- !query 33 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> int at the first column of the second table; + + +-- !query 34 +SELECT cast(1 as int) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 34 schema +struct<> +-- !query 34 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table; + + +-- !query 35 +SELECT cast(1 as int) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 35 schema +struct<> +-- !query 35 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table; + + +-- !query 36 +SELECT cast(1 as int) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 36 schema +struct<> +-- !query 36 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> int at the first column of the second table; + + +-- !query 37 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 37 schema +struct +-- !query 37 output +1 +2 + + +-- !query 38 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 38 schema +struct +-- !query 38 output +1 +2 + + +-- !query 39 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 39 schema +struct +-- !query 39 output +1 +2 + + +-- !query 40 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 40 schema +struct +-- !query 40 output +1 +2 + + +-- !query 41 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 41 schema +struct +-- !query 41 output +1.0 +2.0 + + +-- !query 42 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 42 schema +struct +-- !query 42 output +1.0 +2.0 + + +-- !query 43 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 43 schema +struct +-- !query 43 output +1 +2 + + +-- !query 44 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 44 schema +struct +-- !query 44 output +1 +2 + + +-- !query 45 +SELECT cast(1 as bigint) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 45 schema +struct<> +-- !query 45 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table; + + +-- !query 46 +SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 46 schema +struct<> +-- !query 46 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table; + + +-- !query 47 +SELECT cast(1 as bigint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 47 schema +struct<> +-- !query 47 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table; + + +-- !query 48 +SELECT cast(1 as bigint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 48 schema +struct<> +-- !query 48 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table; + + +-- !query 49 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 49 schema +struct +-- !query 49 output +1.0 +2.0 + + +-- !query 50 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 50 schema +struct +-- !query 50 output +1.0 +2.0 + + +-- !query 51 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 51 schema +struct +-- !query 51 output +1.0 +2.0 + + +-- !query 52 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 52 schema +struct +-- !query 52 output +1.0 +2.0 + + +-- !query 53 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 53 schema +struct +-- !query 53 output +1.0 +2.0 + + +-- !query 54 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 54 schema +struct +-- !query 54 output +1.0 +2.0 + + +-- !query 55 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 55 schema +struct +-- !query 55 output +1.0 +2.0 + + +-- !query 56 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 56 schema +struct +-- !query 56 output +1.0 +2 + + +-- !query 57 +SELECT cast(1 as float) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 57 schema +struct<> +-- !query 57 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> float at the first column of the second table; + + +-- !query 58 +SELECT cast(1 as float) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 58 schema +struct<> +-- !query 58 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table; + + +-- !query 59 +SELECT cast(1 as float) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 59 schema +struct<> +-- !query 59 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table; + + +-- !query 60 +SELECT cast(1 as float) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 60 schema +struct<> +-- !query 60 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> float at the first column of the second table; + + +-- !query 61 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 61 schema +struct +-- !query 61 output +1.0 +2.0 + + +-- !query 62 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 62 schema +struct +-- !query 62 output +1.0 +2.0 + + +-- !query 63 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 63 schema +struct +-- !query 63 output +1.0 +2.0 + + +-- !query 64 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 64 schema +struct +-- !query 64 output +1.0 +2.0 + + +-- !query 65 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 65 schema +struct +-- !query 65 output +1.0 +2.0 + + +-- !query 66 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 66 schema +struct +-- !query 66 output +1.0 +2.0 + + +-- !query 67 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 67 schema +struct +-- !query 67 output +1.0 +2.0 + + +-- !query 68 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 68 schema +struct +-- !query 68 output +1.0 +2 + + +-- !query 69 +SELECT cast(1 as double) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 69 schema +struct<> +-- !query 69 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> double at the first column of the second table; + + +-- !query 70 +SELECT cast(1 as double) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 70 schema +struct<> +-- !query 70 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table; + + +-- !query 71 +SELECT cast(1 as double) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 71 schema +struct<> +-- !query 71 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table; + + +-- !query 72 +SELECT cast(1 as double) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 72 schema +struct<> +-- !query 72 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> double at the first column of the second table; + + +-- !query 73 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 73 schema +struct +-- !query 73 output +1 +2 + + +-- !query 74 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 74 schema +struct +-- !query 74 output +1 +2 + + +-- !query 75 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 75 schema +struct +-- !query 75 output +1 +2 + + +-- !query 76 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 76 schema +struct +-- !query 76 output +1 +2 + + +-- !query 77 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 77 schema +struct +-- !query 77 output +1.0 +2.0 + + +-- !query 78 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 78 schema +struct +-- !query 78 output +1.0 +2.0 + + +-- !query 79 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 79 schema +struct +-- !query 79 output +1 +2 + + +-- !query 80 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 80 schema +struct +-- !query 80 output +1 +2 + + +-- !query 81 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 81 schema +struct<> +-- !query 81 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table; + + +-- !query 82 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 82 schema +struct<> +-- !query 82 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table; + + +-- !query 83 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 83 schema +struct<> +-- !query 83 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table; + + +-- !query 84 +SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 84 schema +struct<> +-- !query 84 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table; + + +-- !query 85 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 85 schema +struct +-- !query 85 output +1 +2 + + +-- !query 86 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 86 schema +struct +-- !query 86 output +1 +2 + + +-- !query 87 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 87 schema +struct +-- !query 87 output +1 +2 + + +-- !query 88 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 88 schema +struct +-- !query 88 output +1 +2 + + +-- !query 89 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 89 schema +struct +-- !query 89 output +1 +2.0 + + +-- !query 90 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 90 schema +struct +-- !query 90 output +1 +2.0 + + +-- !query 91 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 91 schema +struct +-- !query 91 output +1 +2 + + +-- !query 92 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 92 schema +struct +-- !query 92 output +1 +2 + + +-- !query 93 +SELECT cast(1 as string) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 93 schema +struct<> +-- !query 93 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> string at the first column of the second table; + + +-- !query 94 +SELECT cast(1 as string) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 94 schema +struct<> +-- !query 94 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table; + + +-- !query 95 +SELECT cast(1 as string) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 95 schema +struct +-- !query 95 output +1 +2017-12-11 09:30:00 + + +-- !query 96 +SELECT cast(1 as string) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 96 schema +struct +-- !query 96 output +1 +2017-12-11 + + +-- !query 97 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 97 schema +struct<> +-- !query 97 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table; + + +-- !query 98 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 98 schema +struct<> +-- !query 98 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table; + + +-- !query 99 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 99 schema +struct<> +-- !query 99 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. int <> binary at the first column of the second table; + + +-- !query 100 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 100 schema +struct<> +-- !query 100 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table; + + +-- !query 101 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 101 schema +struct<> +-- !query 101 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. float <> binary at the first column of the second table; + + +-- !query 102 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 102 schema +struct<> +-- !query 102 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. double <> binary at the first column of the second table; + + +-- !query 103 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 103 schema +struct<> +-- !query 103 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table; + + +-- !query 104 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 104 schema +struct<> +-- !query 104 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. string <> binary at the first column of the second table; + + +-- !query 105 +SELECT cast('1' as binary) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 105 schema +struct +-- !query 105 output +1 +2 + + +-- !query 106 +SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 106 schema +struct<> +-- !query 106 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table; + + +-- !query 107 +SELECT cast('1' as binary) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 107 schema +struct<> +-- !query 107 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table; + + +-- !query 108 +SELECT cast('1' as binary) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 108 schema +struct<> +-- !query 108 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> binary at the first column of the second table; + + +-- !query 109 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 109 schema +struct<> +-- !query 109 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table; + + +-- !query 110 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 110 schema +struct<> +-- !query 110 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table; + + +-- !query 111 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 111 schema +struct<> +-- !query 111 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table; + + +-- !query 112 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 112 schema +struct<> +-- !query 112 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table; + + +-- !query 113 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 113 schema +struct<> +-- !query 113 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table; + + +-- !query 114 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 114 schema +struct<> +-- !query 114 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table; + + +-- !query 115 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 115 schema +struct<> +-- !query 115 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table; + + +-- !query 116 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 116 schema +struct<> +-- !query 116 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table; + + +-- !query 117 +SELECT cast(1 as boolean) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 117 schema +struct<> +-- !query 117 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table; + + +-- !query 118 +SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 118 schema +struct +-- !query 118 output +true + + +-- !query 119 +SELECT cast(1 as boolean) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 119 schema +struct<> +-- !query 119 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table; + + +-- !query 120 +SELECT cast(1 as boolean) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 120 schema +struct<> +-- !query 120 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table; + + +-- !query 121 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 121 schema +struct<> +-- !query 121 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table; + + +-- !query 122 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 122 schema +struct<> +-- !query 122 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table; + + +-- !query 123 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 123 schema +struct<> +-- !query 123 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table; + + +-- !query 124 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 124 schema +struct<> +-- !query 124 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table; + + +-- !query 125 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 125 schema +struct<> +-- !query 125 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table; + + +-- !query 126 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 126 schema +struct<> +-- !query 126 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table; + + +-- !query 127 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 127 schema +struct<> +-- !query 127 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table; + + +-- !query 128 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 128 schema +struct +-- !query 128 output +2 +2017-12-12 09:30:00 + + +-- !query 129 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 129 schema +struct<> +-- !query 129 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table; + + +-- !query 130 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 130 schema +struct<> +-- !query 130 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table; + + +-- !query 131 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 131 schema +struct +-- !query 131 output +2017-12-11 09:30:00 +2017-12-12 09:30:00 + + +-- !query 132 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 132 schema +struct +-- !query 132 output +2017-12-11 00:00:00 +2017-12-12 09:30:00 + + +-- !query 133 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as tinyint) FROM t +-- !query 133 schema +struct<> +-- !query 133 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table; + + +-- !query 134 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as smallint) FROM t +-- !query 134 schema +struct<> +-- !query 134 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table; + + +-- !query 135 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as int) FROM t +-- !query 135 schema +struct<> +-- !query 135 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. int <> date at the first column of the second table; + + +-- !query 136 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as bigint) FROM t +-- !query 136 schema +struct<> +-- !query 136 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table; + + +-- !query 137 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as float) FROM t +-- !query 137 schema +struct<> +-- !query 137 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. float <> date at the first column of the second table; + + +-- !query 138 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as double) FROM t +-- !query 138 schema +struct<> +-- !query 138 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. double <> date at the first column of the second table; + + +-- !query 139 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 139 schema +struct<> +-- !query 139 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table; + + +-- !query 140 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as string) FROM t +-- !query 140 schema +struct +-- !query 140 output +2 +2017-12-12 + + +-- !query 141 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2' as binary) FROM t +-- !query 141 schema +struct<> +-- !query 141 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. binary <> date at the first column of the second table; + + +-- !query 142 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as boolean) FROM t +-- !query 142 schema +struct<> +-- !query 142 output +org.apache.spark.sql.AnalysisException +Union can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table; + + +-- !query 143 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 143 schema +struct +-- !query 143 output +2017-12-11 09:30:00 +2017-12-12 00:00:00 + + +-- !query 144 +SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 144 schema +struct +-- !query 144 output +2017-12-11 +2017-12-12 + + +-- !query 145 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 145 schema +struct +-- !query 145 output +1 + + +-- !query 146 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 146 schema +struct +-- !query 146 output +1 + + +-- !query 147 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 147 schema +struct +-- !query 147 output +1 + + +-- !query 148 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 148 schema +struct +-- !query 148 output +1 + + +-- !query 149 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 149 schema +struct +-- !query 149 output +1.0 + + +-- !query 150 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 150 schema +struct +-- !query 150 output +1.0 + + +-- !query 151 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 151 schema +struct +-- !query 151 output +1 + + +-- !query 152 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 152 schema +struct +-- !query 152 output +1 + + +-- !query 153 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 153 schema +struct<> +-- !query 153 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table; + + +-- !query 154 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 154 schema +struct<> +-- !query 154 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table; + + +-- !query 155 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 155 schema +struct<> +-- !query 155 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table; + + +-- !query 156 +SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 156 schema +struct<> +-- !query 156 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table; + + +-- !query 157 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 157 schema +struct +-- !query 157 output +1 + + +-- !query 158 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 158 schema +struct +-- !query 158 output +1 + + +-- !query 159 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 159 schema +struct +-- !query 159 output +1 + + +-- !query 160 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 160 schema +struct +-- !query 160 output +1 + + +-- !query 161 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 161 schema +struct +-- !query 161 output +1.0 + + +-- !query 162 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 162 schema +struct +-- !query 162 output +1.0 + + +-- !query 163 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 163 schema +struct +-- !query 163 output +1 + + +-- !query 164 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 164 schema +struct +-- !query 164 output +1 + + +-- !query 165 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 165 schema +struct<> +-- !query 165 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table; + + +-- !query 166 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 166 schema +struct<> +-- !query 166 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table; + + +-- !query 167 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 167 schema +struct<> +-- !query 167 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table; + + +-- !query 168 +SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 168 schema +struct<> +-- !query 168 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table; + + +-- !query 169 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 169 schema +struct +-- !query 169 output +1 + + +-- !query 170 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 170 schema +struct +-- !query 170 output +1 + + +-- !query 171 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 171 schema +struct +-- !query 171 output +1 + + +-- !query 172 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 172 schema +struct +-- !query 172 output +1 + + +-- !query 173 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 173 schema +struct +-- !query 173 output +1.0 + + +-- !query 174 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 174 schema +struct +-- !query 174 output +1.0 + + +-- !query 175 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 175 schema +struct +-- !query 175 output +1 + + +-- !query 176 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 176 schema +struct +-- !query 176 output +1 + + +-- !query 177 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 177 schema +struct<> +-- !query 177 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> int at the first column of the second table; + + +-- !query 178 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 178 schema +struct<> +-- !query 178 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table; + + +-- !query 179 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 179 schema +struct<> +-- !query 179 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table; + + +-- !query 180 +SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 180 schema +struct<> +-- !query 180 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> int at the first column of the second table; + + +-- !query 181 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 181 schema +struct +-- !query 181 output +1 + + +-- !query 182 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 182 schema +struct +-- !query 182 output +1 + + +-- !query 183 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 183 schema +struct +-- !query 183 output +1 + + +-- !query 184 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 184 schema +struct +-- !query 184 output +1 + + +-- !query 185 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 185 schema +struct +-- !query 185 output +1.0 + + +-- !query 186 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 186 schema +struct +-- !query 186 output +1.0 + + +-- !query 187 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 187 schema +struct +-- !query 187 output +1 + + +-- !query 188 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 188 schema +struct +-- !query 188 output +1 + + +-- !query 189 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 189 schema +struct<> +-- !query 189 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table; + + +-- !query 190 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 190 schema +struct<> +-- !query 190 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table; + + +-- !query 191 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 191 schema +struct<> +-- !query 191 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table; + + +-- !query 192 +SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 192 schema +struct<> +-- !query 192 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table; + + +-- !query 193 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 193 schema +struct +-- !query 193 output +1.0 + + +-- !query 194 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 194 schema +struct +-- !query 194 output +1.0 + + +-- !query 195 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 195 schema +struct +-- !query 195 output +1.0 + + +-- !query 196 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 196 schema +struct +-- !query 196 output +1.0 + + +-- !query 197 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 197 schema +struct +-- !query 197 output +1.0 + + +-- !query 198 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 198 schema +struct +-- !query 198 output +1.0 + + +-- !query 199 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 199 schema +struct +-- !query 199 output +1.0 + + +-- !query 200 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 200 schema +struct +-- !query 200 output +1.0 + + +-- !query 201 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 201 schema +struct<> +-- !query 201 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> float at the first column of the second table; + + +-- !query 202 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 202 schema +struct<> +-- !query 202 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table; + + +-- !query 203 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 203 schema +struct<> +-- !query 203 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table; + + +-- !query 204 +SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 204 schema +struct<> +-- !query 204 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> float at the first column of the second table; + + +-- !query 205 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 205 schema +struct +-- !query 205 output +1.0 + + +-- !query 206 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 206 schema +struct +-- !query 206 output +1.0 + + +-- !query 207 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 207 schema +struct +-- !query 207 output +1.0 + + +-- !query 208 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 208 schema +struct +-- !query 208 output +1.0 + + +-- !query 209 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 209 schema +struct +-- !query 209 output +1.0 + + +-- !query 210 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 210 schema +struct +-- !query 210 output +1.0 + + +-- !query 211 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 211 schema +struct +-- !query 211 output +1.0 + + +-- !query 212 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 212 schema +struct +-- !query 212 output +1.0 + + +-- !query 213 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 213 schema +struct<> +-- !query 213 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> double at the first column of the second table; + + +-- !query 214 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 214 schema +struct<> +-- !query 214 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table; + + +-- !query 215 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 215 schema +struct<> +-- !query 215 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table; + + +-- !query 216 +SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 216 schema +struct<> +-- !query 216 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> double at the first column of the second table; + + +-- !query 217 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 217 schema +struct +-- !query 217 output +1 + + +-- !query 218 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 218 schema +struct +-- !query 218 output +1 + + +-- !query 219 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 219 schema +struct +-- !query 219 output +1 + + +-- !query 220 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 220 schema +struct +-- !query 220 output +1 + + +-- !query 221 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 221 schema +struct +-- !query 221 output +1.0 + + +-- !query 222 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 222 schema +struct +-- !query 222 output +1.0 + + +-- !query 223 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 223 schema +struct +-- !query 223 output +1 + + +-- !query 224 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 224 schema +struct +-- !query 224 output +1 + + +-- !query 225 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 225 schema +struct<> +-- !query 225 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table; + + +-- !query 226 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 226 schema +struct<> +-- !query 226 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table; + + +-- !query 227 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 227 schema +struct<> +-- !query 227 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table; + + +-- !query 228 +SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 228 schema +struct<> +-- !query 228 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table; + + +-- !query 229 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 229 schema +struct +-- !query 229 output +1 + + +-- !query 230 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 230 schema +struct +-- !query 230 output +1 + + +-- !query 231 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 231 schema +struct +-- !query 231 output +1 + + +-- !query 232 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 232 schema +struct +-- !query 232 output +1 + + +-- !query 233 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 233 schema +struct +-- !query 233 output +1 + + +-- !query 234 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 234 schema +struct +-- !query 234 output +1 + + +-- !query 235 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 235 schema +struct +-- !query 235 output +1 + + +-- !query 236 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 236 schema +struct +-- !query 236 output +1 + + +-- !query 237 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 237 schema +struct<> +-- !query 237 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> string at the first column of the second table; + + +-- !query 238 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 238 schema +struct<> +-- !query 238 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table; + + +-- !query 239 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 239 schema +struct +-- !query 239 output +1 + + +-- !query 240 +SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 240 schema +struct +-- !query 240 output +1 + + +-- !query 241 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 241 schema +struct<> +-- !query 241 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table; + + +-- !query 242 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 242 schema +struct<> +-- !query 242 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table; + + +-- !query 243 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 243 schema +struct<> +-- !query 243 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. int <> binary at the first column of the second table; + + +-- !query 244 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 244 schema +struct<> +-- !query 244 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table; + + +-- !query 245 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 245 schema +struct<> +-- !query 245 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. float <> binary at the first column of the second table; + + +-- !query 246 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 246 schema +struct<> +-- !query 246 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. double <> binary at the first column of the second table; + + +-- !query 247 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 247 schema +struct<> +-- !query 247 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table; + + +-- !query 248 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 248 schema +struct<> +-- !query 248 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. string <> binary at the first column of the second table; + + +-- !query 249 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 249 schema +struct +-- !query 249 output +1 + + +-- !query 250 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 250 schema +struct<> +-- !query 250 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table; + + +-- !query 251 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 251 schema +struct<> +-- !query 251 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table; + + +-- !query 252 +SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 252 schema +struct<> +-- !query 252 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> binary at the first column of the second table; + + +-- !query 253 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 253 schema +struct<> +-- !query 253 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table; + + +-- !query 254 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 254 schema +struct<> +-- !query 254 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table; + + +-- !query 255 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 255 schema +struct<> +-- !query 255 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table; + + +-- !query 256 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 256 schema +struct<> +-- !query 256 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table; + + +-- !query 257 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 257 schema +struct<> +-- !query 257 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table; + + +-- !query 258 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 258 schema +struct<> +-- !query 258 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table; + + +-- !query 259 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 259 schema +struct<> +-- !query 259 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table; + + +-- !query 260 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 260 schema +struct<> +-- !query 260 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table; + + +-- !query 261 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 261 schema +struct<> +-- !query 261 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table; + + +-- !query 262 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 262 schema +struct +-- !query 262 output + + + +-- !query 263 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 263 schema +struct<> +-- !query 263 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table; + + +-- !query 264 +SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 264 schema +struct<> +-- !query 264 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table; + + +-- !query 265 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 265 schema +struct<> +-- !query 265 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table; + + +-- !query 266 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 266 schema +struct<> +-- !query 266 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table; + + +-- !query 267 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 267 schema +struct<> +-- !query 267 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table; + + +-- !query 268 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 268 schema +struct<> +-- !query 268 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table; + + +-- !query 269 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 269 schema +struct<> +-- !query 269 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table; + + +-- !query 270 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 270 schema +struct<> +-- !query 270 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table; + + +-- !query 271 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 271 schema +struct<> +-- !query 271 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table; + + +-- !query 272 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 272 schema +struct +-- !query 272 output +2017-12-12 09:30:00 + + +-- !query 273 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 273 schema +struct<> +-- !query 273 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table; + + +-- !query 274 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 274 schema +struct<> +-- !query 274 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table; + + +-- !query 275 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 275 schema +struct +-- !query 275 output +2017-12-12 09:30:00 + + +-- !query 276 +SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 276 schema +struct +-- !query 276 output +2017-12-12 09:30:00 + + +-- !query 277 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t +-- !query 277 schema +struct<> +-- !query 277 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table; + + +-- !query 278 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as smallint) FROM t +-- !query 278 schema +struct<> +-- !query 278 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table; + + +-- !query 279 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as int) FROM t +-- !query 279 schema +struct<> +-- !query 279 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. int <> date at the first column of the second table; + + +-- !query 280 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as bigint) FROM t +-- !query 280 schema +struct<> +-- !query 280 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table; + + +-- !query 281 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as float) FROM t +-- !query 281 schema +struct<> +-- !query 281 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. float <> date at the first column of the second table; + + +-- !query 282 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as double) FROM t +-- !query 282 schema +struct<> +-- !query 282 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. double <> date at the first column of the second table; + + +-- !query 283 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t +-- !query 283 schema +struct<> +-- !query 283 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table; + + +-- !query 284 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as string) FROM t +-- !query 284 schema +struct +-- !query 284 output +2017-12-12 + + +-- !query 285 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2' as binary) FROM t +-- !query 285 schema +struct<> +-- !query 285 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. binary <> date at the first column of the second table; + + +-- !query 286 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as boolean) FROM t +-- !query 286 schema +struct<> +-- !query 286 output +org.apache.spark.sql.AnalysisException +Except can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table; + + +-- !query 287 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 287 schema +struct +-- !query 287 output +2017-12-12 00:00:00 + + +-- !query 288 +SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 288 schema +struct +-- !query 288 output +2017-12-12 + + +-- !query 289 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 289 schema +struct +-- !query 289 output +1 + + +-- !query 290 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 290 schema +struct +-- !query 290 output +1 + + +-- !query 291 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 291 schema +struct +-- !query 291 output +1 + + +-- !query 292 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 292 schema +struct +-- !query 292 output +1 + + +-- !query 293 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 293 schema +struct +-- !query 293 output +1.0 + + +-- !query 294 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 294 schema +struct +-- !query 294 output +1.0 + + +-- !query 295 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 295 schema +struct +-- !query 295 output +1 + + +-- !query 296 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 296 schema +struct +-- !query 296 output +1 + + +-- !query 297 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 297 schema +struct<> +-- !query 297 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table; + + +-- !query 298 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 298 schema +struct<> +-- !query 298 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table; + + +-- !query 299 +SELECT cast(1 as tinyint) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table; + + +-- !query 300 +SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 300 schema +struct<> +-- !query 300 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table; + + +-- !query 301 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 301 schema +struct +-- !query 301 output +1 + + +-- !query 302 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 302 schema +struct +-- !query 302 output +1 + + +-- !query 303 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 303 schema +struct +-- !query 303 output +1 + + +-- !query 304 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 304 schema +struct +-- !query 304 output +1 + + +-- !query 305 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 305 schema +struct +-- !query 305 output +1.0 + + +-- !query 306 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 306 schema +struct +-- !query 306 output +1.0 + + +-- !query 307 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 307 schema +struct +-- !query 307 output +1 + + +-- !query 308 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 308 schema +struct +-- !query 308 output +1 + + +-- !query 309 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 309 schema +struct<> +-- !query 309 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table; + + +-- !query 310 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 310 schema +struct<> +-- !query 310 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table; + + +-- !query 311 +SELECT cast(1 as smallint) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table; + + +-- !query 312 +SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 312 schema +struct<> +-- !query 312 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table; + + +-- !query 313 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 313 schema +struct +-- !query 313 output +1 + + +-- !query 314 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 314 schema +struct +-- !query 314 output +1 + + +-- !query 315 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 315 schema +struct +-- !query 315 output +1 + + +-- !query 316 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 316 schema +struct +-- !query 316 output +1 + + +-- !query 317 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 317 schema +struct +-- !query 317 output +1.0 + + +-- !query 318 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 318 schema +struct +-- !query 318 output +1.0 + + +-- !query 319 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 319 schema +struct +-- !query 319 output +1 + + +-- !query 320 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 320 schema +struct +-- !query 320 output +1 + + +-- !query 321 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 321 schema +struct<> +-- !query 321 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> int at the first column of the second table; + + +-- !query 322 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 322 schema +struct<> +-- !query 322 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table; + + +-- !query 323 +SELECT cast(1 as int) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table; + + +-- !query 324 +SELECT cast(1 as int) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 324 schema +struct<> +-- !query 324 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> int at the first column of the second table; + + +-- !query 325 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 325 schema +struct +-- !query 325 output +1 + + +-- !query 326 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 326 schema +struct +-- !query 326 output +1 + + +-- !query 327 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 327 schema +struct +-- !query 327 output +1 + + +-- !query 328 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 328 schema +struct +-- !query 328 output +1 + + +-- !query 329 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 329 schema +struct +-- !query 329 output +1.0 + + +-- !query 330 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 330 schema +struct +-- !query 330 output +1.0 + + +-- !query 331 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 331 schema +struct +-- !query 331 output +1 + + +-- !query 332 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 332 schema +struct +-- !query 332 output +1 + + +-- !query 333 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 333 schema +struct<> +-- !query 333 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table; + + +-- !query 334 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 334 schema +struct<> +-- !query 334 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table; + + +-- !query 335 +SELECT cast(1 as bigint) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table; + + +-- !query 336 +SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 336 schema +struct<> +-- !query 336 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table; + + +-- !query 337 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 337 schema +struct +-- !query 337 output +1.0 + + +-- !query 338 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 338 schema +struct +-- !query 338 output +1.0 + + +-- !query 339 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 339 schema +struct +-- !query 339 output +1.0 + + +-- !query 340 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 340 schema +struct +-- !query 340 output +1.0 + + +-- !query 341 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 341 schema +struct +-- !query 341 output +1.0 + + +-- !query 342 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 342 schema +struct +-- !query 342 output +1.0 + + +-- !query 343 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 343 schema +struct +-- !query 343 output +1.0 + + +-- !query 344 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 344 schema +struct +-- !query 344 output + + + +-- !query 345 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 345 schema +struct<> +-- !query 345 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> float at the first column of the second table; + + +-- !query 346 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 346 schema +struct<> +-- !query 346 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table; + + +-- !query 347 +SELECT cast(1 as float) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table; + + +-- !query 348 +SELECT cast(1 as float) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 348 schema +struct<> +-- !query 348 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> float at the first column of the second table; + + +-- !query 349 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 349 schema +struct +-- !query 349 output +1.0 + + +-- !query 350 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 350 schema +struct +-- !query 350 output +1.0 + + +-- !query 351 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 351 schema +struct +-- !query 351 output +1.0 + + +-- !query 352 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 352 schema +struct +-- !query 352 output +1.0 + + +-- !query 353 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 353 schema +struct +-- !query 353 output +1.0 + + +-- !query 354 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 354 schema +struct +-- !query 354 output +1.0 + + +-- !query 355 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 355 schema +struct +-- !query 355 output +1.0 + + +-- !query 356 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 356 schema +struct +-- !query 356 output + + + +-- !query 357 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 357 schema +struct<> +-- !query 357 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> double at the first column of the second table; + + +-- !query 358 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 358 schema +struct<> +-- !query 358 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table; + + +-- !query 359 +SELECT cast(1 as double) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table; + + +-- !query 360 +SELECT cast(1 as double) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 360 schema +struct<> +-- !query 360 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> double at the first column of the second table; + + +-- !query 361 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 361 schema +struct +-- !query 361 output +1 + + +-- !query 362 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 362 schema +struct +-- !query 362 output +1 + + +-- !query 363 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 363 schema +struct +-- !query 363 output +1 + + +-- !query 364 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 364 schema +struct +-- !query 364 output +1 + + +-- !query 365 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 365 schema +struct +-- !query 365 output +1.0 + + +-- !query 366 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 366 schema +struct +-- !query 366 output +1.0 + + +-- !query 367 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 367 schema +struct +-- !query 367 output +1 + + +-- !query 368 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 368 schema +struct +-- !query 368 output +1 + + +-- !query 369 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 369 schema +struct<> +-- !query 369 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table; + + +-- !query 370 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 370 schema +struct<> +-- !query 370 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table; + + +-- !query 371 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table; + + +-- !query 372 +SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 372 schema +struct<> +-- !query 372 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table; + + +-- !query 373 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 373 schema +struct +-- !query 373 output +1 + + +-- !query 374 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 374 schema +struct +-- !query 374 output +1 + + +-- !query 375 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 375 schema +struct +-- !query 375 output +1 + + +-- !query 376 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 376 schema +struct +-- !query 376 output +1 + + +-- !query 377 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 377 schema +struct +-- !query 377 output + + + +-- !query 378 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 378 schema +struct +-- !query 378 output + + + +-- !query 379 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 379 schema +struct +-- !query 379 output +1 + + +-- !query 380 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 380 schema +struct +-- !query 380 output +1 + + +-- !query 381 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 381 schema +struct<> +-- !query 381 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> string at the first column of the second table; + + +-- !query 382 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 382 schema +struct<> +-- !query 382 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table; + + +-- !query 383 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 383 schema +struct +-- !query 383 output + + + +-- !query 384 +SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 384 schema +struct +-- !query 384 output + + + +-- !query 385 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 385 schema +struct<> +-- !query 385 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table; + + +-- !query 386 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 386 schema +struct<> +-- !query 386 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table; + + +-- !query 387 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 387 schema +struct<> +-- !query 387 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. int <> binary at the first column of the second table; + + +-- !query 388 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 388 schema +struct<> +-- !query 388 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table; + + +-- !query 389 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 389 schema +struct<> +-- !query 389 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. float <> binary at the first column of the second table; + + +-- !query 390 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 390 schema +struct<> +-- !query 390 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. double <> binary at the first column of the second table; + + +-- !query 391 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 391 schema +struct<> +-- !query 391 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table; + + +-- !query 392 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 392 schema +struct<> +-- !query 392 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. string <> binary at the first column of the second table; + + +-- !query 393 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 393 schema +struct +-- !query 393 output +1 + + +-- !query 394 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 394 schema +struct<> +-- !query 394 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table; + + +-- !query 395 +SELECT cast('1' as binary) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table; + + +-- !query 396 +SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 396 schema +struct<> +-- !query 396 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> binary at the first column of the second table; + + +-- !query 397 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 397 schema +struct<> +-- !query 397 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table; + + +-- !query 398 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 398 schema +struct<> +-- !query 398 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table; + + +-- !query 399 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 399 schema +struct<> +-- !query 399 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table; + + +-- !query 400 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 400 schema +struct<> +-- !query 400 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table; + + +-- !query 401 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 401 schema +struct<> +-- !query 401 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table; + + +-- !query 402 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 402 schema +struct<> +-- !query 402 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table; + + +-- !query 403 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 403 schema +struct<> +-- !query 403 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table; + + +-- !query 404 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 404 schema +struct<> +-- !query 404 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table; + + +-- !query 405 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 405 schema +struct<> +-- !query 405 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table; + + +-- !query 406 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 406 schema +struct +-- !query 406 output +true + + +-- !query 407 +SELECT cast(1 as boolean) FROM t INTERSECT 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 +Intersect can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table; + + +-- !query 408 +SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 408 schema +struct<> +-- !query 408 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table; + + +-- !query 409 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 409 schema +struct<> +-- !query 409 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table; + + +-- !query 410 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 410 schema +struct<> +-- !query 410 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table; + + +-- !query 411 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 411 schema +struct<> +-- !query 411 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table; + + +-- !query 412 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 412 schema +struct<> +-- !query 412 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table; + + +-- !query 413 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 413 schema +struct<> +-- !query 413 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table; + + +-- !query 414 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 414 schema +struct<> +-- !query 414 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table; + + +-- !query 415 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 415 schema +struct<> +-- !query 415 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table; + + +-- !query 416 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 416 schema +struct +-- !query 416 output + + + +-- !query 417 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 417 schema +struct<> +-- !query 417 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table; + + +-- !query 418 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 418 schema +struct<> +-- !query 418 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table; + + +-- !query 419 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 419 schema +struct +-- !query 419 output +2017-12-11 09:30:00 + + +-- !query 420 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 420 schema +struct +-- !query 420 output + + + +-- !query 421 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t +-- !query 421 schema +struct<> +-- !query 421 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table; + + +-- !query 422 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as smallint) FROM t +-- !query 422 schema +struct<> +-- !query 422 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table; + + +-- !query 423 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as int) FROM t +-- !query 423 schema +struct<> +-- !query 423 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. int <> date at the first column of the second table; + + +-- !query 424 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as bigint) FROM t +-- !query 424 schema +struct<> +-- !query 424 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table; + + +-- !query 425 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as float) FROM t +-- !query 425 schema +struct<> +-- !query 425 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. float <> date at the first column of the second table; + + +-- !query 426 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as double) FROM t +-- !query 426 schema +struct<> +-- !query 426 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. double <> date at the first column of the second table; + + +-- !query 427 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t +-- !query 427 schema +struct<> +-- !query 427 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table; + + +-- !query 428 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as string) FROM t +-- !query 428 schema +struct +-- !query 428 output + + + +-- !query 429 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('1' as binary) FROM t +-- !query 429 schema +struct<> +-- !query 429 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. binary <> date at the first column of the second table; + + +-- !query 430 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as boolean) FROM t +-- !query 430 schema +struct<> +-- !query 430 output +org.apache.spark.sql.AnalysisException +Intersect can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table; + + +-- !query 431 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 431 schema +struct +-- !query 431 output + + + +-- !query 432 +SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t +-- !query 432 schema +struct +-- !query 432 output +2017-12-11 From d4380bff3090940ba00eea1311d5ee41b9950228 Mon Sep 17 00:00:00 2001 From: Yuming Wang Date: Mon, 18 Dec 2017 16:57:10 +0800 Subject: [PATCH 2/3] add false = 0 --- .../typeCoercion/native/booleanEquality.sql | 60 ++- .../native/booleanEquality.sql.out | 406 +++++++++++++++++- 2 files changed, 457 insertions(+), 9 deletions(-) diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql index 726aa482c6c0a..442f2355f8e3a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/booleanEquality.sql @@ -26,7 +26,7 @@ SELECT true = cast(1 as double) FROM t; SELECT true = cast(1 as decimal(10, 0)) FROM t; SELECT true = cast(1 as string) FROM t; SELECT true = cast('1' as binary) FROM t; -SELECT true = cast('1' as boolean) FROM t; +SELECT true = cast(1 as boolean) FROM t; SELECT true = cast('2017-12-11 09:30:00.0' as timestamp) FROM t; SELECT true = cast('2017-12-11 09:30:00' as date) FROM t; @@ -39,7 +39,7 @@ SELECT true <=> cast(1 as double) FROM t; SELECT true <=> cast(1 as decimal(10, 0)) FROM t; SELECT true <=> cast(1 as string) FROM t; SELECT true <=> cast('1' as binary) FROM t; -SELECT true <=> cast('1' as boolean) FROM t; +SELECT true <=> cast(1 as boolean) FROM t; SELECT true <=> cast('2017-12-11 09:30:00.0' as timestamp) FROM t; SELECT true <=> cast('2017-12-11 09:30:00' as date) FROM t; @@ -52,7 +52,7 @@ SELECT cast(1 as double) = true FROM t; SELECT cast(1 as decimal(10, 0)) = true FROM t; SELECT cast(1 as string) = true FROM t; SELECT cast('1' as binary) = true FROM t; -SELECT cast('1' as boolean) = true FROM t; +SELECT cast(1 as boolean) = true FROM t; SELECT cast('2017-12-11 09:30:00.0' as timestamp) = true FROM t; SELECT cast('2017-12-11 09:30:00' as date) = true FROM t; @@ -65,6 +65,58 @@ SELECT cast(1 as double) <=> true FROM t; SELECT cast(1 as decimal(10, 0)) <=> true FROM t; SELECT cast(1 as string) <=> true FROM t; SELECT cast('1' as binary) <=> true FROM t; -SELECT cast('1' as boolean) <=> true FROM t; +SELECT cast(1 as boolean) <=> true FROM t; SELECT cast('2017-12-11 09:30:00.0' as timestamp) <=> true FROM t; SELECT cast('2017-12-11 09:30:00' as date) <=> true FROM t; + +SELECT false = cast(0 as tinyint) FROM t; +SELECT false = cast(0 as smallint) FROM t; +SELECT false = cast(0 as int) FROM t; +SELECT false = cast(0 as bigint) FROM t; +SELECT false = cast(0 as float) FROM t; +SELECT false = cast(0 as double) FROM t; +SELECT false = cast(0 as decimal(10, 0)) FROM t; +SELECT false = cast(0 as string) FROM t; +SELECT false = cast('0' as binary) FROM t; +SELECT false = cast(0 as boolean) FROM t; +SELECT false = cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT false = cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT false <=> cast(0 as tinyint) FROM t; +SELECT false <=> cast(0 as smallint) FROM t; +SELECT false <=> cast(0 as int) FROM t; +SELECT false <=> cast(0 as bigint) FROM t; +SELECT false <=> cast(0 as float) FROM t; +SELECT false <=> cast(0 as double) FROM t; +SELECT false <=> cast(0 as decimal(10, 0)) FROM t; +SELECT false <=> cast(0 as string) FROM t; +SELECT false <=> cast('0' as binary) FROM t; +SELECT false <=> cast(0 as boolean) FROM t; +SELECT false <=> cast('2017-12-11 09:30:00.0' as timestamp) FROM t; +SELECT false <=> cast('2017-12-11 09:30:00' as date) FROM t; + +SELECT cast(0 as tinyint) = false FROM t; +SELECT cast(0 as smallint) = false FROM t; +SELECT cast(0 as int) = false FROM t; +SELECT cast(0 as bigint) = false FROM t; +SELECT cast(0 as float) = false FROM t; +SELECT cast(0 as double) = false FROM t; +SELECT cast(0 as decimal(10, 0)) = false FROM t; +SELECT cast(0 as string) = false FROM t; +SELECT cast('0' as binary) = false FROM t; +SELECT cast(0 as boolean) = false FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) = false FROM t; +SELECT cast('2017-12-11 09:30:00' as date) = false FROM t; + +SELECT cast(0 as tinyint) <=> false FROM t; +SELECT cast(0 as smallint) <=> false FROM t; +SELECT cast(0 as int) <=> false FROM t; +SELECT cast(0 as bigint) <=> false FROM t; +SELECT cast(0 as float) <=> false FROM t; +SELECT cast(0 as double) <=> false FROM t; +SELECT cast(0 as decimal(10, 0)) <=> false FROM t; +SELECT cast(0 as string) <=> false FROM t; +SELECT cast('0' as binary) <=> false FROM t; +SELECT cast(0 as boolean) <=> false FROM t; +SELECT cast('2017-12-11 09:30:00.0' as timestamp) <=> false FROM t; +SELECT cast('2017-12-11 09:30:00' as date) <=> false FROM t; diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out index 3e2acafc3c8ce..46775d79ff4a2 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 49 +-- Number of queries: 97 -- !query 0 @@ -84,7 +84,7 @@ cannot resolve '(true = CAST('1' AS BINARY))' due to data type mismatch: differi -- !query 10 -SELECT true = cast('1' as boolean) FROM t +SELECT true = cast(1 as boolean) FROM t -- !query 10 schema struct<(true = CAST(1 AS BOOLEAN)):boolean> -- !query 10 output @@ -183,7 +183,7 @@ cannot resolve '(true <=> CAST('1' AS BINARY))' due to data type mismatch: diffe -- !query 22 -SELECT true <=> cast('1' as boolean) FROM t +SELECT true <=> cast(1 as boolean) FROM t -- !query 22 schema struct<(true <=> CAST(1 AS BOOLEAN)):boolean> -- !query 22 output @@ -282,7 +282,7 @@ cannot resolve '(CAST('1' AS BINARY) = true)' due to data type mismatch: differi -- !query 34 -SELECT cast('1' as boolean) = true FROM t +SELECT cast(1 as boolean) = true FROM t -- !query 34 schema struct<(CAST(1 AS BOOLEAN) = true):boolean> -- !query 34 output @@ -381,7 +381,7 @@ cannot resolve '(CAST('1' AS BINARY) <=> true)' due to data type mismatch: diffe -- !query 46 -SELECT cast('1' as boolean) <=> true FROM t +SELECT cast(1 as boolean) <=> true FROM t -- !query 46 schema struct<(CAST(1 AS BOOLEAN) <=> true):boolean> -- !query 46 output @@ -404,3 +404,399 @@ struct<> -- !query 48 output org.apache.spark.sql.AnalysisException cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) <=> true)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) <=> true)' (date and boolean).; line 1 pos 7 + + +-- !query 49 +SELECT false = cast(0 as tinyint) FROM t +-- !query 49 schema +struct<(CAST(false AS TINYINT) = CAST(0 AS TINYINT)):boolean> +-- !query 49 output +true + + +-- !query 50 +SELECT false = cast(0 as smallint) FROM t +-- !query 50 schema +struct<(CAST(false AS SMALLINT) = CAST(0 AS SMALLINT)):boolean> +-- !query 50 output +true + + +-- !query 51 +SELECT false = cast(0 as int) FROM t +-- !query 51 schema +struct<(CAST(false AS INT) = CAST(0 AS INT)):boolean> +-- !query 51 output +true + + +-- !query 52 +SELECT false = cast(0 as bigint) FROM t +-- !query 52 schema +struct<(CAST(false AS BIGINT) = CAST(0 AS BIGINT)):boolean> +-- !query 52 output +true + + +-- !query 53 +SELECT false = cast(0 as float) FROM t +-- !query 53 schema +struct<(CAST(false AS FLOAT) = CAST(0 AS FLOAT)):boolean> +-- !query 53 output +true + + +-- !query 54 +SELECT false = cast(0 as double) FROM t +-- !query 54 schema +struct<(CAST(false AS DOUBLE) = CAST(0 AS DOUBLE)):boolean> +-- !query 54 output +true + + +-- !query 55 +SELECT false = cast(0 as decimal(10, 0)) FROM t +-- !query 55 schema +struct<(CAST(false AS DECIMAL(10,0)) = CAST(0 AS DECIMAL(10,0))):boolean> +-- !query 55 output +true + + +-- !query 56 +SELECT false = cast(0 as string) FROM t +-- !query 56 schema +struct<(false = CAST(CAST(0 AS STRING) AS BOOLEAN)):boolean> +-- !query 56 output +true + + +-- !query 57 +SELECT false = cast('0' as binary) FROM t +-- !query 57 schema +struct<> +-- !query 57 output +org.apache.spark.sql.AnalysisException +cannot resolve '(false = CAST('0' AS BINARY))' due to data type mismatch: differing types in '(false = CAST('0' AS BINARY))' (boolean and binary).; line 1 pos 7 + + +-- !query 58 +SELECT false = cast(0 as boolean) FROM t +-- !query 58 schema +struct<(false = CAST(0 AS BOOLEAN)):boolean> +-- !query 58 output +true + + +-- !query 59 +SELECT false = cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 59 schema +struct<> +-- !query 59 output +org.apache.spark.sql.AnalysisException +cannot resolve '(false = CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(false = CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 + + +-- !query 60 +SELECT false = cast('2017-12-11 09:30:00' as date) FROM t +-- !query 60 schema +struct<> +-- !query 60 output +org.apache.spark.sql.AnalysisException +cannot resolve '(false = CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(false = CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 + + +-- !query 61 +SELECT false <=> cast(0 as tinyint) FROM t +-- !query 61 schema +struct<(CAST(false AS TINYINT) <=> CAST(0 AS TINYINT)):boolean> +-- !query 61 output +true + + +-- !query 62 +SELECT false <=> cast(0 as smallint) FROM t +-- !query 62 schema +struct<(CAST(false AS SMALLINT) <=> CAST(0 AS SMALLINT)):boolean> +-- !query 62 output +true + + +-- !query 63 +SELECT false <=> cast(0 as int) FROM t +-- !query 63 schema +struct<(CAST(false AS INT) <=> CAST(0 AS INT)):boolean> +-- !query 63 output +true + + +-- !query 64 +SELECT false <=> cast(0 as bigint) FROM t +-- !query 64 schema +struct<(CAST(false AS BIGINT) <=> CAST(0 AS BIGINT)):boolean> +-- !query 64 output +true + + +-- !query 65 +SELECT false <=> cast(0 as float) FROM t +-- !query 65 schema +struct<(CAST(false AS FLOAT) <=> CAST(0 AS FLOAT)):boolean> +-- !query 65 output +true + + +-- !query 66 +SELECT false <=> cast(0 as double) FROM t +-- !query 66 schema +struct<(CAST(false AS DOUBLE) <=> CAST(0 AS DOUBLE)):boolean> +-- !query 66 output +true + + +-- !query 67 +SELECT false <=> cast(0 as decimal(10, 0)) FROM t +-- !query 67 schema +struct<(CAST(false AS DECIMAL(10,0)) <=> CAST(0 AS DECIMAL(10,0))):boolean> +-- !query 67 output +true + + +-- !query 68 +SELECT false <=> cast(0 as string) FROM t +-- !query 68 schema +struct<(false <=> CAST(CAST(0 AS STRING) AS BOOLEAN)):boolean> +-- !query 68 output +true + + +-- !query 69 +SELECT false <=> cast('0' as binary) FROM t +-- !query 69 schema +struct<> +-- !query 69 output +org.apache.spark.sql.AnalysisException +cannot resolve '(false <=> CAST('0' AS BINARY))' due to data type mismatch: differing types in '(false <=> CAST('0' AS BINARY))' (boolean and binary).; line 1 pos 7 + + +-- !query 70 +SELECT false <=> cast(0 as boolean) FROM t +-- !query 70 schema +struct<(false <=> CAST(0 AS BOOLEAN)):boolean> +-- !query 70 output +true + + +-- !query 71 +SELECT false <=> cast('2017-12-11 09:30:00.0' as timestamp) FROM t +-- !query 71 schema +struct<> +-- !query 71 output +org.apache.spark.sql.AnalysisException +cannot resolve '(false <=> CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(false <=> CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 + + +-- !query 72 +SELECT false <=> cast('2017-12-11 09:30:00' as date) FROM t +-- !query 72 schema +struct<> +-- !query 72 output +org.apache.spark.sql.AnalysisException +cannot resolve '(false <=> CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(false <=> CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 + + +-- !query 73 +SELECT cast(0 as tinyint) = false FROM t +-- !query 73 schema +struct<(CAST(0 AS TINYINT) = CAST(false AS TINYINT)):boolean> +-- !query 73 output +true + + +-- !query 74 +SELECT cast(0 as smallint) = false FROM t +-- !query 74 schema +struct<(CAST(0 AS SMALLINT) = CAST(false AS SMALLINT)):boolean> +-- !query 74 output +true + + +-- !query 75 +SELECT cast(0 as int) = false FROM t +-- !query 75 schema +struct<(CAST(0 AS INT) = CAST(false AS INT)):boolean> +-- !query 75 output +true + + +-- !query 76 +SELECT cast(0 as bigint) = false FROM t +-- !query 76 schema +struct<(CAST(0 AS BIGINT) = CAST(false AS BIGINT)):boolean> +-- !query 76 output +true + + +-- !query 77 +SELECT cast(0 as float) = false FROM t +-- !query 77 schema +struct<(CAST(0 AS FLOAT) = CAST(false AS FLOAT)):boolean> +-- !query 77 output +true + + +-- !query 78 +SELECT cast(0 as double) = false FROM t +-- !query 78 schema +struct<(CAST(0 AS DOUBLE) = CAST(false AS DOUBLE)):boolean> +-- !query 78 output +true + + +-- !query 79 +SELECT cast(0 as decimal(10, 0)) = false FROM t +-- !query 79 schema +struct<(CAST(0 AS DECIMAL(10,0)) = CAST(false AS DECIMAL(10,0))):boolean> +-- !query 79 output +true + + +-- !query 80 +SELECT cast(0 as string) = false FROM t +-- !query 80 schema +struct<(CAST(CAST(0 AS STRING) AS BOOLEAN) = false):boolean> +-- !query 80 output +true + + +-- !query 81 +SELECT cast('0' as binary) = false FROM t +-- !query 81 schema +struct<> +-- !query 81 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('0' AS BINARY) = false)' due to data type mismatch: differing types in '(CAST('0' AS BINARY) = false)' (binary and boolean).; line 1 pos 7 + + +-- !query 82 +SELECT cast(0 as boolean) = false FROM t +-- !query 82 schema +struct<(CAST(0 AS BOOLEAN) = false):boolean> +-- !query 82 output +true + + +-- !query 83 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) = false FROM t +-- !query 83 schema +struct<> +-- !query 83 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) = false)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) = false)' (timestamp and boolean).; line 1 pos 7 + + +-- !query 84 +SELECT cast('2017-12-11 09:30:00' as date) = false FROM t +-- !query 84 schema +struct<> +-- !query 84 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) = false)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) = false)' (date and boolean).; line 1 pos 7 + + +-- !query 85 +SELECT cast(0 as tinyint) <=> false FROM t +-- !query 85 schema +struct<(CAST(0 AS TINYINT) <=> CAST(false AS TINYINT)):boolean> +-- !query 85 output +true + + +-- !query 86 +SELECT cast(0 as smallint) <=> false FROM t +-- !query 86 schema +struct<(CAST(0 AS SMALLINT) <=> CAST(false AS SMALLINT)):boolean> +-- !query 86 output +true + + +-- !query 87 +SELECT cast(0 as int) <=> false FROM t +-- !query 87 schema +struct<(CAST(0 AS INT) <=> CAST(false AS INT)):boolean> +-- !query 87 output +true + + +-- !query 88 +SELECT cast(0 as bigint) <=> false FROM t +-- !query 88 schema +struct<(CAST(0 AS BIGINT) <=> CAST(false AS BIGINT)):boolean> +-- !query 88 output +true + + +-- !query 89 +SELECT cast(0 as float) <=> false FROM t +-- !query 89 schema +struct<(CAST(0 AS FLOAT) <=> CAST(false AS FLOAT)):boolean> +-- !query 89 output +true + + +-- !query 90 +SELECT cast(0 as double) <=> false FROM t +-- !query 90 schema +struct<(CAST(0 AS DOUBLE) <=> CAST(false AS DOUBLE)):boolean> +-- !query 90 output +true + + +-- !query 91 +SELECT cast(0 as decimal(10, 0)) <=> false FROM t +-- !query 91 schema +struct<(CAST(0 AS DECIMAL(10,0)) <=> CAST(false AS DECIMAL(10,0))):boolean> +-- !query 91 output +true + + +-- !query 92 +SELECT cast(0 as string) <=> false FROM t +-- !query 92 schema +struct<(CAST(CAST(0 AS STRING) AS BOOLEAN) <=> false):boolean> +-- !query 92 output +true + + +-- !query 93 +SELECT cast('0' as binary) <=> false FROM t +-- !query 93 schema +struct<> +-- !query 93 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('0' AS BINARY) <=> false)' due to data type mismatch: differing types in '(CAST('0' AS BINARY) <=> false)' (binary and boolean).; line 1 pos 7 + + +-- !query 94 +SELECT cast(0 as boolean) <=> false FROM t +-- !query 94 schema +struct<(CAST(0 AS BOOLEAN) <=> false):boolean> +-- !query 94 output +true + + +-- !query 95 +SELECT cast('2017-12-11 09:30:00.0' as timestamp) <=> false FROM t +-- !query 95 schema +struct<> +-- !query 95 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) <=> false)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) <=> false)' (timestamp and boolean).; line 1 pos 7 + + +-- !query 96 +SELECT cast('2017-12-11 09:30:00' as date) <=> false FROM t +-- !query 96 schema +struct<> +-- !query 96 output +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) <=> false)' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) <=> false)' (date and boolean).; line 1 pos 7 From cce792d94f9ce2ea822bbb50aa272e98bf91bc51 Mon Sep 17 00:00:00 2001 From: Yuming Wang Date: Tue, 19 Dec 2017 16:50:50 +0800 Subject: [PATCH 3/3] Remove stackCoercion.sql, EXCEPT and INTERSECT. --- .../inputs/typeCoercion/native/division.sql | 13 - .../typeCoercion/native/stackCoercion.sql | 174 -- .../native/widenSetOperationTypes.sql | 314 --- .../typeCoercion/native/division.sql.out | 324 +-- .../typeCoercion/native/stackCoercion.sql.out | 1294 --------- .../native/widenSetOperationTypes.sql.out | 2446 +---------------- 6 files changed, 113 insertions(+), 4452 deletions(-) delete mode 100644 sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql delete mode 100644 sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql index 04b50a2ae232f..d669740ddd9ca 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/division.sql @@ -121,19 +121,6 @@ SELECT cast(1 as string) / cast(1 as boolean) FROM t; SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t; -SELECT cast(1 as string) / cast(1 as tinyint) FROM t; -SELECT cast(1 as string) / cast(1 as smallint) FROM t; -SELECT cast(1 as string) / cast(1 as int) FROM t; -SELECT cast(1 as string) / cast(1 as bigint) FROM t; -SELECT cast(1 as string) / cast(1 as float) FROM t; -SELECT cast(1 as string) / cast(1 as double) FROM t; -SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as string) / cast(1 as string) FROM t; -SELECT cast(1 as string) / cast('1' as binary) FROM t; -SELECT cast(1 as string) / cast(1 as boolean) FROM t; -SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t; - SELECT cast('1' as binary) / cast(1 as tinyint) FROM t; SELECT cast('1' as binary) / cast(1 as smallint) FROM t; SELECT cast('1' as binary) / cast(1 as int) FROM t; diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql deleted file mode 100644 index 09700b08b2e3e..0000000000000 --- a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/stackCoercion.sql +++ /dev/null @@ -1,174 +0,0 @@ --- --- Licensed to the Apache Software Foundation (ASF) under one or more --- contributor license agreements. See the NOTICE file distributed with --- this work for additional information regarding copyright ownership. --- The ASF licenses this file to You under the Apache License, Version 2.0 --- (the "License"); you may not use this file except in compliance with --- the License. You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - -CREATE TEMPORARY VIEW t AS SELECT 1; - -SELECT stack(cast(1 as tinyint), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as tinyint), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as tinyint), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as smallint), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as smallint), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as smallint), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as int), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as int), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as int), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as bigint), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as bigint), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as bigint), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as float), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as float), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as float), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as double), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as double), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as double), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as string), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as string), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as string), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast('1' as binary), cast(1 as tinyint), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as smallint), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as int), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as bigint), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as float), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as double), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as string), null) FROM t; -SELECT stack(cast('1' as binary), cast('1' as binary), null) FROM t; -SELECT stack(cast('1' as binary), cast(1 as boolean), null) FROM t; -SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast(1 as boolean), cast(1 as tinyint), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as smallint), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as int), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as bigint), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as float), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as double), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as string), null) FROM t; -SELECT stack(cast(1 as boolean), cast('1' as binary), null) FROM t; -SELECT stack(cast(1 as boolean), cast(1 as boolean), null) FROM t; -SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as tinyint), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as smallint), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as int), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as bigint), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as float), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as double), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as string), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('1' as binary), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as boolean), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00' as date), null) FROM t; - -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as tinyint), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as smallint), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as int), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as bigint), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as float), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as double), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as decimal(10, 0)), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as string), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast('1' as binary), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as boolean), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t; -SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00' as date), null) FROM t; diff --git a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql index bd6860e9e3a05..66e9689850d93 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/typeCoercion/native/widenSetOperationTypes.sql @@ -173,317 +173,3 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2' as binar SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as boolean) FROM t; SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FROM t; - --- EXCEPT -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as smallint) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as int) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as bigint) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as float) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as double) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as string) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2' as binary) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as boolean) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - --- INTERSECT -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as int) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as float) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as double) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; - -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as smallint) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as int) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as bigint) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as float) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as double) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as string) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('1' as binary) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as boolean) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t; -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t; diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out index 69c1d9a7a9b2e..017e0fea30e90 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 157 +-- Number of queries: 145 -- !query 0 @@ -811,532 +811,432 @@ cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' -- !query 97 -SELECT cast(1 as string) / cast(1 as tinyint) FROM t +SELECT cast('1' as binary) / cast(1 as tinyint) FROM t -- !query 97 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<> -- !query 97 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS TINYINT))' (binary and tinyint).; line 1 pos 7 -- !query 98 -SELECT cast(1 as string) / cast(1 as smallint) FROM t +SELECT cast('1' as binary) / cast(1 as smallint) FROM t -- !query 98 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<> -- !query 98 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS SMALLINT))' (binary and smallint).; line 1 pos 7 -- !query 99 -SELECT cast(1 as string) / cast(1 as int) FROM t +SELECT cast('1' as binary) / cast(1 as int) FROM t -- !query 99 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<> -- !query 99 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS INT))' (binary and int).; line 1 pos 7 -- !query 100 -SELECT cast(1 as string) / cast(1 as bigint) FROM t +SELECT cast('1' as binary) / cast(1 as bigint) FROM t -- !query 100 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<> -- !query 100 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS BIGINT))' (binary and bigint).; line 1 pos 7 -- !query 101 -SELECT cast(1 as string) / cast(1 as float) FROM t +SELECT cast('1' as binary) / cast(1 as float) FROM t -- !query 101 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<> -- !query 101 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS FLOAT))' (binary and float).; line 1 pos 7 -- !query 102 -SELECT cast(1 as string) / cast(1 as double) FROM t +SELECT cast('1' as binary) / cast(1 as double) FROM t -- !query 102 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<> -- !query 102 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS DOUBLE))' (binary and double).; line 1 pos 7 -- !query 103 -SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t +SELECT cast('1' as binary) / cast(1 as decimal(10, 0)) FROM t -- !query 103 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<> -- !query 103 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS DECIMAL(10,0)))' (binary and decimal(10,0)).; line 1 pos 7 -- !query 104 -SELECT cast(1 as string) / cast(1 as string) FROM t +SELECT cast('1' as binary) / cast(1 as string) FROM t -- !query 104 schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<> -- !query 104 output -1.0 +org.apache.spark.sql.AnalysisException +cannot resolve '(CAST('1' AS BINARY) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(CAST(1 AS STRING) AS DOUBLE))' (binary and double).; line 1 pos 7 -- !query 105 -SELECT cast(1 as string) / cast('1' as binary) FROM t +SELECT cast('1' as binary) / cast('1' as binary) FROM t -- !query 105 schema struct<> -- !query 105 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('1' AS BINARY))' (double and binary).; line 1 pos 7 +cannot resolve '(CAST('1' AS BINARY) / CAST('1' AS BINARY))' due to data type mismatch: '(CAST('1' AS BINARY) / CAST('1' AS BINARY))' requires (double or decimal) type, not binary; line 1 pos 7 -- !query 106 -SELECT cast(1 as string) / cast(1 as boolean) FROM t +SELECT cast('1' as binary) / cast(1 as boolean) FROM t -- !query 106 schema struct<> -- !query 106 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS BOOLEAN))' (double and boolean).; line 1 pos 7 +cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS BOOLEAN))' (binary and boolean).; line 1 pos 7 -- !query 107 -SELECT cast(1 as string) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +SELECT cast('1' as binary) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query 107 schema struct<> -- !query 107 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (double and timestamp).; line 1 pos 7 +cannot resolve '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (binary and timestamp).; line 1 pos 7 -- !query 108 -SELECT cast(1 as string) / cast('2017-12-11 09:30:00' as date) FROM t +SELECT cast('1' as binary) / cast('2017-12-11 09:30:00' as date) FROM t -- !query 108 schema struct<> -- !query 108 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' (double and date).; line 1 pos 7 +cannot resolve '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00' AS DATE))' (binary and date).; line 1 pos 7 -- !query 109 -SELECT cast('1' as binary) / cast(1 as tinyint) FROM t +SELECT cast(1 as boolean) / cast(1 as tinyint) FROM t -- !query 109 schema struct<> -- !query 109 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS TINYINT))' (binary and tinyint).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS TINYINT))' (boolean and tinyint).; line 1 pos 7 -- !query 110 -SELECT cast('1' as binary) / cast(1 as smallint) FROM t +SELECT cast(1 as boolean) / cast(1 as smallint) FROM t -- !query 110 schema struct<> -- !query 110 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS SMALLINT))' (binary and smallint).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS SMALLINT))' (boolean and smallint).; line 1 pos 7 -- !query 111 -SELECT cast('1' as binary) / cast(1 as int) FROM t +SELECT cast(1 as boolean) / cast(1 as int) FROM t -- !query 111 schema struct<> -- !query 111 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS INT))' (binary and int).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS INT))' (boolean and int).; line 1 pos 7 -- !query 112 -SELECT cast('1' as binary) / cast(1 as bigint) FROM t +SELECT cast(1 as boolean) / cast(1 as bigint) FROM t -- !query 112 schema struct<> -- !query 112 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS BIGINT))' (binary and bigint).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS BIGINT))' (boolean and bigint).; line 1 pos 7 -- !query 113 -SELECT cast('1' as binary) / cast(1 as float) FROM t +SELECT cast(1 as boolean) / cast(1 as float) FROM t -- !query 113 schema struct<> -- !query 113 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS FLOAT))' (binary and float).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS FLOAT))' (boolean and float).; line 1 pos 7 -- !query 114 -SELECT cast('1' as binary) / cast(1 as double) FROM t +SELECT cast(1 as boolean) / cast(1 as double) FROM t -- !query 114 schema struct<> -- !query 114 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS DOUBLE))' (binary and double).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS DOUBLE))' (boolean and double).; line 1 pos 7 -- !query 115 -SELECT cast('1' as binary) / cast(1 as decimal(10, 0)) FROM t +SELECT cast(1 as boolean) / cast(1 as decimal(10, 0)) FROM t -- !query 115 schema struct<> -- !query 115 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS DECIMAL(10,0)))' (binary and decimal(10,0)).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS DECIMAL(10,0)))' (boolean and decimal(10,0)).; line 1 pos 7 -- !query 116 -SELECT cast('1' as binary) / cast(1 as string) FROM t +SELECT cast(1 as boolean) / cast(1 as string) FROM t -- !query 116 schema struct<> -- !query 116 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(CAST(1 AS STRING) AS DOUBLE))' (binary and double).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(CAST(1 AS STRING) AS DOUBLE))' (boolean and double).; line 1 pos 7 -- !query 117 -SELECT cast('1' as binary) / cast('1' as binary) FROM t +SELECT cast(1 as boolean) / cast('1' as binary) FROM t -- !query 117 schema struct<> -- !query 117 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST('1' AS BINARY))' due to data type mismatch: '(CAST('1' AS BINARY) / CAST('1' AS BINARY))' requires (double or decimal) type, not binary; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('1' AS BINARY))' (boolean and binary).; line 1 pos 7 -- !query 118 -SELECT cast('1' as binary) / cast(1 as boolean) FROM t +SELECT cast(1 as boolean) / cast(1 as boolean) FROM t -- !query 118 schema struct<> -- !query 118 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST(1 AS BOOLEAN))' (binary and boolean).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS BOOLEAN))' due to data type mismatch: '(CAST(1 AS BOOLEAN) / CAST(1 AS BOOLEAN))' requires (double or decimal) type, not boolean; line 1 pos 7 -- !query 119 -SELECT cast('1' as binary) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query 119 schema struct<> -- !query 119 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (binary and timestamp).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 -- !query 120 -SELECT cast('1' as binary) / cast('2017-12-11 09:30:00' as date) FROM t +SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00' as date) FROM t -- !query 120 schema struct<> -- !query 120 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST('1' AS BINARY) / CAST('2017-12-11 09:30:00' AS DATE))' (binary and date).; line 1 pos 7 +cannot resolve '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 -- !query 121 -SELECT cast(1 as boolean) / cast(1 as tinyint) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as tinyint) FROM t -- !query 121 schema struct<> -- !query 121 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS TINYINT))' (boolean and tinyint).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS TINYINT))' (timestamp and tinyint).; line 1 pos 7 -- !query 122 -SELECT cast(1 as boolean) / cast(1 as smallint) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as smallint) FROM t -- !query 122 schema struct<> -- !query 122 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS SMALLINT))' (boolean and smallint).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS SMALLINT))' (timestamp and smallint).; line 1 pos 7 -- !query 123 -SELECT cast(1 as boolean) / cast(1 as int) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as int) FROM t -- !query 123 schema struct<> -- !query 123 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS INT))' (boolean and int).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS INT))' (timestamp and int).; line 1 pos 7 -- !query 124 -SELECT cast(1 as boolean) / cast(1 as bigint) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as bigint) FROM t -- !query 124 schema struct<> -- !query 124 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS BIGINT))' (boolean and bigint).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BIGINT))' (timestamp and bigint).; line 1 pos 7 -- !query 125 -SELECT cast(1 as boolean) / cast(1 as float) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as float) FROM t -- !query 125 schema struct<> -- !query 125 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS FLOAT))' (boolean and float).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS FLOAT))' (timestamp and float).; line 1 pos 7 -- !query 126 -SELECT cast(1 as boolean) / cast(1 as double) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as double) FROM t -- !query 126 schema struct<> -- !query 126 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS DOUBLE))' (boolean and double).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DOUBLE))' (timestamp and double).; line 1 pos 7 -- !query 127 -SELECT cast(1 as boolean) / cast(1 as decimal(10, 0)) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as decimal(10, 0)) FROM t -- !query 127 schema struct<> -- !query 127 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(1 AS DECIMAL(10,0)))' (boolean and decimal(10,0)).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DECIMAL(10,0)))' (timestamp and decimal(10,0)).; line 1 pos 7 -- !query 128 -SELECT cast(1 as boolean) / cast(1 as string) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as string) FROM t -- !query 128 schema struct<> -- !query 128 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST(CAST(1 AS STRING) AS DOUBLE))' (boolean and double).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(CAST(1 AS STRING) AS DOUBLE))' (timestamp and double).; line 1 pos 7 -- !query 129 -SELECT cast(1 as boolean) / cast('1' as binary) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('1' as binary) FROM t -- !query 129 schema struct<> -- !query 129 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('1' AS BINARY))' (boolean and binary).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('1' AS BINARY))' (timestamp and binary).; line 1 pos 7 -- !query 130 -SELECT cast(1 as boolean) / cast(1 as boolean) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as boolean) FROM t -- !query 130 schema struct<> -- !query 130 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST(1 AS BOOLEAN))' due to data type mismatch: '(CAST(1 AS BOOLEAN) / CAST(1 AS BOOLEAN))' requires (double or decimal) type, not boolean; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BOOLEAN))' (timestamp and boolean).; line 1 pos 7 -- !query 131 -SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query 131 schema struct<> -- !query 131 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (boolean and timestamp).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' requires (double or decimal) type, not timestamp; line 1 pos 7 -- !query 132 -SELECT cast(1 as boolean) / cast('2017-12-11 09:30:00' as date) FROM t +SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00' as date) FROM t -- !query 132 schema struct<> -- !query 132 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST(1 AS BOOLEAN) / CAST('2017-12-11 09:30:00' AS DATE))' (boolean and date).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00' AS DATE))' (timestamp and date).; line 1 pos 7 -- !query 133 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as tinyint) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as tinyint) FROM t -- !query 133 schema struct<> -- !query 133 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS TINYINT))' (timestamp and tinyint).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS TINYINT))' (date and tinyint).; line 1 pos 7 -- !query 134 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as smallint) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as smallint) FROM t -- !query 134 schema struct<> -- !query 134 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS SMALLINT))' (timestamp and smallint).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS SMALLINT))' (date and smallint).; line 1 pos 7 -- !query 135 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as int) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as int) FROM t -- !query 135 schema struct<> -- !query 135 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS INT))' (timestamp and int).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS INT))' (date and int).; line 1 pos 7 -- !query 136 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as bigint) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as bigint) FROM t -- !query 136 schema struct<> -- !query 136 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BIGINT))' (timestamp and bigint).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BIGINT))' (date and bigint).; line 1 pos 7 -- !query 137 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as float) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as float) FROM t -- !query 137 schema struct<> -- !query 137 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS FLOAT))' (timestamp and float).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS FLOAT))' (date and float).; line 1 pos 7 -- !query 138 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as double) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as double) FROM t -- !query 138 schema struct<> -- !query 138 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DOUBLE))' (timestamp and double).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DOUBLE))' (date and double).; line 1 pos 7 -- !query 139 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as decimal(10, 0)) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as decimal(10, 0)) FROM t -- !query 139 schema struct<> -- !query 139 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS DECIMAL(10,0)))' (timestamp and decimal(10,0)).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(10,0)))' (date and decimal(10,0)).; line 1 pos 7 -- !query 140 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as string) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as string) FROM t -- !query 140 schema struct<> -- !query 140 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(CAST(1 AS STRING) AS DOUBLE))' (timestamp and double).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(CAST(1 AS STRING) AS DOUBLE))' (date and double).; line 1 pos 7 -- !query 141 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('1' as binary) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast('1' as binary) FROM t -- !query 141 schema struct<> -- !query 141 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('1' AS BINARY))' (timestamp and binary).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS BINARY))' (date and binary).; line 1 pos 7 -- !query 142 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast(1 as boolean) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as boolean) FROM t -- !query 142 schema struct<> -- !query 142 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST(1 AS BOOLEAN))' (timestamp and boolean).; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BOOLEAN))' (date and boolean).; line 1 pos 7 -- !query 143 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query 143 schema struct<> -- !query 143 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' requires (double or decimal) type, not timestamp; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (date and timestamp).; line 1 pos 7 -- !query 144 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) / cast('2017-12-11 09:30:00' as date) FROM t +SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00' as date) FROM t -- !query 144 schema struct<> -- !query 144 output org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) / CAST('2017-12-11 09:30:00' AS DATE))' (timestamp and date).; line 1 pos 7 - - --- !query 145 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as tinyint) FROM t --- !query 145 schema -struct<> --- !query 145 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS TINYINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS TINYINT))' (date and tinyint).; line 1 pos 7 - - --- !query 146 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as smallint) FROM t --- !query 146 schema -struct<> --- !query 146 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS SMALLINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS SMALLINT))' (date and smallint).; line 1 pos 7 - - --- !query 147 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as int) FROM t --- !query 147 schema -struct<> --- !query 147 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS INT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS INT))' (date and int).; line 1 pos 7 - - --- !query 148 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as bigint) FROM t --- !query 148 schema -struct<> --- !query 148 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BIGINT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BIGINT))' (date and bigint).; line 1 pos 7 - - --- !query 149 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as float) FROM t --- !query 149 schema -struct<> --- !query 149 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS FLOAT))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS FLOAT))' (date and float).; line 1 pos 7 - - --- !query 150 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as double) FROM t --- !query 150 schema -struct<> --- !query 150 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DOUBLE))' (date and double).; line 1 pos 7 - - --- !query 151 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as decimal(10, 0)) FROM t --- !query 151 schema -struct<> --- !query 151 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(10,0)))' (date and decimal(10,0)).; line 1 pos 7 - - --- !query 152 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as string) FROM t --- !query 152 schema -struct<> --- !query 152 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(CAST(1 AS STRING) AS DOUBLE))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(CAST(1 AS STRING) AS DOUBLE))' (date and double).; line 1 pos 7 - - --- !query 153 -SELECT cast('2017-12-11 09:30:00' as date) / cast('1' as binary) FROM t --- !query 153 schema -struct<> --- !query 153 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS BINARY))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS BINARY))' (date and binary).; line 1 pos 7 - - --- !query 154 -SELECT cast('2017-12-11 09:30:00' as date) / cast(1 as boolean) FROM t --- !query 154 schema -struct<> --- !query 154 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BOOLEAN))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST(1 AS BOOLEAN))' (date and boolean).; line 1 pos 7 - - --- !query 155 -SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 155 schema -struct<> --- !query 155 output -org.apache.spark.sql.AnalysisException -cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: differing types in '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' (date and timestamp).; line 1 pos 7 - - --- !query 156 -SELECT cast('2017-12-11 09:30:00' as date) / cast('2017-12-11 09:30:00' as date) FROM t --- !query 156 schema -struct<> --- !query 156 output -org.apache.spark.sql.AnalysisException cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('2017-12-11 09:30:00' AS DATE))' requires (double or decimal) type, not date; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out deleted file mode 100644 index 99695aa2db6ca..0000000000000 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stackCoercion.sql.out +++ /dev/null @@ -1,1294 +0,0 @@ --- Automatically generated by SQLQueryTestSuite --- Number of queries: 145 - - --- !query 0 -CREATE TEMPORARY VIEW t AS SELECT 1 --- !query 0 schema -struct<> --- !query 0 output - - - --- !query 1 -SELECT stack(cast(1 as tinyint), cast(1 as tinyint), null) FROM t --- !query 1 schema -struct<> --- !query 1 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 2 -SELECT stack(cast(1 as tinyint), cast(1 as smallint), null) FROM t --- !query 2 schema -struct<> --- !query 2 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 3 -SELECT stack(cast(1 as tinyint), cast(1 as int), null) FROM t --- !query 3 schema -struct<> --- !query 3 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 4 -SELECT stack(cast(1 as tinyint), cast(1 as bigint), null) FROM t --- !query 4 schema -struct<> --- !query 4 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 5 -SELECT stack(cast(1 as tinyint), cast(1 as float), null) FROM t --- !query 5 schema -struct<> --- !query 5 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 6 -SELECT stack(cast(1 as tinyint), cast(1 as double), null) FROM t --- !query 6 schema -struct<> --- !query 6 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 7 -SELECT stack(cast(1 as tinyint), cast(1 as decimal(10, 0)), null) FROM t --- !query 7 schema -struct<> --- !query 7 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 8 -SELECT stack(cast(1 as tinyint), cast(1 as string), null) FROM t --- !query 8 schema -struct<> --- !query 8 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 9 -SELECT stack(cast(1 as tinyint), cast('1' as binary), null) FROM t --- !query 9 schema -struct<> --- !query 9 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 10 -SELECT stack(cast(1 as tinyint), cast(1 as boolean), null) FROM t --- !query 10 schema -struct<> --- !query 10 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 11 -SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 11 schema -struct<> --- !query 11 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 12 -SELECT stack(cast(1 as tinyint), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 12 schema -struct<> --- !query 12 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS TINYINT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 13 -SELECT stack(cast(1 as smallint), cast(1 as tinyint), null) FROM t --- !query 13 schema -struct<> --- !query 13 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 14 -SELECT stack(cast(1 as smallint), cast(1 as smallint), null) FROM t --- !query 14 schema -struct<> --- !query 14 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 15 -SELECT stack(cast(1 as smallint), cast(1 as int), null) FROM t --- !query 15 schema -struct<> --- !query 15 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 16 -SELECT stack(cast(1 as smallint), cast(1 as bigint), null) FROM t --- !query 16 schema -struct<> --- !query 16 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 17 -SELECT stack(cast(1 as smallint), cast(1 as float), null) FROM t --- !query 17 schema -struct<> --- !query 17 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 18 -SELECT stack(cast(1 as smallint), cast(1 as double), null) FROM t --- !query 18 schema -struct<> --- !query 18 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 19 -SELECT stack(cast(1 as smallint), cast(1 as decimal(10, 0)), null) FROM t --- !query 19 schema -struct<> --- !query 19 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 20 -SELECT stack(cast(1 as smallint), cast(1 as string), null) FROM t --- !query 20 schema -struct<> --- !query 20 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 21 -SELECT stack(cast(1 as smallint), cast('1' as binary), null) FROM t --- !query 21 schema -struct<> --- !query 21 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 22 -SELECT stack(cast(1 as smallint), cast(1 as boolean), null) FROM t --- !query 22 schema -struct<> --- !query 22 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 23 -SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 23 schema -struct<> --- !query 23 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 24 -SELECT stack(cast(1 as smallint), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 24 schema -struct<> --- !query 24 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS SMALLINT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 25 -SELECT stack(cast(1 as int), cast(1 as tinyint), null) FROM t --- !query 25 schema -struct --- !query 25 output -1 NULL - - --- !query 26 -SELECT stack(cast(1 as int), cast(1 as smallint), null) FROM t --- !query 26 schema -struct --- !query 26 output -1 NULL - - --- !query 27 -SELECT stack(cast(1 as int), cast(1 as int), null) FROM t --- !query 27 schema -struct --- !query 27 output -1 NULL - - --- !query 28 -SELECT stack(cast(1 as int), cast(1 as bigint), null) FROM t --- !query 28 schema -struct --- !query 28 output -1 NULL - - --- !query 29 -SELECT stack(cast(1 as int), cast(1 as float), null) FROM t --- !query 29 schema -struct --- !query 29 output -1.0 NULL - - --- !query 30 -SELECT stack(cast(1 as int), cast(1 as double), null) FROM t --- !query 30 schema -struct --- !query 30 output -1.0 NULL - - --- !query 31 -SELECT stack(cast(1 as int), cast(1 as decimal(10, 0)), null) FROM t --- !query 31 schema -struct --- !query 31 output -1 NULL - - --- !query 32 -SELECT stack(cast(1 as int), cast(1 as string), null) FROM t --- !query 32 schema -struct --- !query 32 output -1 NULL - - --- !query 33 -SELECT stack(cast(1 as int), cast('1' as binary), null) FROM t --- !query 33 schema -struct --- !query 33 output -1 NULL - - --- !query 34 -SELECT stack(cast(1 as int), cast(1 as boolean), null) FROM t --- !query 34 schema -struct --- !query 34 output -true NULL - - --- !query 35 -SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 35 schema -struct --- !query 35 output -2017-12-11 09:30:00 NULL - - --- !query 36 -SELECT stack(cast(1 as int), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 36 schema -struct --- !query 36 output -2017-12-11 NULL - - --- !query 37 -SELECT stack(cast(1 as bigint), cast(1 as tinyint), null) FROM t --- !query 37 schema -struct<> --- !query 37 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 38 -SELECT stack(cast(1 as bigint), cast(1 as smallint), null) FROM t --- !query 38 schema -struct<> --- !query 38 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 39 -SELECT stack(cast(1 as bigint), cast(1 as int), null) FROM t --- !query 39 schema -struct<> --- !query 39 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 40 -SELECT stack(cast(1 as bigint), cast(1 as bigint), null) FROM t --- !query 40 schema -struct<> --- !query 40 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 41 -SELECT stack(cast(1 as bigint), cast(1 as float), null) FROM t --- !query 41 schema -struct<> --- !query 41 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 42 -SELECT stack(cast(1 as bigint), cast(1 as double), null) FROM t --- !query 42 schema -struct<> --- !query 42 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 43 -SELECT stack(cast(1 as bigint), cast(1 as decimal(10, 0)), null) FROM t --- !query 43 schema -struct<> --- !query 43 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 44 -SELECT stack(cast(1 as bigint), cast(1 as string), null) FROM t --- !query 44 schema -struct<> --- !query 44 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 45 -SELECT stack(cast(1 as bigint), cast('1' as binary), null) FROM t --- !query 45 schema -struct<> --- !query 45 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 46 -SELECT stack(cast(1 as bigint), cast(1 as boolean), null) FROM t --- !query 46 schema -struct<> --- !query 46 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 47 -SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 47 schema -struct<> --- !query 47 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 48 -SELECT stack(cast(1 as bigint), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 48 schema -struct<> --- !query 48 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BIGINT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 49 -SELECT stack(cast(1 as float), cast(1 as tinyint), null) FROM t --- !query 49 schema -struct<> --- !query 49 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 50 -SELECT stack(cast(1 as float), cast(1 as smallint), null) FROM t --- !query 50 schema -struct<> --- !query 50 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 51 -SELECT stack(cast(1 as float), cast(1 as int), null) FROM t --- !query 51 schema -struct<> --- !query 51 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 52 -SELECT stack(cast(1 as float), cast(1 as bigint), null) FROM t --- !query 52 schema -struct<> --- !query 52 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 53 -SELECT stack(cast(1 as float), cast(1 as float), null) FROM t --- !query 53 schema -struct<> --- !query 53 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 54 -SELECT stack(cast(1 as float), cast(1 as double), null) FROM t --- !query 54 schema -struct<> --- !query 54 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 55 -SELECT stack(cast(1 as float), cast(1 as decimal(10, 0)), null) FROM t --- !query 55 schema -struct<> --- !query 55 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 56 -SELECT stack(cast(1 as float), cast(1 as string), null) FROM t --- !query 56 schema -struct<> --- !query 56 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 57 -SELECT stack(cast(1 as float), cast('1' as binary), null) FROM t --- !query 57 schema -struct<> --- !query 57 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 58 -SELECT stack(cast(1 as float), cast(1 as boolean), null) FROM t --- !query 58 schema -struct<> --- !query 58 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 59 -SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 59 schema -struct<> --- !query 59 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 60 -SELECT stack(cast(1 as float), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 60 schema -struct<> --- !query 60 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS FLOAT), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 61 -SELECT stack(cast(1 as double), cast(1 as tinyint), null) FROM t --- !query 61 schema -struct<> --- !query 61 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 62 -SELECT stack(cast(1 as double), cast(1 as smallint), null) FROM t --- !query 62 schema -struct<> --- !query 62 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 63 -SELECT stack(cast(1 as double), cast(1 as int), null) FROM t --- !query 63 schema -struct<> --- !query 63 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 64 -SELECT stack(cast(1 as double), cast(1 as bigint), null) FROM t --- !query 64 schema -struct<> --- !query 64 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 65 -SELECT stack(cast(1 as double), cast(1 as float), null) FROM t --- !query 65 schema -struct<> --- !query 65 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 66 -SELECT stack(cast(1 as double), cast(1 as double), null) FROM t --- !query 66 schema -struct<> --- !query 66 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 67 -SELECT stack(cast(1 as double), cast(1 as decimal(10, 0)), null) FROM t --- !query 67 schema -struct<> --- !query 67 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 68 -SELECT stack(cast(1 as double), cast(1 as string), null) FROM t --- !query 68 schema -struct<> --- !query 68 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 69 -SELECT stack(cast(1 as double), cast('1' as binary), null) FROM t --- !query 69 schema -struct<> --- !query 69 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 70 -SELECT stack(cast(1 as double), cast(1 as boolean), null) FROM t --- !query 70 schema -struct<> --- !query 70 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 71 -SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 71 schema -struct<> --- !query 71 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 72 -SELECT stack(cast(1 as double), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 72 schema -struct<> --- !query 72 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DOUBLE), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 73 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as tinyint), null) FROM t --- !query 73 schema -struct<> --- !query 73 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 74 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as smallint), null) FROM t --- !query 74 schema -struct<> --- !query 74 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 75 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as int), null) FROM t --- !query 75 schema -struct<> --- !query 75 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 76 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as bigint), null) FROM t --- !query 76 schema -struct<> --- !query 76 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 77 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as float), null) FROM t --- !query 77 schema -struct<> --- !query 77 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 78 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as double), null) FROM t --- !query 78 schema -struct<> --- !query 78 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 79 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as decimal(10, 0)), null) FROM t --- !query 79 schema -struct<> --- !query 79 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 80 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as string), null) FROM t --- !query 80 schema -struct<> --- !query 80 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 81 -SELECT stack(cast(1 as decimal(10, 0)), cast('1' as binary), null) FROM t --- !query 81 schema -struct<> --- !query 81 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 82 -SELECT stack(cast(1 as decimal(10, 0)), cast(1 as boolean), null) FROM t --- !query 82 schema -struct<> --- !query 82 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 83 -SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 83 schema -struct<> --- !query 83 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 84 -SELECT stack(cast(1 as decimal(10, 0)), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 84 schema -struct<> --- !query 84 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 85 -SELECT stack(cast(1 as string), cast(1 as tinyint), null) FROM t --- !query 85 schema -struct<> --- !query 85 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 86 -SELECT stack(cast(1 as string), cast(1 as smallint), null) FROM t --- !query 86 schema -struct<> --- !query 86 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 87 -SELECT stack(cast(1 as string), cast(1 as int), null) FROM t --- !query 87 schema -struct<> --- !query 87 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 88 -SELECT stack(cast(1 as string), cast(1 as bigint), null) FROM t --- !query 88 schema -struct<> --- !query 88 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 89 -SELECT stack(cast(1 as string), cast(1 as float), null) FROM t --- !query 89 schema -struct<> --- !query 89 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 90 -SELECT stack(cast(1 as string), cast(1 as double), null) FROM t --- !query 90 schema -struct<> --- !query 90 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 91 -SELECT stack(cast(1 as string), cast(1 as decimal(10, 0)), null) FROM t --- !query 91 schema -struct<> --- !query 91 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 92 -SELECT stack(cast(1 as string), cast(1 as string), null) FROM t --- !query 92 schema -struct<> --- !query 92 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 93 -SELECT stack(cast(1 as string), cast('1' as binary), null) FROM t --- !query 93 schema -struct<> --- !query 93 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 94 -SELECT stack(cast(1 as string), cast(1 as boolean), null) FROM t --- !query 94 schema -struct<> --- !query 94 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 95 -SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 95 schema -struct<> --- !query 95 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 96 -SELECT stack(cast(1 as string), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 96 schema -struct<> --- !query 96 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS STRING), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 97 -SELECT stack(cast('1' as binary), cast(1 as tinyint), null) FROM t --- !query 97 schema -struct<> --- !query 97 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 98 -SELECT stack(cast('1' as binary), cast(1 as smallint), null) FROM t --- !query 98 schema -struct<> --- !query 98 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 99 -SELECT stack(cast('1' as binary), cast(1 as int), null) FROM t --- !query 99 schema -struct<> --- !query 99 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 100 -SELECT stack(cast('1' as binary), cast(1 as bigint), null) FROM t --- !query 100 schema -struct<> --- !query 100 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 101 -SELECT stack(cast('1' as binary), cast(1 as float), null) FROM t --- !query 101 schema -struct<> --- !query 101 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 102 -SELECT stack(cast('1' as binary), cast(1 as double), null) FROM t --- !query 102 schema -struct<> --- !query 102 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 103 -SELECT stack(cast('1' as binary), cast(1 as decimal(10, 0)), null) FROM t --- !query 103 schema -struct<> --- !query 103 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 104 -SELECT stack(cast('1' as binary), cast(1 as string), null) FROM t --- !query 104 schema -struct<> --- !query 104 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 105 -SELECT stack(cast('1' as binary), cast('1' as binary), null) FROM t --- !query 105 schema -struct<> --- !query 105 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 106 -SELECT stack(cast('1' as binary), cast(1 as boolean), null) FROM t --- !query 106 schema -struct<> --- !query 106 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 107 -SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 107 schema -struct<> --- !query 107 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 108 -SELECT stack(cast('1' as binary), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 108 schema -struct<> --- !query 108 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('1' AS BINARY), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 109 -SELECT stack(cast(1 as boolean), cast(1 as tinyint), null) FROM t --- !query 109 schema -struct<> --- !query 109 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 110 -SELECT stack(cast(1 as boolean), cast(1 as smallint), null) FROM t --- !query 110 schema -struct<> --- !query 110 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 111 -SELECT stack(cast(1 as boolean), cast(1 as int), null) FROM t --- !query 111 schema -struct<> --- !query 111 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 112 -SELECT stack(cast(1 as boolean), cast(1 as bigint), null) FROM t --- !query 112 schema -struct<> --- !query 112 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 113 -SELECT stack(cast(1 as boolean), cast(1 as float), null) FROM t --- !query 113 schema -struct<> --- !query 113 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 114 -SELECT stack(cast(1 as boolean), cast(1 as double), null) FROM t --- !query 114 schema -struct<> --- !query 114 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 115 -SELECT stack(cast(1 as boolean), cast(1 as decimal(10, 0)), null) FROM t --- !query 115 schema -struct<> --- !query 115 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 116 -SELECT stack(cast(1 as boolean), cast(1 as string), null) FROM t --- !query 116 schema -struct<> --- !query 116 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 117 -SELECT stack(cast(1 as boolean), cast('1' as binary), null) FROM t --- !query 117 schema -struct<> --- !query 117 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 118 -SELECT stack(cast(1 as boolean), cast(1 as boolean), null) FROM t --- !query 118 schema -struct<> --- !query 118 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 119 -SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 119 schema -struct<> --- !query 119 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 120 -SELECT stack(cast(1 as boolean), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 120 schema -struct<> --- !query 120 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST(1 AS BOOLEAN), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 121 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as tinyint), null) FROM t --- !query 121 schema -struct<> --- !query 121 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 122 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as smallint), null) FROM t --- !query 122 schema -struct<> --- !query 122 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 123 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as int), null) FROM t --- !query 123 schema -struct<> --- !query 123 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 124 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as bigint), null) FROM t --- !query 124 schema -struct<> --- !query 124 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 125 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as float), null) FROM t --- !query 125 schema -struct<> --- !query 125 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 126 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as double), null) FROM t --- !query 126 schema -struct<> --- !query 126 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 127 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as decimal(10, 0)), null) FROM t --- !query 127 schema -struct<> --- !query 127 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 128 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as string), null) FROM t --- !query 128 schema -struct<> --- !query 128 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 129 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('1' as binary), null) FROM t --- !query 129 schema -struct<> --- !query 129 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 130 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast(1 as boolean), null) FROM t --- !query 130 schema -struct<> --- !query 130 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 131 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 131 schema -struct<> --- !query 131 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 132 -SELECT stack(cast('2017-12-11 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 132 schema -struct<> --- !query 132 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 133 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as tinyint), null) FROM t --- !query 133 schema -struct<> --- !query 133 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS TINYINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 134 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as smallint), null) FROM t --- !query 134 schema -struct<> --- !query 134 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS SMALLINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 135 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as int), null) FROM t --- !query 135 schema -struct<> --- !query 135 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS INT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 136 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as bigint), null) FROM t --- !query 136 schema -struct<> --- !query 136 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS BIGINT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 137 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as float), null) FROM t --- !query 137 schema -struct<> --- !query 137 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS FLOAT), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 138 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as double), null) FROM t --- !query 138 schema -struct<> --- !query 138 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DOUBLE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 139 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as decimal(10, 0)), null) FROM t --- !query 139 schema -struct<> --- !query 139 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DECIMAL(10,0)), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 140 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as string), null) FROM t --- !query 140 schema -struct<> --- !query 140 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS STRING), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 141 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast('1' as binary), null) FROM t --- !query 141 schema -struct<> --- !query 141 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST('1' AS BINARY), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 142 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast(1 as boolean), null) FROM t --- !query 142 schema -struct<> --- !query 142 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS BOOLEAN), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 143 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp), null) FROM t --- !query 143 schema -struct<> --- !query 143 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 - - --- !query 144 -SELECT stack(cast('2017-12-11 09:30:00' as date), cast('2017-12-11 09:30:00' as date), null) FROM t --- !query 144 schema -struct<> --- !query 144 output -org.apache.spark.sql.AnalysisException -cannot resolve 'stack(CAST('2017-12-11 09:30:00' AS DATE), CAST('2017-12-11 09:30:00' AS DATE), NULL)' due to data type mismatch: The number of rows must be a positive constant integer.; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out index a0933da1d8a28..20a9e47217238 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 433 +-- Number of queries: 145 -- !query 0 @@ -1303,2447 +1303,3 @@ struct -- !query 144 output 2017-12-11 2017-12-12 - - --- !query 145 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 145 schema -struct --- !query 145 output -1 - - --- !query 146 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 146 schema -struct --- !query 146 output -1 - - --- !query 147 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 147 schema -struct --- !query 147 output -1 - - --- !query 148 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 148 schema -struct --- !query 148 output -1 - - --- !query 149 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 149 schema -struct --- !query 149 output -1.0 - - --- !query 150 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 150 schema -struct --- !query 150 output -1.0 - - --- !query 151 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 151 schema -struct --- !query 151 output -1 - - --- !query 152 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 152 schema -struct --- !query 152 output -1 - - --- !query 153 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 153 schema -struct<> --- !query 153 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table; - - --- !query 154 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 154 schema -struct<> --- !query 154 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table; - - --- !query 155 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 155 schema -struct<> --- !query 155 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table; - - --- !query 156 -SELECT cast(1 as tinyint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 156 schema -struct<> --- !query 156 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table; - - --- !query 157 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 157 schema -struct --- !query 157 output -1 - - --- !query 158 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 158 schema -struct --- !query 158 output -1 - - --- !query 159 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 159 schema -struct --- !query 159 output -1 - - --- !query 160 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 160 schema -struct --- !query 160 output -1 - - --- !query 161 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 161 schema -struct --- !query 161 output -1.0 - - --- !query 162 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 162 schema -struct --- !query 162 output -1.0 - - --- !query 163 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 163 schema -struct --- !query 163 output -1 - - --- !query 164 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 164 schema -struct --- !query 164 output -1 - - --- !query 165 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 165 schema -struct<> --- !query 165 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table; - - --- !query 166 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 166 schema -struct<> --- !query 166 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table; - - --- !query 167 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 167 schema -struct<> --- !query 167 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table; - - --- !query 168 -SELECT cast(1 as smallint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 168 schema -struct<> --- !query 168 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table; - - --- !query 169 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 169 schema -struct --- !query 169 output -1 - - --- !query 170 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 170 schema -struct --- !query 170 output -1 - - --- !query 171 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 171 schema -struct --- !query 171 output -1 - - --- !query 172 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 172 schema -struct --- !query 172 output -1 - - --- !query 173 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 173 schema -struct --- !query 173 output -1.0 - - --- !query 174 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 174 schema -struct --- !query 174 output -1.0 - - --- !query 175 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 175 schema -struct --- !query 175 output -1 - - --- !query 176 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 176 schema -struct --- !query 176 output -1 - - --- !query 177 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 177 schema -struct<> --- !query 177 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> int at the first column of the second table; - - --- !query 178 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 178 schema -struct<> --- !query 178 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table; - - --- !query 179 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 179 schema -struct<> --- !query 179 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table; - - --- !query 180 -SELECT cast(1 as int) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 180 schema -struct<> --- !query 180 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> int at the first column of the second table; - - --- !query 181 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 181 schema -struct --- !query 181 output -1 - - --- !query 182 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 182 schema -struct --- !query 182 output -1 - - --- !query 183 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 183 schema -struct --- !query 183 output -1 - - --- !query 184 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 184 schema -struct --- !query 184 output -1 - - --- !query 185 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 185 schema -struct --- !query 185 output -1.0 - - --- !query 186 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 186 schema -struct --- !query 186 output -1.0 - - --- !query 187 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 187 schema -struct --- !query 187 output -1 - - --- !query 188 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 188 schema -struct --- !query 188 output -1 - - --- !query 189 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 189 schema -struct<> --- !query 189 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table; - - --- !query 190 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 190 schema -struct<> --- !query 190 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table; - - --- !query 191 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 191 schema -struct<> --- !query 191 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table; - - --- !query 192 -SELECT cast(1 as bigint) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 192 schema -struct<> --- !query 192 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table; - - --- !query 193 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 193 schema -struct --- !query 193 output -1.0 - - --- !query 194 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 194 schema -struct --- !query 194 output -1.0 - - --- !query 195 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 195 schema -struct --- !query 195 output -1.0 - - --- !query 196 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 196 schema -struct --- !query 196 output -1.0 - - --- !query 197 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 197 schema -struct --- !query 197 output -1.0 - - --- !query 198 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 198 schema -struct --- !query 198 output -1.0 - - --- !query 199 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 199 schema -struct --- !query 199 output -1.0 - - --- !query 200 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 200 schema -struct --- !query 200 output -1.0 - - --- !query 201 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 201 schema -struct<> --- !query 201 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> float at the first column of the second table; - - --- !query 202 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 202 schema -struct<> --- !query 202 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table; - - --- !query 203 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 203 schema -struct<> --- !query 203 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table; - - --- !query 204 -SELECT cast(1 as float) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 204 schema -struct<> --- !query 204 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> float at the first column of the second table; - - --- !query 205 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 205 schema -struct --- !query 205 output -1.0 - - --- !query 206 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 206 schema -struct --- !query 206 output -1.0 - - --- !query 207 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 207 schema -struct --- !query 207 output -1.0 - - --- !query 208 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 208 schema -struct --- !query 208 output -1.0 - - --- !query 209 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 209 schema -struct --- !query 209 output -1.0 - - --- !query 210 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 210 schema -struct --- !query 210 output -1.0 - - --- !query 211 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 211 schema -struct --- !query 211 output -1.0 - - --- !query 212 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 212 schema -struct --- !query 212 output -1.0 - - --- !query 213 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 213 schema -struct<> --- !query 213 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> double at the first column of the second table; - - --- !query 214 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 214 schema -struct<> --- !query 214 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table; - - --- !query 215 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 215 schema -struct<> --- !query 215 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table; - - --- !query 216 -SELECT cast(1 as double) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 216 schema -struct<> --- !query 216 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> double at the first column of the second table; - - --- !query 217 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 217 schema -struct --- !query 217 output -1 - - --- !query 218 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 218 schema -struct --- !query 218 output -1 - - --- !query 219 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 219 schema -struct --- !query 219 output -1 - - --- !query 220 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 220 schema -struct --- !query 220 output -1 - - --- !query 221 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 221 schema -struct --- !query 221 output -1.0 - - --- !query 222 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 222 schema -struct --- !query 222 output -1.0 - - --- !query 223 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 223 schema -struct --- !query 223 output -1 - - --- !query 224 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 224 schema -struct --- !query 224 output -1 - - --- !query 225 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 225 schema -struct<> --- !query 225 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table; - - --- !query 226 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 226 schema -struct<> --- !query 226 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table; - - --- !query 227 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 227 schema -struct<> --- !query 227 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table; - - --- !query 228 -SELECT cast(1 as decimal(10, 0)) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 228 schema -struct<> --- !query 228 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table; - - --- !query 229 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 229 schema -struct --- !query 229 output -1 - - --- !query 230 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 230 schema -struct --- !query 230 output -1 - - --- !query 231 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 231 schema -struct --- !query 231 output -1 - - --- !query 232 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 232 schema -struct --- !query 232 output -1 - - --- !query 233 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 233 schema -struct --- !query 233 output -1 - - --- !query 234 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 234 schema -struct --- !query 234 output -1 - - --- !query 235 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 235 schema -struct --- !query 235 output -1 - - --- !query 236 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 236 schema -struct --- !query 236 output -1 - - --- !query 237 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 237 schema -struct<> --- !query 237 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> string at the first column of the second table; - - --- !query 238 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 238 schema -struct<> --- !query 238 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table; - - --- !query 239 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 239 schema -struct --- !query 239 output -1 - - --- !query 240 -SELECT cast(1 as string) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 240 schema -struct --- !query 240 output -1 - - --- !query 241 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 241 schema -struct<> --- !query 241 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table; - - --- !query 242 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 242 schema -struct<> --- !query 242 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table; - - --- !query 243 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 243 schema -struct<> --- !query 243 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. int <> binary at the first column of the second table; - - --- !query 244 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 244 schema -struct<> --- !query 244 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table; - - --- !query 245 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 245 schema -struct<> --- !query 245 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. float <> binary at the first column of the second table; - - --- !query 246 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 246 schema -struct<> --- !query 246 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. double <> binary at the first column of the second table; - - --- !query 247 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 247 schema -struct<> --- !query 247 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table; - - --- !query 248 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 248 schema -struct<> --- !query 248 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. string <> binary at the first column of the second table; - - --- !query 249 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 249 schema -struct --- !query 249 output -1 - - --- !query 250 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 250 schema -struct<> --- !query 250 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table; - - --- !query 251 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 251 schema -struct<> --- !query 251 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table; - - --- !query 252 -SELECT cast('1' as binary) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 252 schema -struct<> --- !query 252 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> binary at the first column of the second table; - - --- !query 253 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 253 schema -struct<> --- !query 253 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table; - - --- !query 254 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 254 schema -struct<> --- !query 254 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table; - - --- !query 255 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 255 schema -struct<> --- !query 255 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table; - - --- !query 256 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 256 schema -struct<> --- !query 256 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table; - - --- !query 257 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 257 schema -struct<> --- !query 257 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table; - - --- !query 258 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 258 schema -struct<> --- !query 258 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table; - - --- !query 259 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 259 schema -struct<> --- !query 259 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table; - - --- !query 260 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 260 schema -struct<> --- !query 260 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table; - - --- !query 261 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 261 schema -struct<> --- !query 261 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table; - - --- !query 262 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 262 schema -struct --- !query 262 output - - - --- !query 263 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 263 schema -struct<> --- !query 263 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table; - - --- !query 264 -SELECT cast(1 as boolean) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 264 schema -struct<> --- !query 264 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table; - - --- !query 265 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 265 schema -struct<> --- !query 265 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table; - - --- !query 266 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 266 schema -struct<> --- !query 266 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table; - - --- !query 267 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 267 schema -struct<> --- !query 267 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table; - - --- !query 268 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 268 schema -struct<> --- !query 268 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table; - - --- !query 269 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 269 schema -struct<> --- !query 269 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table; - - --- !query 270 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 270 schema -struct<> --- !query 270 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table; - - --- !query 271 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 271 schema -struct<> --- !query 271 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table; - - --- !query 272 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 272 schema -struct --- !query 272 output -2017-12-12 09:30:00 - - --- !query 273 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 273 schema -struct<> --- !query 273 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table; - - --- !query 274 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 274 schema -struct<> --- !query 274 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table; - - --- !query 275 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 275 schema -struct --- !query 275 output -2017-12-12 09:30:00 - - --- !query 276 -SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 276 schema -struct --- !query 276 output -2017-12-12 09:30:00 - - --- !query 277 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as tinyint) FROM t --- !query 277 schema -struct<> --- !query 277 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table; - - --- !query 278 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as smallint) FROM t --- !query 278 schema -struct<> --- !query 278 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table; - - --- !query 279 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as int) FROM t --- !query 279 schema -struct<> --- !query 279 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. int <> date at the first column of the second table; - - --- !query 280 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as bigint) FROM t --- !query 280 schema -struct<> --- !query 280 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table; - - --- !query 281 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as float) FROM t --- !query 281 schema -struct<> --- !query 281 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. float <> date at the first column of the second table; - - --- !query 282 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as double) FROM t --- !query 282 schema -struct<> --- !query 282 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. double <> date at the first column of the second table; - - --- !query 283 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as decimal(10, 0)) FROM t --- !query 283 schema -struct<> --- !query 283 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table; - - --- !query 284 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as string) FROM t --- !query 284 schema -struct --- !query 284 output -2017-12-12 - - --- !query 285 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2' as binary) FROM t --- !query 285 schema -struct<> --- !query 285 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. binary <> date at the first column of the second table; - - --- !query 286 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast(2 as boolean) FROM t --- !query 286 schema -struct<> --- !query 286 output -org.apache.spark.sql.AnalysisException -Except can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table; - - --- !query 287 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 287 schema -struct --- !query 287 output -2017-12-12 00:00:00 - - --- !query 288 -SELECT cast('2017-12-12 09:30:00' as date) FROM t EXCEPT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 288 schema -struct --- !query 288 output -2017-12-12 - - --- !query 289 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 289 schema -struct --- !query 289 output -1 - - --- !query 290 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 290 schema -struct --- !query 290 output -1 - - --- !query 291 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 291 schema -struct --- !query 291 output -1 - - --- !query 292 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 292 schema -struct --- !query 292 output -1 - - --- !query 293 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 293 schema -struct --- !query 293 output -1.0 - - --- !query 294 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 294 schema -struct --- !query 294 output -1.0 - - --- !query 295 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 295 schema -struct --- !query 295 output -1 - - --- !query 296 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 296 schema -struct --- !query 296 output -1 - - --- !query 297 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 297 schema -struct<> --- !query 297 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table; - - --- !query 298 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 298 schema -struct<> --- !query 298 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table; - - --- !query 299 -SELECT cast(1 as tinyint) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table; - - --- !query 300 -SELECT cast(1 as tinyint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 300 schema -struct<> --- !query 300 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table; - - --- !query 301 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 301 schema -struct --- !query 301 output -1 - - --- !query 302 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 302 schema -struct --- !query 302 output -1 - - --- !query 303 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 303 schema -struct --- !query 303 output -1 - - --- !query 304 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 304 schema -struct --- !query 304 output -1 - - --- !query 305 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 305 schema -struct --- !query 305 output -1.0 - - --- !query 306 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 306 schema -struct --- !query 306 output -1.0 - - --- !query 307 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 307 schema -struct --- !query 307 output -1 - - --- !query 308 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 308 schema -struct --- !query 308 output -1 - - --- !query 309 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 309 schema -struct<> --- !query 309 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table; - - --- !query 310 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 310 schema -struct<> --- !query 310 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table; - - --- !query 311 -SELECT cast(1 as smallint) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table; - - --- !query 312 -SELECT cast(1 as smallint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 312 schema -struct<> --- !query 312 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table; - - --- !query 313 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 313 schema -struct --- !query 313 output -1 - - --- !query 314 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 314 schema -struct --- !query 314 output -1 - - --- !query 315 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 315 schema -struct --- !query 315 output -1 - - --- !query 316 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 316 schema -struct --- !query 316 output -1 - - --- !query 317 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 317 schema -struct --- !query 317 output -1.0 - - --- !query 318 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 318 schema -struct --- !query 318 output -1.0 - - --- !query 319 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 319 schema -struct --- !query 319 output -1 - - --- !query 320 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 320 schema -struct --- !query 320 output -1 - - --- !query 321 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 321 schema -struct<> --- !query 321 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> int at the first column of the second table; - - --- !query 322 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 322 schema -struct<> --- !query 322 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table; - - --- !query 323 -SELECT cast(1 as int) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table; - - --- !query 324 -SELECT cast(1 as int) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 324 schema -struct<> --- !query 324 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> int at the first column of the second table; - - --- !query 325 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 325 schema -struct --- !query 325 output -1 - - --- !query 326 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 326 schema -struct --- !query 326 output -1 - - --- !query 327 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 327 schema -struct --- !query 327 output -1 - - --- !query 328 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 328 schema -struct --- !query 328 output -1 - - --- !query 329 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 329 schema -struct --- !query 329 output -1.0 - - --- !query 330 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 330 schema -struct --- !query 330 output -1.0 - - --- !query 331 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 331 schema -struct --- !query 331 output -1 - - --- !query 332 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 332 schema -struct --- !query 332 output -1 - - --- !query 333 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 333 schema -struct<> --- !query 333 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table; - - --- !query 334 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 334 schema -struct<> --- !query 334 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table; - - --- !query 335 -SELECT cast(1 as bigint) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table; - - --- !query 336 -SELECT cast(1 as bigint) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 336 schema -struct<> --- !query 336 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table; - - --- !query 337 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 337 schema -struct --- !query 337 output -1.0 - - --- !query 338 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 338 schema -struct --- !query 338 output -1.0 - - --- !query 339 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 339 schema -struct --- !query 339 output -1.0 - - --- !query 340 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 340 schema -struct --- !query 340 output -1.0 - - --- !query 341 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 341 schema -struct --- !query 341 output -1.0 - - --- !query 342 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 342 schema -struct --- !query 342 output -1.0 - - --- !query 343 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 343 schema -struct --- !query 343 output -1.0 - - --- !query 344 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 344 schema -struct --- !query 344 output - - - --- !query 345 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 345 schema -struct<> --- !query 345 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> float at the first column of the second table; - - --- !query 346 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 346 schema -struct<> --- !query 346 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table; - - --- !query 347 -SELECT cast(1 as float) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table; - - --- !query 348 -SELECT cast(1 as float) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 348 schema -struct<> --- !query 348 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> float at the first column of the second table; - - --- !query 349 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 349 schema -struct --- !query 349 output -1.0 - - --- !query 350 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 350 schema -struct --- !query 350 output -1.0 - - --- !query 351 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 351 schema -struct --- !query 351 output -1.0 - - --- !query 352 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 352 schema -struct --- !query 352 output -1.0 - - --- !query 353 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 353 schema -struct --- !query 353 output -1.0 - - --- !query 354 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 354 schema -struct --- !query 354 output -1.0 - - --- !query 355 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 355 schema -struct --- !query 355 output -1.0 - - --- !query 356 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 356 schema -struct --- !query 356 output - - - --- !query 357 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 357 schema -struct<> --- !query 357 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> double at the first column of the second table; - - --- !query 358 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 358 schema -struct<> --- !query 358 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table; - - --- !query 359 -SELECT cast(1 as double) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table; - - --- !query 360 -SELECT cast(1 as double) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 360 schema -struct<> --- !query 360 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> double at the first column of the second table; - - --- !query 361 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 361 schema -struct --- !query 361 output -1 - - --- !query 362 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 362 schema -struct --- !query 362 output -1 - - --- !query 363 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 363 schema -struct --- !query 363 output -1 - - --- !query 364 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 364 schema -struct --- !query 364 output -1 - - --- !query 365 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 365 schema -struct --- !query 365 output -1.0 - - --- !query 366 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 366 schema -struct --- !query 366 output -1.0 - - --- !query 367 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 367 schema -struct --- !query 367 output -1 - - --- !query 368 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 368 schema -struct --- !query 368 output -1 - - --- !query 369 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 369 schema -struct<> --- !query 369 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table; - - --- !query 370 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 370 schema -struct<> --- !query 370 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table; - - --- !query 371 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table; - - --- !query 372 -SELECT cast(1 as decimal(10, 0)) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 372 schema -struct<> --- !query 372 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table; - - --- !query 373 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 373 schema -struct --- !query 373 output -1 - - --- !query 374 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 374 schema -struct --- !query 374 output -1 - - --- !query 375 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 375 schema -struct --- !query 375 output -1 - - --- !query 376 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 376 schema -struct --- !query 376 output -1 - - --- !query 377 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 377 schema -struct --- !query 377 output - - - --- !query 378 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 378 schema -struct --- !query 378 output - - - --- !query 379 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 379 schema -struct --- !query 379 output -1 - - --- !query 380 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 380 schema -struct --- !query 380 output -1 - - --- !query 381 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 381 schema -struct<> --- !query 381 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> string at the first column of the second table; - - --- !query 382 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 382 schema -struct<> --- !query 382 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table; - - --- !query 383 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 383 schema -struct --- !query 383 output - - - --- !query 384 -SELECT cast(1 as string) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 384 schema -struct --- !query 384 output - - - --- !query 385 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 385 schema -struct<> --- !query 385 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table; - - --- !query 386 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 386 schema -struct<> --- !query 386 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table; - - --- !query 387 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 387 schema -struct<> --- !query 387 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. int <> binary at the first column of the second table; - - --- !query 388 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 388 schema -struct<> --- !query 388 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table; - - --- !query 389 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 389 schema -struct<> --- !query 389 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. float <> binary at the first column of the second table; - - --- !query 390 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 390 schema -struct<> --- !query 390 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. double <> binary at the first column of the second table; - - --- !query 391 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 391 schema -struct<> --- !query 391 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table; - - --- !query 392 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 392 schema -struct<> --- !query 392 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. string <> binary at the first column of the second table; - - --- !query 393 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 393 schema -struct --- !query 393 output -1 - - --- !query 394 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 394 schema -struct<> --- !query 394 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table; - - --- !query 395 -SELECT cast('1' as binary) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table; - - --- !query 396 -SELECT cast('1' as binary) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 396 schema -struct<> --- !query 396 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> binary at the first column of the second table; - - --- !query 397 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 397 schema -struct<> --- !query 397 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table; - - --- !query 398 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 398 schema -struct<> --- !query 398 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table; - - --- !query 399 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 399 schema -struct<> --- !query 399 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table; - - --- !query 400 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 400 schema -struct<> --- !query 400 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table; - - --- !query 401 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 401 schema -struct<> --- !query 401 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table; - - --- !query 402 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 402 schema -struct<> --- !query 402 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table; - - --- !query 403 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 403 schema -struct<> --- !query 403 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table; - - --- !query 404 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 404 schema -struct<> --- !query 404 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table; - - --- !query 405 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 405 schema -struct<> --- !query 405 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table; - - --- !query 406 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 406 schema -struct --- !query 406 output -true - - --- !query 407 -SELECT cast(1 as boolean) FROM t INTERSECT 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 -Intersect can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table; - - --- !query 408 -SELECT cast(1 as boolean) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 408 schema -struct<> --- !query 408 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table; - - --- !query 409 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 409 schema -struct<> --- !query 409 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table; - - --- !query 410 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 410 schema -struct<> --- !query 410 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table; - - --- !query 411 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 411 schema -struct<> --- !query 411 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table; - - --- !query 412 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 412 schema -struct<> --- !query 412 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table; - - --- !query 413 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 413 schema -struct<> --- !query 413 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table; - - --- !query 414 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 414 schema -struct<> --- !query 414 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table; - - --- !query 415 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 415 schema -struct<> --- !query 415 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table; - - --- !query 416 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 416 schema -struct --- !query 416 output - - - --- !query 417 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 417 schema -struct<> --- !query 417 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table; - - --- !query 418 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 418 schema -struct<> --- !query 418 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table; - - --- !query 419 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 419 schema -struct --- !query 419 output -2017-12-11 09:30:00 - - --- !query 420 -SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 420 schema -struct --- !query 420 output - - - --- !query 421 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as tinyint) FROM t --- !query 421 schema -struct<> --- !query 421 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table; - - --- !query 422 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as smallint) FROM t --- !query 422 schema -struct<> --- !query 422 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table; - - --- !query 423 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as int) FROM t --- !query 423 schema -struct<> --- !query 423 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. int <> date at the first column of the second table; - - --- !query 424 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as bigint) FROM t --- !query 424 schema -struct<> --- !query 424 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table; - - --- !query 425 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as float) FROM t --- !query 425 schema -struct<> --- !query 425 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. float <> date at the first column of the second table; - - --- !query 426 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as double) FROM t --- !query 426 schema -struct<> --- !query 426 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. double <> date at the first column of the second table; - - --- !query 427 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as decimal(10, 0)) FROM t --- !query 427 schema -struct<> --- !query 427 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table; - - --- !query 428 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as string) FROM t --- !query 428 schema -struct --- !query 428 output - - - --- !query 429 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('1' as binary) FROM t --- !query 429 schema -struct<> --- !query 429 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. binary <> date at the first column of the second table; - - --- !query 430 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast(1 as boolean) FROM t --- !query 430 schema -struct<> --- !query 430 output -org.apache.spark.sql.AnalysisException -Intersect can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table; - - --- !query 431 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00.0' as timestamp) FROM t --- !query 431 schema -struct --- !query 431 output - - - --- !query 432 -SELECT cast('2017-12-11 09:30:00' as date) FROM t INTERSECT SELECT cast('2017-12-11 09:30:00' as date) FROM t --- !query 432 schema -struct --- !query 432 output -2017-12-11