cloud-fan commented on code in PR #43843:
URL: https://github.com/apache/spark/pull/43843#discussion_r1400536436
##########
sql/core/src/test/resources/sql-tests/results/selectExcept.sql.out:
##########
@@ -0,0 +1,334 @@
+-- Automatically generated by SQLQueryTestSuite
+-- !query
+CREATE TEMPORARY VIEW tbl_view AS SELECT * FROM VALUES
+ (10, "name1", named_struct("f1", 1, "s2", named_struct("f2", 101, "f3",
"a"))),
+ (20, "name2", named_struct("f1", 2, "s2", named_struct("f2", 202, "f3",
"b"))),
+ (30, "name3", named_struct("f1", 3, "s2", named_struct("f2", 303, "f3",
"c"))),
+ (40, "name4", named_struct("f1", 4, "s2", named_struct("f2", 404, "f3",
"d"))),
+ (50, "name5", named_struct("f1", 5, "s2", named_struct("f2", 505, "f3",
"e"))),
+ (60, "name6", named_struct("f1", 6, "s2", named_struct("f2", 606, "f3",
"f"))),
+ (70, "name7", named_struct("f1", 7, "s2", named_struct("f2", 707, "f3",
"g")))
+AS tbl_view(id, name, data)
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+CREATE TABLE ids (id INT) USING CSV
+-- !query schema
+struct<>
+-- !query output
+
+
+
+-- !query
+SELECT * FROM tbl_view
+-- !query schema
+struct<id:int,name:string,data:struct<f1:int,s2:struct<f2:int,f3:string>>>
+-- !query output
+10 name1 {"f1":1,"s2":{"f2":101,"f3":"a"}}
+20 name2 {"f1":2,"s2":{"f2":202,"f3":"b"}}
+30 name3 {"f1":3,"s2":{"f2":303,"f3":"c"}}
+40 name4 {"f1":4,"s2":{"f2":404,"f3":"d"}}
+50 name5 {"f1":5,"s2":{"f2":505,"f3":"e"}}
+60 name6 {"f1":6,"s2":{"f2":606,"f3":"f"}}
+70 name7 {"f1":7,"s2":{"f2":707,"f3":"g"}}
+
+
+-- !query
+SELECT * EXCEPT (id) FROM tbl_view
+-- !query schema
+struct<name:string,data:struct<f1:int,s2:struct<f2:int,f3:string>>>
+-- !query output
+name1 {"f1":1,"s2":{"f2":101,"f3":"a"}}
+name2 {"f1":2,"s2":{"f2":202,"f3":"b"}}
+name3 {"f1":3,"s2":{"f2":303,"f3":"c"}}
+name4 {"f1":4,"s2":{"f2":404,"f3":"d"}}
+name5 {"f1":5,"s2":{"f2":505,"f3":"e"}}
+name6 {"f1":6,"s2":{"f2":606,"f3":"f"}}
+name7 {"f1":7,"s2":{"f2":707,"f3":"g"}}
+
+
+-- !query
+SELECT * EXCEPT (name) FROM tbl_view
+-- !query schema
+struct<id:int,data:struct<f1:int,s2:struct<f2:int,f3:string>>>
+-- !query output
+10 {"f1":1,"s2":{"f2":101,"f3":"a"}}
+20 {"f1":2,"s2":{"f2":202,"f3":"b"}}
+30 {"f1":3,"s2":{"f2":303,"f3":"c"}}
+40 {"f1":4,"s2":{"f2":404,"f3":"d"}}
+50 {"f1":5,"s2":{"f2":505,"f3":"e"}}
+60 {"f1":6,"s2":{"f2":606,"f3":"f"}}
+70 {"f1":7,"s2":{"f2":707,"f3":"g"}}
+
+
+-- !query
+SELECT * EXCEPT (data) FROM tbl_view
+-- !query schema
+struct<id:int,name:string>
+-- !query output
+10 name1
+20 name2
+30 name3
+40 name4
+50 name5
+60 name6
+70 name7
+
+
+-- !query
+SELECT * EXCEPT (data.f1) FROM tbl_view
+-- !query schema
+struct<id:int,name:string,data:struct<s2:struct<f2:int,f3:string>>>
+-- !query output
+10 name1 {"s2":{"f2":101,"f3":"a"}}
+20 name2 {"s2":{"f2":202,"f3":"b"}}
+30 name3 {"s2":{"f2":303,"f3":"c"}}
+40 name4 {"s2":{"f2":404,"f3":"d"}}
+50 name5 {"s2":{"f2":505,"f3":"e"}}
+60 name6 {"s2":{"f2":606,"f3":"f"}}
+70 name7 {"s2":{"f2":707,"f3":"g"}}
+
+
+-- !query
+SELECT * EXCEPT (data.s2) FROM tbl_view
Review Comment:
can we also test `SELECT data.* EXCEPT (s2)` and `SELECT data.* EXCEPT
(s2.f2)` and `SELECT data.s2.* EXCEPT (f2)`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]