[
https://issues.apache.org/jira/browse/IMPALA-8103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16761490#comment-16761490
]
ASF subversion and git services commented on IMPALA-8103:
---------------------------------------------------------
Commit 14996f495129eaee35ee030be87b289b9dae517e in impala's branch
refs/heads/master from Andrew Sherman
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=14996f4 ]
IMPALA-8103: In Analyzed Query use /* and */ to delimit hints.
IMPALA-5821 added the analyzed query text to the output of EXPLAIN when
explain_level is 2 or greater. Any query hits were displayed in the form
SELECT
-- +straight_join
* FROM table_name [...]
which meant that care had to be taken to embed and preserve newlines in
the EXPLAIN output. This change makes the output to be of the form
SELECT /* +straight_join */ * FROM table_name [...]
The /* +straight_join */ form was chosen over /*+straight_join */ as
it seems more readable, and is more commonly used in exiting tests.
To do this the following changes were made:
ToSqlUtils.getPlanHintsSql() was extended to take a ToSqlOptions
parameter. If this parameter indicates that the analyzed query is being
shown, then the hints are surrounded with '/*' and '*/'.
PrintUtils.wrapString() was simplified as it no longer has to preserve
newlines in a an analyzed query.
TESTING
All end-to-end tests were run.
The output in a few .test files was updated.
A couple of new cases were added to ToSqlTest.java
Change-Id: I7215a4c17508e3408680a1d2bb6c3af355c78c8d
Reviewed-on: http://gerrit.cloudera.org:8080/12360
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Plan hints show up as "--" comments in analysed query
> -----------------------------------------------------
>
> Key: IMPALA-8103
> URL: https://issues.apache.org/jira/browse/IMPALA-8103
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Reporter: Tim Armstrong
> Assignee: Andrew Sherman
> Priority: Minor
>
> I noticed that the hints added in IMPALA-5821 show up in the -- style rather
> than /**/
> {code}
> Sql Statement: select * from tpch.lineitem join /*+ broadcast */
> tpch.part on l_partkey = p_partkey limit
> ...
> Analyzed query: SELECT * FROM tpch.lineitem INNER JOIN
> -- +broadcast
> tpch.part ON l_partkey = p_partkey LIMIT CAST(5 AS TINYINT)
> {code}
> I guess this works and maybe its fine, but I was really confused when I saw
> it. It looks like getPlanHintsSql() uses this to generate views in such a way
> that Hive will ignore the hints, but that concern doesn't seem relevant to
> this use case.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]