Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Mar 17, 2020
1 parent 61a2290 commit 478d164
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 44 deletions.
Expand Up @@ -41,16 +41,16 @@ DROP TABLE emp;
-- These views are left around mainly to exercise special cases in pg_dump.

-- [SPARK-19842] Informational Referential Integrity Constraints Support in Spark
CREATE TABLE view_base_table (key int /* PRIMARY KEY */, data varchar(20));
-- [SPARK-28298] Fully support char and varchar types
-- CREATE TABLE view_base_table (key int PRIMARY KEY, data varchar(20));
--
CREATE VIEW key_dependent_view AS
SELECT * FROM view_base_table GROUP BY key;
-- CREATE VIEW key_dependent_view AS
-- SELECT * FROM view_base_table GROUP BY key;
--
-- [SPARK-19842] Informational Referential Integrity Constraints Support in Spark
-- ALTER TABLE view_base_table DROP CONSTRAINT view_base_table_pkey; -- fails

CREATE VIEW key_dependent_view_no_cols AS
SELECT FROM view_base_table GROUP BY key HAVING length(data) > 0;
--
-- CREATE VIEW key_dependent_view_no_cols AS
-- SELECT FROM view_base_table GROUP BY key HAVING length(data) > 0;

--
-- CREATE OR REPLACE VIEW
Expand Down
@@ -1,5 +1,5 @@
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 195
-- Number of queries: 192


-- !query
Expand Down Expand Up @@ -41,40 +41,6 @@ struct<>



-- !query
CREATE TABLE view_base_table (key int /* PRIMARY KEY */, data varchar(20))
-- !query schema
struct<>
-- !query output



-- !query
CREATE VIEW key_dependent_view AS
SELECT * FROM view_base_table GROUP BY key
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.AnalysisException
expression 'spark_catalog.default.view_base_table.`data`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.;


-- !query
CREATE VIEW key_dependent_view_no_cols AS
SELECT FROM view_base_table GROUP BY key HAVING length(data) > 0
-- !query schema
struct<>
-- !query output
org.apache.spark.sql.catalyst.parser.ParseException

no viable alternative at input 'FROM'(line 2, pos 10)

== SQL ==
CREATE VIEW key_dependent_view_no_cols AS
SELECT FROM view_base_table GROUP BY key HAVING length(data) > 0
----------^^^


-- !query
CREATE TABLE viewtest_tbl (a int, b int) using parquet
-- !query schema
Expand Down
Expand Up @@ -290,7 +290,7 @@ abstract class DynamicPartitionPruningSuiteBase
sql(
s"""
|CREATE TABLE fact (
| col1 varchar(14), col2 bigint, col3 bigint, col4 decimal(18,8), partCol1 varchar(1)
| col1 string, col2 bigint, col3 bigint, col4 decimal(18,8), partCol1 string
|) USING $tableFormat PARTITIONED BY (partCol1)
""".stripMargin)

Expand Down
Expand Up @@ -97,7 +97,7 @@ class HiveMetastoreCatalogSuite extends TestHiveSingleton with SQLTestUtils {
|c22 map<int,char(10)>,
|c23 struct<a:int,b:int>,
|c24 struct<c:varchar(10),d:int>
|)
|) USING hive
""".stripMargin)

val schema = hiveClient.getTable("default", "t").schema
Expand Down

0 comments on commit 478d164

Please sign in to comment.