You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Bikramjeet Vig (JIRA)" <ji...@apache.org> on 2017/10/26 22:25:01 UTC
[jira] [Resolved] (IMPALA-4236) Codegen CopyRows() for select nodes
[ https://issues.apache.org/jira/browse/IMPALA-4236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bikramjeet Vig resolved IMPALA-4236.
------------------------------------
Resolution: Fixed
Fix Version/s: Impala 2.11.0
https://github.com/apache/incubator-impala/commit/ca55b5926ecfaf764f3f46add4391588e18b90f0
IMPALA-4236: Codegen CopyRows() for select nodes
Testing:
Added test case to verify that CopyRows in select node is successfully
codegened.
Improved test coverage for select node with limit.
Performance:
Queries used (num_nodes set to 1):
500 Predicates: select * from (select * from tpch_parquet.lineitem
limit 6001215) t1 where l_partkey > 10 and l_extendedprice > 10000 and
l_linenumber > 1 and l_comment >'foo0' .... and l_comment >'foo500'
order by l_orderkey limit 10;
1 Predicate: select * from (select * from tpch_parquet.lineitem
limit 6001215) t1 where l_partkey > 10 order by l_orderkey limit 10;
{noformat}
+--------------+-----------------------------------------------------+
| | 500 Predicates | 1 Predicate |
| +------------+-------------+------------+-------------+
| | After | Before | After | Before |
+--------------+------------+-------------+------------+-------------+
| Select Node | 12s385ms | 1m1s | 234ms | 797ms |
| Codegen time | 2s619ms | 1s962ms | 200ms | 181ms |
+--------------+------------+-------------+------------+-------------+
{noformat}
Change-Id: Ie0d496d004418468e16b6f564f90f45ebbf87c1e
Reviewed-on: http://gerrit.cloudera.org:8080/8196
Reviewed-by: Bikramjeet Vig <bi...@cloudera.com>
Tested-by: Impala Public Jenkins
> Codegen CopyRows() for select nodes
> -----------------------------------
>
> Key: IMPALA-4236
> URL: https://issues.apache.org/jira/browse/IMPALA-4236
> Project: IMPALA
> Issue Type: Improvement
> Components: Backend
> Affects Versions: Impala 2.8.0
> Reporter: Michael Ho
> Assignee: Bikramjeet Vig
> Priority: Minor
> Labels: codegen, ramp-up
> Fix For: Impala 2.11.0
>
>
> We should codegen CopyRows(() in Select node. We can already codegen EvalConjuncts() and inline it into a codegen'd version of CopyRows. One can look at how scanners codegen their conjuncts as examples.
> {noformat}
> bool SelectNode::CopyRows(RowBatch* output_batch) {
> ExprContext** conjunct_ctxs = &conjunct_ctxs_[0];
> int num_conjunct_ctxs = conjunct_ctxs_.size();
> while (child_row_idx_ < child_row_batch_->num_rows()) {
> // Add a new row to output_batch
> int dst_row_idx = output_batch->AddRow();
> TupleRow* dst_row = output_batch->GetRow(dst_row_idx);
> TupleRow* src_row = child_row_batch_->GetRow(child_row_idx_);
> // Make sure to increment row idx before returning.
> ++child_row_idx_;
> if (EvalConjuncts(conjunct_ctxs, num_conjunct_ctxs, src_row)) { <<----
> output_batch->CopyRow(src_row, dst_row);
> output_batch->CommitLastRow();
> ++num_rows_returned_;
> COUNTER_SET(rows_returned_counter_, num_rows_returned_);
> if (ReachedLimit() || output_batch->AtCapacity()) return true;
> }
> }
> return output_batch->AtCapacity();
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)