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

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

Commit 7707eb041728456ea5e05ae8acc5ab59c715b98a in impala's branch 
refs/heads/master from Andrew Sherman
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=7707eb0 ]

IMPALA-7657: Codegen IsNotEmptyPredicate and ValidTupleIdExpr.

These two classes evaluate scalar expressions. Previously codegen was
done by calling ScalarExpr::GetCodegendComputeFnWrapper which generates
a static method that calls the scalar expression evaluation method. Make
this more efficient by generating code which is customized using
information available at codegen time.

Add new cross-compiled files null-literal-ir.cc slot-ref-ir.cc

IsNotEmptyPredicate works by getting a CollectionVal object from the
single child Expr node, and counting its tuples. At codegen time we know
the type and value of the child node. Generate a call to a node-specific
non-virtual cross-compiled method to get the CollectionVal object from
the child. Then generate a code that examines the CollectionVal and
returns an IntVal.

A ValidTupleIdExpr node contains a vector of tuple ids. It works by
probing each row for the tuple ids in the vector to find a non-null
tuple. At codegen time we know the vector of tuple ids. We unroll the
loop through the tuple ids, generating code that evaluates if the tuple
is non-null, and returns the tuple id if/when a non-null tuple is found.

IMPALA-7657 also requests replacing GetCodegendComputeFnWrapper() in
TupleIsNullPredicate. In the current Impala code this method is never
called. This is because TupleIsNullPredicate is always wrapped in an
IfExpr. This is always codegen'd by IfExpr's
GetCodegendComputeFnWrapper() method. There is a separate Jira
IMPALA-7655 to improve codegen of IfExpr.

Minor corrections:
  Correct the link to llvm tutorial in LlvmCodegen.

PERFORMANCE:
  I tested performance on a local mini-cluster. I wrote some
  pathological queries to test the new code. The new codegen'd code is
  very similar in performance. Both ValidTupleIdExpr and
  IsNotEmptyPredicate seem very slightly faster than the old code.
  Overall these changes are not purely for performance but to move away
  from GetCodegendComputeFnWrapper.

TESTING:
  The changed scalar expressions are well exercised by current tests.
  Ran exhaustive end-to-end tests.

Change-Id: Ifb87b9e3b879c278ce8638d97bcb320a7555a6b3
Reviewed-on: http://gerrit.cloudera.org:8080/12068
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> Proper codegen for TupleIsNullPredicate, IsNotEmptyPredicate and ValidTupleId
> -----------------------------------------------------------------------------
>
>                 Key: IMPALA-7657
>                 URL: https://issues.apache.org/jira/browse/IMPALA-7657
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Backend
>            Reporter: Tim Armstrong
>            Assignee: Andrew Sherman
>            Priority: Major
>              Labels: codegen, performance
>
> These utility functions use GetCodegendComputeFnWrapper() to call the 
> interpreted path but instead we could codegen them into efficient code. We 
> could either use IRBuilder or, if possible, cross-compile the implementation 
> and substitute in constants.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to