You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-30093][SQL] Improve error message for creating view
### What changes were proposed in this pull request?
Improved error message while creating views.
### Why are the changes needed?
Error message should suggest user to use TEMPORARY keyword while creating permanent view referred by temporary view.
apache#26317 (comment)
### Does this PR introduce any user-facing change?
No
### How was this patch tested?
Updated test case.
Closesapache#26731 from amanomer/imp_err_msg.
Authored-by: Aman Omer <[email protected]>
Signed-off-by: Wenchen Fan <[email protected]>
Copy file name to clipboardExpand all lines: sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -267,7 +267,7 @@ CREATE VIEW v1_temp AS SELECT * FROM temp_table
267
267
struct<>
268
268
-- !query 27 output
269
269
org.apache.spark.sql.AnalysisException
270
-
Not allowed to create a permanent view `v1_temp` by referencing a temporary view `temp_table`;
270
+
Not allowed to create a permanent view `v1_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
271
271
272
272
273
273
-- !query 28
@@ -323,7 +323,7 @@ CREATE VIEW temp_view_test.v3_temp AS SELECT * FROM temp_table
323
323
struct<>
324
324
-- !query 32 output
325
325
org.apache.spark.sql.AnalysisException
326
-
Not allowed to create a permanent view `temp_view_test`.`v3_temp` by referencing a temporary view `temp_table`;
326
+
Not allowed to create a permanent view `temp_view_test`.`v3_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
327
327
328
328
329
329
-- !query 33
@@ -372,7 +372,7 @@ CREATE VIEW v4_temp AS
372
372
struct<>
373
373
-- !query 35 output
374
374
org.apache.spark.sql.AnalysisException
375
-
Not allowed to create a permanent view `v4_temp` by referencing a temporary view `temp_table`;
375
+
Not allowed to create a permanent view `v4_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
376
376
377
377
378
378
-- !query 36
@@ -384,7 +384,7 @@ CREATE VIEW v5_temp AS
384
384
struct<>
385
385
-- !query 36 output
386
386
org.apache.spark.sql.AnalysisException
387
-
Not allowed to create a permanent view `v5_temp` by referencing a temporary view `temp_table`;
387
+
Not allowed to create a permanent view `v5_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
388
388
389
389
390
390
-- !query 37
@@ -543,7 +543,7 @@ CREATE VIEW v6_temp AS SELECT * FROM base_table WHERE id IN (SELECT id FROM temp
543
543
struct<>
544
544
-- !query 47 output
545
545
org.apache.spark.sql.AnalysisException
546
-
Not allowed to create a permanent view `v6_temp` by referencing a temporary view `temp_table`;
546
+
Not allowed to create a permanent view `v6_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
547
547
548
548
549
549
-- !query 48
@@ -552,7 +552,7 @@ CREATE VIEW v7_temp AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM tem
552
552
struct<>
553
553
-- !query 48 output
554
554
org.apache.spark.sql.AnalysisException
555
-
Not allowed to create a permanent view `v7_temp` by referencing a temporary view `temp_table`;
555
+
Not allowed to create a permanent view `v7_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
556
556
557
557
558
558
-- !query 49
@@ -561,7 +561,7 @@ CREATE VIEW v8_temp AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp
561
561
struct<>
562
562
-- !query 49 output
563
563
org.apache.spark.sql.AnalysisException
564
-
Not allowed to create a permanent view `v8_temp` by referencing a temporary view `temp_table`;
564
+
Not allowed to create a permanent view `v8_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
565
565
566
566
567
567
-- !query 50
@@ -570,7 +570,7 @@ CREATE VIEW v9_temp AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM
570
570
struct<>
571
571
-- !query 50 output
572
572
org.apache.spark.sql.AnalysisException
573
-
Not allowed to create a permanent view `v9_temp` by referencing a temporary view `temp_table`;
573
+
Not allowed to create a permanent view `v9_temp` by referencing a temporary view `temp_table`. Please create a temp view instead by CREATE TEMP VIEW;
574
574
575
575
576
576
-- !query 51
@@ -679,7 +679,7 @@ CREATE VIEW temporal1 AS SELECT * FROM t1 CROSS JOIN tt
679
679
struct<>
680
680
-- !query 61 output
681
681
org.apache.spark.sql.AnalysisException
682
-
Not allowed to create a permanent view `temporal1` by referencing a temporary view `tt`;
682
+
Not allowed to create a permanent view `temporal1` by referencing a temporary view `tt`. Please create a temp view instead by CREATE TEMP VIEW;
683
683
684
684
685
685
-- !query 62
@@ -720,7 +720,7 @@ CREATE VIEW temporal2 AS SELECT * FROM t1 INNER JOIN tt ON t1.num = tt.num2
720
720
struct<>
721
721
-- !query 64 output
722
722
org.apache.spark.sql.AnalysisException
723
-
Not allowed to create a permanent view `temporal2` by referencing a temporary view `tt`;
723
+
Not allowed to create a permanent view `temporal2` by referencing a temporary view `tt`. Please create a temp view instead by CREATE TEMP VIEW;
724
724
725
725
726
726
-- !query 65
@@ -761,7 +761,7 @@ CREATE VIEW temporal3 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2
761
761
struct<>
762
762
-- !query 67 output
763
763
org.apache.spark.sql.AnalysisException
764
-
Not allowed to create a permanent view `temporal3` by referencing a temporary view `tt`;
764
+
Not allowed to create a permanent view `temporal3` by referencing a temporary view `tt`. Please create a temp view instead by CREATE TEMP VIEW;
765
765
766
766
767
767
-- !query 68
@@ -802,7 +802,7 @@ CREATE VIEW temporal4 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2 AND t
802
802
struct<>
803
803
-- !query 70 output
804
804
org.apache.spark.sql.AnalysisException
805
-
Not allowed to create a permanent view `temporal4` by referencing a temporary view `tt`;
805
+
Not allowed to create a permanent view `temporal4` by referencing a temporary view `tt`. Please create a temp view instead by CREATE TEMP VIEW;
806
806
807
807
808
808
-- !query 71
@@ -811,7 +811,7 @@ CREATE VIEW temporal5 AS SELECT * FROM t1 WHERE num IN (SELECT num FROM t1 WHERE
811
811
struct<>
812
812
-- !query 71 output
813
813
org.apache.spark.sql.AnalysisException
814
-
Not allowed to create a permanent view `temporal5` by referencing a temporary view `tt`;
814
+
Not allowed to create a permanent view `temporal5` by referencing a temporary view `tt`. Please create a temp view instead by CREATE TEMP VIEW;
0 commit comments