-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-4529] [SQL] support view with column alias #3396
Conversation
Test build #23703 has started for PR 3396 at commit
|
Test build #23703 has finished for PR 3396 at commit
|
Test PASSed. |
Should we also put more test cases into the whitelist? |
@@ -380,7 +380,7 @@ private[hive] object HiveQl { | |||
protected def nameExpressions(exprs: Seq[Expression]): Seq[NamedExpression] = { | |||
exprs.zipWithIndex.map { | |||
case (ne: NamedExpression, _) => ne | |||
case (e, i) => Alias(e, s"c_$i")() | |||
case (e, i) => Alias(e, s"_c$i")() |
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.
What exactly is going on here? Have we been doing this wrong all along? or is this a Hive version specific thing?
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.
I checked hive-{0.9.0, 0.12.0, 0.13.1}, they all use _c as the default auto-gen column alias prefix label.
Support view definition like CREATE VIEW view3(valoo) TBLPROPERTIES ("fear" = "factor") AS SELECT upper(value) FROM src WHERE key=86; [valoo as the alias of upper(value)]. This is missing part of SPARK-4239, for a fully view support. Author: Daoyuan Wang <daoyuan.wang@intel.com> Closes #3396 from adrian-wang/viewcolumn and squashes the following commits: 4d001d0 [Daoyuan Wang] support view with column alias (cherry picked from commit 4df60a8) Signed-off-by: Michael Armbrust <michael@databricks.com>
I went ahead and merged this since it would be nice to have the naming change before 1.2. However, it would be good to follow up and see if there are more tests that can be whitelisted. |
Thanks for working on it! |
Support view definition like
CREATE VIEW view3(valoo)
TBLPROPERTIES ("fear" = "factor")
AS SELECT upper(value) FROM src WHERE key=86;
[valoo as the alias of upper(value)]. This is missing part of SPARK-4239, for a fully view support.