-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[MINOR][SQL] Add a debug log when a SQL text is used for a view #22351
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
|
cc @cloud-fan |
|
Test build #95754 has finished for PR 22351 at commit
|
dongjoon-hyun
left a comment
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.
+1, LGTM.
BTW, if you don't mind, could you update the PR description?
- This returns a fully qualified SQL string for the view as below:
+ This returns a wrongly qualified SQL string for the view as below:
It's because we can see the inconsistency here.
default.emp -> `default`.`emp`
d100.udf100 -> `d100.udf100`
|
Done, thanks @dongjoon-hyun |
|
Merged to master. |
|
I'm surprised Hive changes the view text set by Spark. Is it a problem for views? cc @gatorsmile @jiangxb1987 @hvanhovell |
|
This is actually read some view created by Hive, so I don't think it shall be a problem with view write side. |
|
Just confirmed if the view is created and retrieved both at Spark side then there will be no exception thrown. |
What changes were proposed in this pull request?
This took me a while to debug and find out. Looks we better at least leave a debug log that SQL text for a view will be used.
Here's how I got there:
Hive:
Spark:
Under the hood, it actually makes sense since the view is defined as
SELECT d100.udf100(name) FROM default.emp;and Hive API:This returns a wrongly qualified SQL string for the view as below:
which works fine in Hive but not in Spark.
How was this patch tested?
Manually: