You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2018/11/17 02:09:00 UTC

[jira] [Commented] (IMPALA-7718) [DOCS] document changes to explain output from IMPALA-5821

    [ https://issues.apache.org/jira/browse/IMPALA-7718?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16690197#comment-16690197 ] 

ASF subversion and git services commented on IMPALA-7718:
---------------------------------------------------------

Commit d3948d9a0114b7702da684e14919d369e74fe596 in impala's branch refs/heads/master from [~asherman]
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=d3948d9 ]

IMPALA-5821: Add query with implicit casts to extended explain output.

If explain_level is at 'extended' level or higher, then enhance the
output from the explain command. (1) Show the analyzed sql in the
explain header, this is the rewritten sql, which includes implicit
casts, and literals are printed with a cast so that their type is
visible. (2) When predicates are shown in the plan these are shown in
the same format.

The toSql() method can be called on a ParseNode tree to return
the sql corresponding ot the tree. In the past toSQl() has been
enhanced to print rewritten sql by partially overloading toSql() [with
toSql(boolean)]. This current change requires changing toSQl() in
many places as NumericLiteral can appear at different points in ia
parse tree. To avoid many new fragile overloads of toSql() I added
toSql(ToSqlOptions), where ToSqlOptions is an enum which controls the
form of the Sql that is returned. This changes many files but is safer
and means that any future options to toSql() can be added painlessly.

If SHOW_IMPLICIT_CASTS is passed to toSql() then
- in CastExpr print the implicit cast
- in NumericLiteral print the literal with a cast to show the type

Add a PlannerTestOption directive that will force the query text showing
implicit casts to be included in the PLAN section of a .test file.

The analyzed query text is wrapped at 80 characters. Note that the
analyzed query cannot always be executed as queries rewritten to use
LEFT SEMI JOIN are not legal sql. In addition some space characters may
be removed from the query for prettier display.

Documentation of this change will be done as IMPALA-7718

EXAMPLE OUTPUT:

[localhost:21000] default> set explain_level=2;
EXPLAIN_LEVEL set to 2
[localhost:21000] default> explain select * from functional_kudu.alltypestiny where bigint_col < 1000 / 100;
Query: explain select * from functional_kudu.alltypestiny where bigint_col < 1000 / 100
Max Per-Host Resource Reservation: Memory=0B Threads=2
Per-Host Resource Estimates: Memory=10MB
Codegen disabled by planner
Analyzed query: SELECT * FROM functional_kudu.alltypestiny WHERE CAST(bigint_col
AS DOUBLE) < CAST(10 AS DOUBLE)
""
F00:PLAN FRAGMENT [UNPARTITIONED] hosts=1 instances=1
|  Per-Host Resources: mem-estimate=4.88MB mem-reservation=0B thread-reservation=2
PLAN-ROOT SINK
|  mem-estimate=0B mem-reservation=0B thread-reservation=0
|
00:SCAN KUDU [functional_kudu.alltypestiny]
   predicates: CAST(bigint_col AS DOUBLE) < CAST(10 AS DOUBLE)
   mem-estimate=4.88MB mem-reservation=0B thread-reservation=1
   tuple-ids=0 row-size=97B cardinality=1
   in pipelines: 00(GETNEXT)
Fetched 16 row(s) in 0.03s

TESTING:

All end-to-end tests pass.
Added a new test in ExprRewriterTest which prints sql with implict casts
for some interesting queries.
Add a unit test for the code which wraps text at 60 characters.
The output of some Planner Tests in .test files has been updated to
include the Analyzed sql that is printed when explain_level is
at at least 'extended' level.

Change-Id: I55c3bdacc295137f66b2316a912fc347da30d6b0
Reviewed-on: http://gerrit.cloudera.org:8080/11719
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Thomas Marshall <th...@cmu.edu>


> [DOCS] document changes to explain output from IMPALA-5821
> ----------------------------------------------------------
>
>                 Key: IMPALA-7718
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7718
>             Project: IMPALA
>          Issue Type: Sub-task
>            Reporter: Andrew Sherman
>            Assignee: Alex Rodoni
>            Priority: Major
>              Labels: future_release_doc
>
> When [IMPALA-5821] is complete, it will change the output from 'explain ...'  when  EXPLAIN_LEVEL is extended or higher. The header will now contain a line showing the query, with implicit casts as part of the text.  This should probably be documented in docs/topics/impala_explain_level.xml 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org