File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
sql/core/src/test/scala/org/apache/spark/sql Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -2650,6 +2650,12 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
2650
2650
withSQLConf(SQLConf .CASE_SENSITIVE .key -> " false" ) {
2651
2651
sql(" SELECT struct(1 a) UNION ALL (SELECT struct(2 A))" )
2652
2652
sql(" SELECT struct(1 a) EXCEPT (SELECT struct(2 A))" )
2653
+
2654
+ withTable(" struct1" , " struct2" ) {
2655
+ sql(" CREATE TABLE struct1(a struct<a:int>) USING parquet" )
2656
+ sql(" CREATE TABLE struct2(A struct<A:int>) USING parquet" )
2657
+ checkAnswer(sql(" SELECT * FROM struct1, struct2 WHERE struct1.a = struct2.A" ), Seq .empty)
2658
+ }
2653
2659
}
2654
2660
2655
2661
withSQLConf(SQLConf .CASE_SENSITIVE .key -> " true" ) {
@@ -2662,6 +2668,15 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
2662
2668
sql(" SELECT struct(1 a) EXCEPT (SELECT struct(2 A))" )
2663
2669
}.message
2664
2670
assert(m2.contains(" Except can only be performed on tables with the compatible column types" ))
2671
+
2672
+ withTable(" struct1" , " struct2" ) {
2673
+ sql(" CREATE TABLE struct1(a struct<a:int>) USING parquet" )
2674
+ sql(" CREATE TABLE struct2(A struct<A:int>) USING parquet" )
2675
+ val m = intercept[AnalysisException ] {
2676
+ sql(" SELECT * FROM struct1, struct2 WHERE a = A" )
2677
+ }.message
2678
+ assert(m.contains(" cannot resolve '(struct1.`a` = struct2.`A`)' due to data type mismatch" ))
2679
+ }
2665
2680
}
2666
2681
}
2667
2682
You can’t perform that action at this time.
0 commit comments