This is an automated email from the ASF dual-hosted git repository. wenchen pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new cf47293b5fc7 [SPARK-48273][SQL][FOLLOWUP] Explicitly create non-Hive table in identifier-clause.sql cf47293b5fc7 is described below commit cf47293b5fc7c80d19e50fda44a01f91d5e34530 Author: Wenchen Fan <wenc...@databricks.com> AuthorDate: Wed May 29 13:35:01 2024 -0700 [SPARK-48273][SQL][FOLLOWUP] Explicitly create non-Hive table in identifier-clause.sql ### What changes were proposed in this pull request? A followup of https://github.com/apache/spark/pull/46580 . It's better to create non-Hive tables in the tests, so that it's backport safe, as old branches creates hive table by default. ### Why are the changes needed? fix branch-3.5 CI ### Does this PR introduce _any_ user-facing change? no ### How was this patch tested? N/A ### Was this patch authored or co-authored using generative AI tooling? no Closes #46794 from cloud-fan/test. Authored-by: Wenchen Fan <wenc...@databricks.com> Signed-off-by: Wenchen Fan <wenc...@databricks.com> --- .../sql-tests/analyzer-results/identifier-clause.sql.out | 8 ++++---- .../src/test/resources/sql-tests/inputs/identifier-clause.sql | 6 +++--- .../test/resources/sql-tests/results/identifier-clause.sql.out | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sql/core/src/test/resources/sql-tests/analyzer-results/identifier-clause.sql.out b/sql/core/src/test/resources/sql-tests/analyzer-results/identifier-clause.sql.out index f799c19a3bb8..b3e2cd5ada95 100644 --- a/sql/core/src/test/resources/sql-tests/analyzer-results/identifier-clause.sql.out +++ b/sql/core/src/test/resources/sql-tests/analyzer-results/identifier-clause.sql.out @@ -732,7 +732,7 @@ org.apache.spark.sql.AnalysisException -- !query -CREATE TABLE IDENTIFIER(1)(c1 INT) +CREATE TABLE IDENTIFIER(1)(c1 INT) USING csv -- !query analysis org.apache.spark.sql.AnalysisException { @@ -754,7 +754,7 @@ org.apache.spark.sql.AnalysisException -- !query -CREATE TABLE IDENTIFIER('a.b.c')(c1 INT) +CREATE TABLE IDENTIFIER('a.b.c')(c1 INT) USING csv -- !query analysis org.apache.spark.sql.AnalysisException { @@ -947,7 +947,7 @@ CacheTableAsSelect t1, (select my_col from (values (1), (2), (1) as (my_col)) gr -- !query -create table identifier('t2') as (select my_col from (values (1), (2), (1) as (my_col)) group by 1) +create table identifier('t2') using csv as (select my_col from (values (1), (2), (1) as (my_col)) group by 1) -- !query analysis CreateDataSourceTableAsSelectCommand `spark_catalog`.`default`.`t2`, ErrorIfExists, [my_col] +- Aggregate [my_col#x], [my_col#x] @@ -959,7 +959,7 @@ CreateDataSourceTableAsSelectCommand `spark_catalog`.`default`.`t2`, ErrorIfExis -- !query insert into identifier('t2') select my_col from (values (3) as (my_col)) group by 1 -- !query analysis -InsertIntoHadoopFsRelationCommand file:[not included in comparison]/{warehouse_dir}/t2, false, Parquet, [path=file:[not included in comparison]/{warehouse_dir}/t2], Append, `spark_catalog`.`default`.`t2`, org.apache.spark.sql.execution.datasources.InMemoryFileIndex(file:[not included in comparison]/{warehouse_dir}/t2), [my_col] +InsertIntoHadoopFsRelationCommand file:[not included in comparison]/{warehouse_dir}/t2, false, CSV, [path=file:[not included in comparison]/{warehouse_dir}/t2], Append, `spark_catalog`.`default`.`t2`, org.apache.spark.sql.execution.datasources.InMemoryFileIndex(file:[not included in comparison]/{warehouse_dir}/t2), [my_col] +- Aggregate [my_col#x], [my_col#x] +- SubqueryAlias __auto_generated_subquery_name +- SubqueryAlias as diff --git a/sql/core/src/test/resources/sql-tests/inputs/identifier-clause.sql b/sql/core/src/test/resources/sql-tests/inputs/identifier-clause.sql index 978b82c331fe..46461dcd048e 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/identifier-clause.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/identifier-clause.sql @@ -119,8 +119,8 @@ VALUES(IDENTIFIER(1)); VALUES(IDENTIFIER(SUBSTR('HELLO', 1, RAND() + 1))); SELECT `IDENTIFIER`('abs')(c1) FROM VALUES(-1) AS T(c1); -CREATE TABLE IDENTIFIER(1)(c1 INT); -CREATE TABLE IDENTIFIER('a.b.c')(c1 INT); +CREATE TABLE IDENTIFIER(1)(c1 INT) USING csv; +CREATE TABLE IDENTIFIER('a.b.c')(c1 INT) USING csv; CREATE VIEW IDENTIFIER('a.b.c')(c1) AS VALUES(1); DROP TABLE IDENTIFIER('a.b.c'); DROP VIEW IDENTIFIER('a.b.c'); @@ -135,7 +135,7 @@ CREATE TEMPORARY VIEW IDENTIFIER('default.v')(c1) AS VALUES(1); -- SPARK-48273: Aggregation operation in statements using identifier clause for table name create temporary view identifier('v1') as (select my_col from (values (1), (2), (1) as (my_col)) group by 1); cache table identifier('t1') as (select my_col from (values (1), (2), (1) as (my_col)) group by 1); -create table identifier('t2') as (select my_col from (values (1), (2), (1) as (my_col)) group by 1); +create table identifier('t2') using csv as (select my_col from (values (1), (2), (1) as (my_col)) group by 1); insert into identifier('t2') select my_col from (values (3) as (my_col)) group by 1; drop view v1; drop table t1; diff --git a/sql/core/src/test/resources/sql-tests/results/identifier-clause.sql.out b/sql/core/src/test/resources/sql-tests/results/identifier-clause.sql.out index 68aa5956a91c..2aa809324a76 100644 --- a/sql/core/src/test/resources/sql-tests/results/identifier-clause.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/identifier-clause.sql.out @@ -843,7 +843,7 @@ org.apache.spark.sql.AnalysisException -- !query -CREATE TABLE IDENTIFIER(1)(c1 INT) +CREATE TABLE IDENTIFIER(1)(c1 INT) USING csv -- !query schema struct<> -- !query output @@ -867,7 +867,7 @@ org.apache.spark.sql.AnalysisException -- !query -CREATE TABLE IDENTIFIER('a.b.c')(c1 INT) +CREATE TABLE IDENTIFIER('a.b.c')(c1 INT) USING csv -- !query schema struct<> -- !query output @@ -1076,7 +1076,7 @@ struct<> -- !query -create table identifier('t2') as (select my_col from (values (1), (2), (1) as (my_col)) group by 1) +create table identifier('t2') using csv as (select my_col from (values (1), (2), (1) as (my_col)) group by 1) -- !query schema struct<> -- !query output --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org