-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-20680][SQL][FOLLOW-UP] Make NullType.simpleString as void to support hive #29244
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
Conversation
|
Test build #126572 has finished for PR 29244 at commit
|
| c.metadata.getString(HIVE_TYPE_STRING) | ||
| } else { | ||
| c.dataType.catalogString | ||
| c.dataType.sql |
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.
we should use .sql to hive type.
|
Test build #126594 has finished for PR 29244 at commit
|
|
|
||
| private[spark] override def asNullable: NullType = this | ||
|
|
||
| override def sql: String = "VOID" |
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.
why not override simpleString? sql calls simpleString
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.
Just consider that simpleString/catalogString is a name of spark, and sql is used in other database ? We can still show something like unknown with NullType, If we can divide this.
I'm not sure the sql original meaning, but it seems used for Hive DDL e.g., StructType.toDDL use sql to build DDL string.
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.
It's confusing if simpleString and sql is not consistent.
|
Could we change this title to a FOLLOWUP of SPARK-20680, like #29041. It can help backport more clear |
|
@LantaoJin mostly we can, but I'm not sure whether this pr is only for revert simpleString. |
| case ("decimal" | "dec" | "numeric", precision :: scale :: Nil) => | ||
| DecimalType(precision.getText.toInt, scale.getText.toInt) | ||
| case ("void", Nil) => NullType | ||
| case ("null", Nil) => NullType |
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.
this is for compatible, likefrom_csv.
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.
In which case do we need it? If we have this PR, the valid string for null type should be void. Before this PR, it wasn't supported before.
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.
Forgot it, we not support parse null before.
|
Test build #126643 has finished for PR 29244 at commit
|
|
Test build #126645 has finished for PR 29244 at commit
|
|
Test build #126642 has finished for PR 29244 at commit
|
|
Test build #126676 has finished for PR 29244 at commit
|
|
Test build #126697 has finished for PR 29244 at commit
|
|
retest this please |
|
Test build #126702 has finished for PR 29244 at commit
|
|
Another safer fix is: In The question is: do we think |
|
For me, |
|
How about we be conservative and follow #29244 (comment) first? @ulysses-you |
|
@cloud-fan you mean something like this pr #28935 ? As I know, we can just update |
|
Yea similar but more narrowed to |
|
Created #29423. |
### What changes were proposed in this pull request? Discussion with [comment](#29244 (comment)). Add `HiveVoidType` class in `HiveClientImpl` then we can replace `NullType` to `HiveVoidType` before we call hive client. ### Why are the changes needed? Better compatible with hive. More details in [#29244](#29244). ### Does this PR introduce _any_ user-facing change? Yes, user can create view with null type in Hive. ### How was this patch tested? New test. Closes #29423 from ulysses-you/add-HiveVoidType. Authored-by: ulysses <youxiduo@weidian.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
|
close this since #29423 merged. |
What changes were proposed in this pull request?
For better compatible with Hive in
create viewwith null.Change
NullType.simpleStringtovoid, then Hive can parsevoidto it's own type.Why are the changes needed?
Currently, we support
create view v as select nullwith in-memory but failed in hive. We try to forbid this in #29152, howeverdf.createTempViewis already a use case ofNullTypewith in-memory. So it seems better to keep this behavior consistent with hive.Some error msg with
create view v as select null.Does this PR introduce any user-facing change?
Yes, user can create view with null type in Hive.
How was this patch tested?
New UT with just Hive.
in-memorytest is already exists.