-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-27442][SQL] Remove check field name when reading/writing data in parquet #35229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
388be6d
[SPARK-27442][SQL] Remove check filename when reading data
AngersZhuuuu 4bf6a19
Add UT
AngersZhuuuu f3f4e4c
Update FileFormat.scala
AngersZhuuuu 3d7114a
follow comment
AngersZhuuuu 59e9030
update
AngersZhuuuu d09f83d
Update DataSource.scala
AngersZhuuuu 5a9d993
update
AngersZhuuuu 5dc6741
Update FileFormat.scala
AngersZhuuuu b2d64af
follow comment
AngersZhuuuu b3f0f09
Update ParquetFileFormat.scala
AngersZhuuuu fe3aeb2
Follow comment
AngersZhuuuu e11bcdb
update
AngersZhuuuu 5f3430f
Delete field_with_invalid_char.snappy.parquet
AngersZhuuuu bd5540e
Update SQLQuerySuite.scala
AngersZhuuuu 310b00c
Update SQLQuerySuite.scala
AngersZhuuuu e6253a2
Update SQLQuerySuite.scala
AngersZhuuuu e3efd3f
remove related UT
AngersZhuuuu 8a1dc91
Update HiveDDLSuite.scala
AngersZhuuuu 8883634
Update HiveDDLSuite.scala
AngersZhuuuu 3d4adf9
Update HiveDDLSuite.scala
AngersZhuuuu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2930,12 +2930,12 @@ class HiveDDLSuite | |
| withView("v") { | ||
| spark.range(1).createTempView("v") | ||
| withTempPath { path => | ||
| val e = intercept[AnalysisException] { | ||
| val e = intercept[SparkException] { | ||
| spark.sql(s"INSERT OVERWRITE LOCAL DIRECTORY '${path.getCanonicalPath}' " + | ||
| s"STORED AS PARQUET SELECT ID, if(1=1, 1, 0), abs(id), '^-' FROM v") | ||
| }.getMessage | ||
| assert(e.contains("Column name \"(IF((1 = 1), 1, 0))\" contains invalid character(s). " + | ||
| "Please use alias to rename it.")) | ||
| }.getCause.getCause.getMessage | ||
| assert(e.contains( | ||
| "field ended by ';': expected ';' but got 'IF' at line 2: optional int32 (IF")) | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -2944,7 +2944,7 @@ class HiveDDLSuite | |
| withView("v") { | ||
| spark.range(1).createTempView("v") | ||
| withTempPath { path => | ||
| val e = intercept[AnalysisException] { | ||
| val e = intercept[SparkException] { | ||
| spark.sql( | ||
| s""" | ||
| |INSERT OVERWRITE LOCAL DIRECTORY '${path.getCanonicalPath}' | ||
|
|
@@ -2953,27 +2953,9 @@ class HiveDDLSuite | |
| |NAMED_STRUCT('ID', ID, 'IF(ID=1,ID,0)', IF(ID=1,ID,0), 'B', ABS(ID)) AS col1 | ||
| |FROM v | ||
| """.stripMargin) | ||
| }.getMessage | ||
| assert(e.contains("Column name \"IF(ID=1,ID,0)\" contains" + | ||
| " invalid character(s). Please use alias to rename it.")) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| test("SPARK-36312: ParquetWriteSupport should check inner field") { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No exception thrown by hive serde, seems hive serder won't check inner fields. So just remove this . cc @cloud-fan |
||
| withView("v") { | ||
| spark.range(1).createTempView("v") | ||
| withTempPath { path => | ||
| val e = intercept[AnalysisException] { | ||
| spark.sql( | ||
| """ | ||
| |SELECT | ||
| |NAMED_STRUCT('ID', ID, 'IF(ID=1,ID,0)', IF(ID=1,ID,0), 'B', ABS(ID)) AS col1 | ||
| |FROM v | ||
| |""".stripMargin).write.mode(SaveMode.Overwrite).parquet(path.toString) | ||
| }.getMessage | ||
| assert(e.contains("Column name \"IF(ID=1,ID,0)\" contains" + | ||
| " invalid character(s). Please use alias to rename it.")) | ||
| }.getCause.getCause.getMessage | ||
| assert(e.contains("expected at the position 19 of " + | ||
| "'struct<ID:bigint,IF(ID=1,ID,0):bigint,B:bigint>' but '(' is found.")) | ||
| } | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does Hive Serde fail for this case as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, updated