[SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE#33219
[SPARK-36012][SQL] Add null flag in SHOW CREATE TABLE#33219Peng-Lei wants to merge 2 commits intoapache:masterfrom
Conversation
|
@cloud-fan Could you take a look? |
da9c28e to
3ee8ffc
Compare
There was a problem hiding this comment.
since we are touching the code here, can we change it to compare the StructType instance instead of the DDL string?
There was a problem hiding this comment.
nit: classOf[SimpleInsertSource].getName
cloud-fan
left a comment
There was a problem hiding this comment.
LGTM except for some minor comments
There was a problem hiding this comment.
super nit and you don't have to change: I think you can modify getShowDDL a bit and reuse it, and make this code structure the same as test("SPARK-24911: keep quotes for nested fields")
There was a problem hiding this comment.
@huaxingao Thank you for your code review. done.
There was a problem hiding this comment.
I really don't like this function getShowDDL. It just returns part of the DDL data instead of the complete DDL data. But it is named getShowDDL
There was a problem hiding this comment.
why can't we always call .mkString(" ") here?
There was a problem hiding this comment.
I think @Peng-Lei doesn't want to include the USING text TBLPROPERTIES ( 'transient_lastDdlTime... in the test in HiveShowCreateTableSuite. I guess maybe always call .mkString(" ") here and trim off the USING text ... using something like shownDDL.substring(0, shownDDL.indexOf(" USING") in the Hive test?
There was a problem hiding this comment.
Yeah. In HiveShowCreateTableSuite it compare the Array(0) + Array(1). I do not want to include the USING text TBLPROPERTIES, because the test fail. I just think getShowDDL return Array[String] is flexible, because if we want to use Array to assert, it just ok. If we want to use String to assert, just mkString(). @cloud-fan @huaxingao
|
ok to test |
|
Kubernetes integration test starting |
|
thanks, merging to master/3.2 (since v2 SHOW CREATE TABLE is new in 3.2) |
### What changes were proposed in this pull request? When exec the command `SHOW CREATE TABLE`, we should not lost the info null flag if the table column that is specified `NOT NULL` ### Why are the changes needed? [SPARK-36012](https://issues.apache.org/jira/browse/SPARK-36012) ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Add UT test for V1 and existed UT for V2 Closes #33219 from Peng-Lei/SPARK-36012. Authored-by: PengLei <peng.8lei@gmail.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com> (cherry picked from commit e071721) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
|
Kubernetes integration test status success |
|
Test build #140811 has finished for PR 33219 at commit
|
What changes were proposed in this pull request?
When exec the command
SHOW CREATE TABLE, we should not lost the info null flag if the table column thatis specified
NOT NULLWhy are the changes needed?
SPARK-36012
Does this PR introduce any user-facing change?
No
How was this patch tested?
Add UT test for V1 and existed UT for V2