imback82 commented on a change in pull request #28375:
URL: https://github.com/apache/spark/pull/28375#discussion_r454570653
##########
File path: sql/core/src/test/resources/sql-tests/inputs/show-tblproperties.sql
##########
@@ -0,0 +1,26 @@
+-- create a table with properties
+CREATE TABLE tbl (a INT, b STRING, c INT) USING parquet
+TBLPROPERTIES('p1'='v1', 'p2'='v2');
+
+SHOW TBLPROPERTIES tbl;
+SHOW TBLPROPERTIES tbl("p1");
+SHOW TBLPROPERTIES tbl("p3");
+
+DROP TABLE tbl;
+
+-- create a view with properties
+CREATE VIEW view TBLPROPERTIES('p1'='v1', 'p2'='v2') AS SELECT 1 AS c1;
+
+SHOW TBLPROPERTIES view;
+SHOW TBLPROPERTIES view("p1");
+SHOW TBLPROPERTIES view("p3");
+
+DROP VIEW view;
+
+-- create a temporary view with properties
+CREATE TEMPORARY VIEW tv TBLPROPERTIES('p1'='v1') AS SELECT 1 AS c1;
+
+-- Properties for a temporary view should be empty
Review comment:
@cloud-fan There are few ways to address this:
1. Throw an exception if `CREATE TEMPORARY VIEW` contains properties since
they are ignored anyway.
2. Throw an exception when `SHOW TBLPROPERTIES` are run on a temporary view
in `ShowTablePropertiesCommand`.
3. Create `UnresolvedTableOrPermanentView` and use it for commands that
don't support temporary views.
WDYT?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]