linhongliu-db commented on a change in pull request #33488:
URL: https://github.com/apache/spark/pull/33488#discussion_r676639866
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala
##########
@@ -2394,114 +2393,47 @@ class HiveDDLSuite
}
}
- test("SPARK-20680: do not support for null column datatype") {
- withTable("t") {
- withView("tabNullType") {
- hiveClient.runSqlHive("CREATE TABLE t (t1 int)")
- hiveClient.runSqlHive("INSERT INTO t VALUES (3)")
- hiveClient.runSqlHive("CREATE VIEW tabNullType AS SELECT NULL AS col
FROM t")
- checkAnswer(spark.table("tabNullType"), Row(null))
- // No exception shows
- val desc = spark.sql("DESC tabNullType").collect().toSeq
- assert(desc.contains(Row("col", NullType.simpleString, null)))
- }
- }
-
- // Forbid CTAS with null type
+ test("SPARK-36241: support creating tables with null datatype") {
+ // CTAS with null type
withTable("t1", "t2", "t3") {
assertAnalysisError(
- "CREATE TABLE t1 USING PARQUET AS SELECT null as null_col",
- "Cannot create tables with null type")
+ "CREATE TABLE t1 USING PARQUET AS SELECT NULL AS null_col",
+ "Parquet data source does not support null data type")
assertAnalysisError(
- "CREATE TABLE t2 AS SELECT null as null_col",
- "Cannot create tables with null type")
+ "CREATE TABLE t2 STORED AS PARQUET AS SELECT null as null_col",
+ "Unknown field type: void")
Review comment:
parquet doesn't support null(spark)/void(hive) type
--
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]