Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16475][SQL] Broadcast Hint for SQL Queries - #14132
Conversation
dongjoon-hyun
commented
Jul 11, 2016
cc @rxin and @hvanhovell . |
dongjoon-hyun
commented
Jul 11, 2016
If the direction is right, I can move on adding |
There was a problem hiding this comment.
Do we need this because the BRACKETED_COMMENT rule is now expecting at least one character?
There was a problem hiding this comment.
Yes. Could you give me some workaround advice?
There was a problem hiding this comment.
My advice would be to add the HINT_PREFIX rule ('/*+')
There was a problem hiding this comment.
Can you try to add this as a case (| '/**/' -> channel(HIDDEN)) to the BRACKETED_COMMENT rule?
There was a problem hiding this comment.
Oops. It seems we can not do that due to channel(HIDDEN).
->command in lexer rule BRACKETED_COMMENT must be last element of single outermost alt
hvanhovell
commented
Jul 11, 2016
This looks pretty good! |
dongjoon-hyun
commented
Jul 11, 2016
Thank you for quick review! I'll let you know after updating. |
SparkQA
commented
Jul 11, 2016
Test build #62082 has finished for PR 14132 at commit
|
dongjoon-hyun
commented
Jul 11, 2016
Oops. Five errors, too. I'll fix these tomorrow. |
There was a problem hiding this comment.
What are we trying to support here?
There was a problem hiding this comment.
I think you can also do this (is easier in the AST builder): | hintName=identifier '(' parameters+=identifier parameters+=identifier ')'
There was a problem hiding this comment.
It supports 'INDEX(t idx_emp)' style. For example, I included one in the test.
SparkQA
commented
Jul 12, 2016
Test build #62162 has finished for PR 14132 at commit
|
dongjoon-hyun
commented
Jul 12, 2016
For the HINT_PREFIX, I tried at the first, but still have some problem. So, I couldn't include the very previous commit. |
Thank you always, @hvanhovell . And, sorry for the delay. Since last Saturday, I need to do some important personal stuff offline, so the time is limited for me. :( |
dongjoon-hyun
commented
Jul 12, 2016
I'm back. I'll resolve them. |
dongjoon-hyun
commented
Jul 12, 2016
So far, I couldn't do the following two advices. I just inform you that I'm still working these. :)
|
dongjoon-hyun
commented
Jul 12, 2016
Now, only minor |
dongjoon-hyun
commented
Jul 13, 2016
Hi, @hvanhovell . So far, I tried in the following way for hint
- : '/*+' hintStatement '*/'
+ : HINT_PREFIX hintStatement '*/'
;
hintStatement
@@ -961,12 +961,12 @@ SIMPLE_COMMENT
: '--' ~[\r\n]* '\r'? '\n'? -> channel(HIDDEN)
;
-BRACKETED_EMPTY_COMMENT
- : '/**/' -> channel(HIDDEN)
+HINT_PREFIX
+ : '/*+'
;
BRACKETED_COMMENT
- : '/*' ~[+] .*? '*/' -> channel(HIDDEN)
+ : '/*' .*? '*/' -> channel(HIDDEN) <--- The original one.
; |
SparkQA
commented
Jul 13, 2016
Test build #62196 has finished for PR 14132 at commit
|
SparkQA
commented
Jul 13, 2016
Test build #62198 has finished for PR 14132 at commit
|
dongjoon-hyun
commented
Jul 13, 2016
Hi, @rxin . |
dongjoon-hyun
commented
Jul 13, 2016
Hi, @hvanhovell . |
hvanhovell
commented
Jul 13, 2016
@dongjoon-hyun sure. It was merely a suggestion to get rid of the |
dongjoon-hyun
commented
Jul 13, 2016
Thank you, @hvanhovell . |
dongjoon-hyun
commented
Jul 13, 2016
PR description is updated. |
…d more description.
dongjoon-hyun
commented
Jul 28, 2016
Oh, the one failure is due to a new MAPJOIN testcase in the master branch (I added yesterday.) |
SparkQA
commented
Jul 28, 2016
Test build #62975 has finished for PR 14132 at commit
|
dongjoon-hyun
commented
Jul 29, 2016
Hi, @cloud-fan . |
This PR grows too much. Sometime, scrolling is too slow. I close this and open a new one #14426 . |
What changes were proposed in this pull request?
This PR aims to achieve the following two goals in Spark SQL.
1. Generic Hint Syntax
The generic hints are parsed and transformed into concrete hints by
SubstituteHintsof Analyzer. The unknown hints are removed, too. For example,Hint("MAPJOIN")is transformed intoBroadcastJoinand other hints are removed currently.Unlink Hive,
NEWMAPJOIN(t)is allowed for accepting new Spark Hints.2. Broadcast Hints
The followings are recognized. Technically, broadcast hints are matched
UnresolvedRelationto support HiveMetastoreRelation. The style ofdatabase_name.table_nameis not allowed in this PR.Examples
How was this patch tested?
Pass the Jenkins tests with new testcases.