mirror of
https://github.com/apache/impala.git
synced 2025-12-22 19:35:22 -05:00
master
11 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f98b697c7b |
IMPALA-13929: Make 'functional-query' the default workload in tests
This change adds get_workload() to ImpalaTestSuite and removes it from all test suites that already returned 'functional-query'. get_workload() is also removed from CustomClusterTestSuite which used to return 'tpch'. All other changes besides impala_test_suite.py and custom_cluster_test_suite.py are just mass removals of get_workload() functions. The behavior is only changed in custom cluster tests that didn't override get_workload(). By returning 'functional-query' instead of 'tpch', exploration_strategy() will no longer return 'core' in 'exhaustive' test runs. See IMPALA-3947 on why workload affected exploration_strategy. An example for affected test is TestCatalogHMSFailures which was skipped both in core and exhaustive runs before this change. get_workload() functions that return a different workload than 'functional-query' are not changed - it is possible that some of these also don't handle exploration_strategy() as expected, but individually checking these tests is out of scope in this patch. Change-Id: I9ec6c41ffb3a30e1ea2de773626d1485c69fe115 Reviewed-on: http://gerrit.cloudera.org:8080/22726 Reviewed-by: Riza Suminto <riza.suminto@cloudera.com> Reviewed-by: Daniel Becker <daniel.becker@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> |
||
|
|
1dbde2c197 |
IMPALA-12790: Fix overestimation in ScanNode.getInputCardinality
ScanNode.getInputCardinality() can overestimate if LIMIT is large. If table cardinality stats exist and it is less than the LIMIT, then the table cardinality should be returned. This patch adds those fixes and more test cases under small-query-opt.test. This also moves tests added by IMPALA-5602 to small-query-opt.test since only PlannerTest.testSmallQueryOptimization runs with EXEC_SINGLE_NODE_ROWS_THRESHOLD > 0. Testing: - Pass FE tests. Change-Id: Icc5b39a7684fb8748185349d0b80baf8dcd6b126 Reviewed-on: http://gerrit.cloudera.org:8080/21005 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> |
||
|
|
82bd087fb1 |
IMPALA-11973: Add absolute_import, division to all eligible Python files
This takes steps to make Python 2 behave like Python 3 as
a way to flush out issues with running on Python 3. Specifically,
it handles two main differences:
1. Python 3 requires absolute imports within packages. This
can be emulated via "from __future__ import absolute_import"
2. Python 3 changed division to "true" division that doesn't
round to an integer. This can be emulated via
"from __future__ import division"
This changes all Python files to add imports for absolute_import
and division. For completeness, this also includes print_function in the
import.
I scrutinized each old-division location and converted some locations
to use the integer division '//' operator if it needed an integer
result (e.g. for indices, counts of records, etc). Some code was also using
relative imports and needed to be adjusted to handle absolute_import.
This fixes all Pylint warnings about no-absolute-import and old-division,
and these warnings are now banned.
Testing:
- Ran core tests
Change-Id: Idb0fcbd11f3e8791f5951c4944be44fb580e576b
Reviewed-on: http://gerrit.cloudera.org:8080/19588
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Joe McDonnell <joemcdonnell@cloudera.com>
|
||
|
|
763acffb74 |
IMPALA-6590: Disable expr rewrites and codegen for VALUES() statements
Expression rewrites for VALUES() could result in performance regression
since there is virtually no benefit of rewrite, if the expression will
only ever be evaluated once. The overhead of rewrites in some cases
could be huge, especially if there are several constant expressions.
The regression also seems to non-linearly increase as number of columns
increases. Similarly, there is no value in doing codegen for such const
expressions.
The rewriteExprs() for ValuesStmt class was overridden with an empty
function body. As a result rewrites for VALUES() is a no-op.
Codegen was disabled for const expressions within a UNION node, if
the UNION node is not within a subplan. This applies to all UNION nodes
with const expressions (and not just limited to UNION nodes associated
with a VALUES clause).
The decision for whether or not to enable codegen for const expressions
in a UNION is made in the planner when a UnionNode is initialized. A new
member 'is_codegen_disabled' was added to the thrift struct TExprNode
for communicating this decision to backend. The Optimizer should take
decisions it can and so it seemed like the right place to disable/enable
codegen. The infrastructure is generic and could be extended in future
to selectively disable codegen for any given expression, if needed.
Testing:
- Added a new e2e test case in tests/query_test/test_codegen.py, which
tests the different scenarios involving UNION with const expressions.
- Passed exhaustive unit-tests.
- Ran manual tests to validate that the non-linear regression in VALUES
clause when involving increasing number of columns is no longer seen.
Results below.
for i in 256 512 1024 2048 4096 8192 16384 32768;
do (echo 'VALUES ('; for x in $(seq $i);
do echo "cast($x as string),"; done;
echo "NULL); profile;") |
time impala-shell.sh -f /dev/stdin |& grep Analysis; done
Base:
- Analysis finished: 20.137ms (19.215ms)
- Analysis finished: 46.275ms (44.597ms)
- Analysis finished: 119.642ms (116.663ms)
- Analysis finished: 361.195ms (355.856ms)
- Analysis finished: 1s277ms (1s266ms)
- Analysis finished: 5s664ms (5s640ms)
- Analysis finished: 29s689ms (29s646ms)
- Analysis finished: 2m (2m)
Test:
- Analysis finished: 1.868ms (986.520us)
- Analysis finished: 3.195ms (1.856ms)
- Analysis finished: 7.332ms (3.484ms)
- Analysis finished: 13.896ms (8.071ms)
- Analysis finished: 31.015ms (18.963ms)
- Analysis finished: 60.157ms (38.125ms)
- Analysis finished: 113.694ms (67.642ms)
- Analysis finished: 253.044ms (163.180ms)
Change-Id: I229d67b821968321abd8f97f7c89cf2617000d8d
Reviewed-on: http://gerrit.cloudera.org:8080/13645
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
|
||
|
|
e6c930a38f |
IMPALA-9747: More fine-grained codegen for text file scanners
Currently if the materialization of any column cannot be codegen'd
because its type is unsupported (e.g. CHAR(N)), the whole codegen is
cancelled for the text scanner.
This commit adds the function TextConverter::SupportsCodegenWriteSlot
that returns whether the given ColumnType is supported. If the type is
not supported, HdfsScanner codegens code that calls the interpreted
version instead of failing codegen. For other columns codegen is used as
usually.
Benchmarks:
Copied and modified a TPCH table with scale factor 5 to add a CHAR
column to it::
USE tpch5;
CREATE TABLE IF NOT EXISTS lineitem_char AS
SELECT *, CAST(l_shipdate AS CHAR(10)) l_shipdate_char
FROM lineitem;
Run the following query 100 times after one warm-up run with and
without this change:
SELECT *
FROM tpch5.lineitem_char
WHERE
l_partkey BETWEEN 500 AND 500000 AND
l_linestatus = 'F' AND
l_quantity < 35 AND
l_extendedprice BETWEEN 2000 AND 8000 AND
l_discount > 0 AND
l_tax BETWEEN 0.04 AND 0.06 AND
l_returnflag IN ('A', 'N') AND
l_shipdate_char < '1996-06-20'
ORDER BY l_shipdate_char
LIMIT 10;
Without this commit: mean: 2.92, standard deviation: 0.13.
With this commit: mean: 2.21, standard deviation: 0.072.
Testing:
The interesting cases regarding char are covered in
|
||
|
|
d4648e87b4 |
IMPALA-4356,IMPALA-7331: codegen all ScalarExprs
Based on initial draft patch by Pooja Nilangekar.
Codegen'd expressions can be executed in two ways - either by
being called directly from a fully codegend function, or from
interpreted code via a function pointer (previously
ScalarFnCall::scalar_fn_wrapper_).
This change moves the function pointer from ScalarFnCall to its
base class ScalarExpr, so the full expr tree can be codegen'd, not
just the ScalarFnCall subtrees. The key refactoring and improvements
are:
* ScalarExpr::Get*Val() switches between interpreted and the codegen'd
function pointer code paths in an inline function, avoiding a
virtual function call to ScalarFnCal::Get*Val().
* Boilerplate logic is moved to ScalarExpr::GetCodegendComputeFn(),
which calls a virtual function GetCodegenComputeFnImpl().
* ScalarFnCall's logic for deciding whether to interpret or codegen is
better abstracted and exposed to ScalarExpr as IsInterpretable()
and ShouldCodegen() methods.
* The ScalarExpr::codegend_compute_fn_ function pointer is only
populated for expressions that are "codegen entry points". These
include the roots of expr trees and non-root expressions
where the parent expression calls Get*Val() from the
pseudo-codegend GetCodegendComputeFnWrapper().
* ScalarFnCall is always initialised for interpreted execution.
Otherwise the function pointer is needed for non-root expressions,
e.g. to support ScalarExprEvaluator::GetConstantVal().
* Latent bugs/gaps for codegen of CollectionVal are fixed. CollectionVal
is modified to use the StringVal memory layout to allow code sharing
with StringVal. These fixes allowed simplification of
IsNotEmptyPredicate codegen (from IMPALA-7657).
I chose to tackle two problems in one change - adding support for
generating codegen'd function pointers for all ScalarExprs, and adding
the "entry point" concept - to avoid a blow-up in the number of
codegen'd entry points that could lead to longer codegen times and/or
worse code because of inlining changes.
IMPALA-7331 (CHAR codegen support functions) is also fixed because
it was simpler to enable CHAR codegen within ScalarExpr than to carry
forward the exiting CHAR workarounds from ScalarFnCall. The
CHAR-specific codegen support required in the scalar expr subsystem is
very limited. StringVal intermediates are used everywhere. Only
SlotRef actually operates on the different tuple layout, and the
required codegen support for SlotRef already exists for UDA
intermediates anyway.
Testing:
* Ran exhaustive tests.
Perf:
* Ran a basic insert benchmark, which went from 10.1s to 7.6s
create table foo stored as parquet as
select case when l_orderkey % 2 = 0 then 'aaa' else 'bbb' end
from tpch30_parquet.lineitem;
* Ran a basic CHAR expr test:
set num_nodes=1;
set mt_dop=1;
select count(*) from lineitem
where cast(l_linestatus as CHAR(2)) = 'O ' and
cast(l_returnflag as CHAR(2)) = 'N '
The time spent in the scan went from 520ms to 220ms.
* Added perf regression test to tpcds-insert, similar to the manual
benchmark.
* Ran single-node TPC-H with large and small scale factors, to estimate
impact on execution perf and query startup time, respectively.
+----------+-----------------------+---------+------------+------------+----------------+
| Workload | File Format | Avg (s) | Delta(Avg) | GeoMean(s) | Delta(GeoMean) |
+----------+-----------------------+---------+------------+------------+----------------+
| TPCH(30) | parquet / none / none | 6.84 | -0.18% | 4.49 | -0.31% |
+----------+-----------------------+---------+------------+------------+----------------+
+----------+----------+-----------------------+--------+-------------+------------+-----------+----------------+-------+----------------+---------+--------+
| Workload | Query | File Format | Avg(s) | Base Avg(s) | Delta(Avg) | StdDev(%) | Base StdDev(%) | Iters | Median Diff(%) | MW Zval | Tval |
+----------+----------+-----------------------+--------+-------------+------------+-----------+----------------+-------+----------------+---------+--------+
| TPCH(30) | TPCH-Q20 | parquet / none / none | 2.58 | 2.47 | +4.18% | 1.29% | 0.88% | 5 | +4.12% | 2.31 | 5.81 |
| TPCH(30) | TPCH-Q17 | parquet / none / none | 4.81 | 4.61 | +4.33% | 2.18% | 2.15% | 5 | +3.91% | 1.73 | 3.09 |
| TPCH(30) | TPCH-Q21 | parquet / none / none | 26.45 | 26.16 | +1.09% | 0.37% | 0.50% | 5 | +1.36% | 2.02 | 3.94 |
| TPCH(30) | TPCH-Q9 | parquet / none / none | 15.92 | 15.75 | +1.09% | 2.87% | 1.65% | 5 | +0.88% | 0.29 | 0.73 |
| TPCH(30) | TPCH-Q12 | parquet / none / none | 2.38 | 2.35 | +1.12% | 1.64% | 1.11% | 5 | +0.80% | 1.15 | 1.26 |
| TPCH(30) | TPCH-Q14 | parquet / none / none | 2.94 | 2.91 | +1.13% | 7.68% | 5.37% | 5 | -0.34% | -0.29 | 0.27 |
| TPCH(30) | TPCH-Q18 | parquet / none / none | 18.10 | 18.02 | +0.42% | 2.70% | 0.56% | 5 | +0.28% | 0.29 | 0.34 |
| TPCH(30) | TPCH-Q8 | parquet / none / none | 4.72 | 4.72 | -0.04% | 1.20% | 1.65% | 5 | +0.05% | 0.00 | -0.04 |
| TPCH(30) | TPCH-Q19 | parquet / none / none | 3.92 | 3.93 | -0.26% | 1.08% | 2.36% | 5 | +0.20% | 0.58 | -0.23 |
| TPCH(30) | TPCH-Q6 | parquet / none / none | 1.27 | 1.27 | -0.28% | 0.22% | 0.88% | 5 | +0.09% | 0.29 | -0.68 |
| TPCH(30) | TPCH-Q16 | parquet / none / none | 2.64 | 2.65 | -0.45% | 1.65% | 0.65% | 5 | -0.24% | -0.58 | -0.57 |
| TPCH(30) | TPCH-Q22 | parquet / none / none | 3.10 | 3.13 | -0.76% | 1.47% | 1.12% | 5 | -0.21% | -0.29 | -0.93 |
| TPCH(30) | TPCH-Q2 | parquet / none / none | 1.20 | 1.21 | -0.80% | 2.26% | 2.47% | 5 | -0.82% | -1.15 | -0.53 |
| TPCH(30) | TPCH-Q4 | parquet / none / none | 1.97 | 1.99 | -1.37% | 1.84% | 3.21% | 5 | -0.47% | -0.58 | -0.83 |
| TPCH(30) | TPCH-Q13 | parquet / none / none | 11.53 | 11.63 | -0.91% | 0.46% | 0.49% | 5 | -0.95% | -2.02 | -3.08 |
| TPCH(30) | TPCH-Q10 | parquet / none / none | 5.13 | 5.21 | -1.51% | 2.24% | 4.05% | 5 | -0.94% | -0.58 | -0.73 |
| TPCH(30) | TPCH-Q5 | parquet / none / none | 3.61 | 3.66 | -1.40% | 0.66% | 0.79% | 5 | -1.33% | -1.73 | -3.05 |
| TPCH(30) | TPCH-Q7 | parquet / none / none | 19.42 | 19.71 | -1.52% | 1.34% | 1.39% | 5 | -1.22% | -1.44 | -1.76 |
| TPCH(30) | TPCH-Q3 | parquet / none / none | 5.08 | 5.15 | -1.49% | 1.34% | 0.73% | 5 | -1.35% | -1.44 | -2.20 |
| TPCH(30) | TPCH-Q15 | parquet / none / none | 3.42 | 3.49 | -1.92% | 0.93% | 1.47% | 5 | -1.53% | -1.15 | -2.49 |
| TPCH(30) | TPCH-Q11 | parquet / none / none | 1.15 | 1.19 | -3.17% | 2.27% | 1.95% | 5 | -4.21% | -1.15 | -2.41 |
| TPCH(30) | TPCH-Q1 | parquet / none / none | 9.26 | 9.63 | -3.85% | 0.62% | 0.59% | 5 | -3.78% | -2.31 | -10.25 |
+----------+----------+-----------------------+--------+-------------+------------+-----------+----------------+-------+----------------+---------+--------+
Cluster Name: UNKNOWN
Lab Run Info: UNKNOWN
Impala Version: impalad version 3.2.0-SNAPSHOT RELEASE ()
Baseline Impala Version: impalad version 3.2.0-SNAPSHOT RELEASE (2019-03-19)
+----------+-----------------------+---------+------------+------------+----------------+
| Workload | File Format | Avg (s) | Delta(Avg) | GeoMean(s) | Delta(GeoMean) |
+----------+-----------------------+---------+------------+------------+----------------+
| TPCH(2) | parquet / none / none | 0.90 | -0.08% | 0.80 | -0.05% |
+----------+-----------------------+---------+------------+------------+----------------+
+----------+----------+-----------------------+--------+-------------+------------+-----------+----------------+-------+----------------+---------+-------+
| Workload | Query | File Format | Avg(s) | Base Avg(s) | Delta(Avg) | StdDev(%) | Base StdDev(%) | Iters | Median Diff(%) | MW Zval | Tval |
+----------+----------+-----------------------+--------+-------------+------------+-----------+----------------+-------+----------------+---------+-------+
| TPCH(2) | TPCH-Q18 | parquet / none / none | 1.22 | 1.19 | +1.93% | 3.81% | 4.46% | 20 | +3.34% | 1.62 | 1.46 |
| TPCH(2) | TPCH-Q10 | parquet / none / none | 0.74 | 0.73 | +1.97% | 3.36% | 2.94% | 20 | +0.97% | 1.88 | 1.95 |
| TPCH(2) | TPCH-Q11 | parquet / none / none | 0.49 | 0.48 | +1.91% | 6.19% | 4.64% | 20 | +0.25% | 0.95 | 1.09 |
| TPCH(2) | TPCH-Q4 | parquet / none / none | 0.43 | 0.43 | +1.99% | 6.26% | 5.86% | 20 | +0.15% | 0.92 | 1.03 |
| TPCH(2) | TPCH-Q15 | parquet / none / none | 0.50 | 0.49 | +1.82% | 7.32% | 6.35% | 20 | +0.26% | 1.01 | 0.83 |
| TPCH(2) | TPCH-Q1 | parquet / none / none | 0.98 | 0.97 | +0.79% | 4.64% | 2.73% | 20 | +0.36% | 0.77 | 0.65 |
| TPCH(2) | TPCH-Q19 | parquet / none / none | 0.83 | 0.83 | +0.65% | 3.33% | 2.80% | 20 | +0.44% | 2.18 | 0.67 |
| TPCH(2) | TPCH-Q14 | parquet / none / none | 0.62 | 0.62 | +0.97% | 2.86% | 1.00% | 20 | +0.04% | 0.13 | 1.42 |
| TPCH(2) | TPCH-Q3 | parquet / none / none | 0.88 | 0.87 | +0.57% | 2.17% | 1.74% | 20 | +0.29% | 1.15 | 0.92 |
| TPCH(2) | TPCH-Q12 | parquet / none / none | 0.53 | 0.53 | +0.27% | 4.58% | 5.78% | 20 | +0.46% | 1.47 | 0.16 |
| TPCH(2) | TPCH-Q17 | parquet / none / none | 0.72 | 0.72 | +0.15% | 3.64% | 5.55% | 20 | +0.21% | 0.86 | 0.10 |
| TPCH(2) | TPCH-Q21 | parquet / none / none | 2.05 | 2.05 | +0.21% | 1.99% | 2.37% | 20 | +0.01% | 0.25 | 0.30 |
| TPCH(2) | TPCH-Q5 | parquet / none / none | 1.28 | 1.27 | +0.24% | 1.61% | 1.80% | 20 | -0.02% | -0.57 | 0.44 |
| TPCH(2) | TPCH-Q13 | parquet / none / none | 1.27 | 1.27 | -0.34% | 1.69% | 1.83% | 20 | -0.20% | -1.65 | -0.61 |
| TPCH(2) | TPCH-Q7 | parquet / none / none | 1.72 | 1.73 | -0.55% | 2.40% | 1.69% | 20 | -0.03% | -0.42 | -0.83 |
| TPCH(2) | TPCH-Q8 | parquet / none / none | 1.27 | 1.28 | -0.68% | 3.10% | 3.89% | 20 | -0.06% | -0.54 | -0.62 |
| TPCH(2) | TPCH-Q6 | parquet / none / none | 0.36 | 0.36 | -0.84% | 0.79% | 3.51% | 20 | -0.07% | -0.36 | -1.04 |
| TPCH(2) | TPCH-Q2 | parquet / none / none | 0.65 | 0.65 | -1.17% | 4.76% | 5.99% | 20 | -0.05% | -0.25 | -0.69 |
| TPCH(2) | TPCH-Q9 | parquet / none / none | 1.59 | 1.62 | -2.01% | 1.45% | 5.12% | 20 | -0.16% | -1.24 | -1.69 |
| TPCH(2) | TPCH-Q20 | parquet / none / none | 0.68 | 0.69 | -1.73% | 4.35% | 4.43% | 20 | -0.49% | -1.74 | -1.25 |
| TPCH(2) | TPCH-Q22 | parquet / none / none | 0.38 | 0.40 | -2.89% | 7.42% | 6.39% | 20 | -0.21% | -0.66 | -1.34 |
| TPCH(2) | TPCH-Q16 | parquet / none / none | 0.59 | 0.62 | -4.01% | 6.33% | 5.83% | 20 | -4.72% | -1.39 | -2.13 |
+----------+----------+-----------------------+--------+-------------+------------+-----------+----------------+-------+----------------+---------+-------+
Change-Id: I839d7a3a2f5e1309c33a1f66013ef11628c5dc11
Reviewed-on: http://gerrit.cloudera.org:8080/12797
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
|
||
|
|
8d7f638654 |
IMPALA-7212: Removes --use_krpc flag and remove old DataStream services
This change removes the flag --use_krpc which allows users to fall back to using Thrift based implementation of DataStream services. This flag was originally added during development of IMPALA-2567. It has served its purpose. As we port more ImpalaInternalServices to use KRPC, it's becoming increasingly burdensome to maintain parallel implementation of the RPC handlers. Therefore, going forward, KRPC is always enabled. This change removes the Thrift based implemenation of DataStreamServices and also simplifies some of the tests which were skipped when KRPC is disabled. Testing done: core debug build. Change-Id: Icfed200751508478a3d728a917448f2dabfc67c3 Reviewed-on: http://gerrit.cloudera.org:8080/10835 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> |
||
|
|
540611e863 |
IMPALA-7288: Fix Codegen Crash in FinalizeModule()
Currently codegen crashed during FinalizeModule() where it tries to clean up half-baked handcrafted functions. This happens only for the cases where the code generating the handcrafted IR calls eraseFromParent() on failure which also deletes the memory held by the function pointer and therefore causes a crash during clean up in FinalizeModule(). Testing: Added regression tests that verify that failure code paths in the previously offending methods don't crash Impala. Change-Id: I2f0b527909a9fb3090996bb7510e4d58350c21b0 Reviewed-on: http://gerrit.cloudera.org:8080/10933 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> |
||
|
|
51ff47d05e |
IMPALA-5168: Codegen HASH_PARTITIONED KrpcDataStreamSender::Send()
This change codegens the hash partitioning logic of KrpcDataStreamSender::Send() when the partitioning strategy is HASH_PARTITIONED. It does so by unrolling the loop which evaluates each row against the partitioning expressions and hashes the result. It also replaces the number of channels of that sender with a constant at runtime. With this change, we get reasonable speedup with some benchmarks: +------------+-----------------------+---------+------------+------------+----------------+ | Workload | File Format | Avg (s) | Delta(Avg) | GeoMean(s) | Delta(GeoMean) | +------------+-----------------------+---------+------------+------------+----------------+ | TPCH(_300) | parquet / none / none | 20.03 | -6.44% | 13.56 | -7.15% | +------------+-----------------------+---------+------------+------------+----------------+ +---------------------+-----------------------+---------+------------+------------+----------------+ | Workload | File Format | Avg (s) | Delta(Avg) | GeoMean(s) | Delta(GeoMean) | +---------------------+-----------------------+---------+------------+------------+----------------+ | TARGETED-PERF(_300) | parquet / none / none | 58.59 | -5.56% | 12.28 | -5.30% | +---------------------+-----------------------+---------+------------+------------+----------------+ +-------------------------+-----------------------+---------+------------+------------+----------------+ | Workload | File Format | Avg (s) | Delta(Avg) | GeoMean(s) | Delta(GeoMean) | +-------------------------+-----------------------+---------+------------+------------+----------------+ | TPCDS-UNMODIFIED(_1000) | parquet / none / none | 15.60 | -3.10% | 7.16 | -4.33% | +-------------------------+-----------------------+---------+------------+------------+----------------+ +-------------------+-----------------------+---------+------------+------------+----------------+ | Workload | File Format | Avg (s) | Delta(Avg) | GeoMean(s) | Delta(GeoMean) | +-------------------+-----------------------+---------+------------+------------+----------------+ | TPCH_NESTED(_300) | parquet / none / none | 30.93 | -3.02% | 17.46 | -4.71% | +-------------------+-----------------------+---------+------------+------------+----------------+ Change-Id: I1c44cc9312c062cc7a5a4ac9156ceaa31fb887ff Reviewed-on: http://gerrit.cloudera.org:8080/10421 Reviewed-by: Michael Ho <kwho@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> |
||
|
|
ca55b5926e |
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; +--------------+-----------------------------------------------------+ | | 500 Predicates | 1 Predicate | | +------------+-------------+------------+-------------+ | | After | Before | After | Before | +--------------+------------+-------------+------------+-------------+ | Select Node | 12s385ms | 1m1s | 234ms | 797ms | | Codegen time | 2s619ms | 1s962ms | 200ms | 181ms | +--------------+------------+-------------+------------+-------------+ Change-Id: Ie0d496d004418468e16b6f564f90f45ebbf87c1e Reviewed-on: http://gerrit.cloudera.org:8080/8196 Reviewed-by: Bikramjeet Vig <bikramjeet.vig@cloudera.com> Tested-by: Impala Public Jenkins |
||
|
|
c4d284f3cc |
IMPALA-5483: Automatically disable codegen for small queries
This is similar to the single-node execution optimisation, but applies to slightly larger queries that should run in a distributed manner but won't benefit from codegen. This adds a new query option disable_codegen_rows_threshold that defaults to 50,000. If fewer than this number of rows are processed by a plan node per impalad, the cost of codegen almost certainly outweighs the benefit. Using rows processed as a threshold is justified by a simple model that assumes the cost of codegen and execution per row for the same operation are proportional. E.g. if x is the complexity of the operation, n is the number of rows processed, C is a constant factor giving the cost of codegen and Ec/Ei are constant factor giving the cost of codegen'd and interpreted execution and d, then the cost of the codegen'd operator is C * x + Ec * x * n and the cost of the interpreted operator is Ei * x * n. Rearranging means that interpretation is cheaper if n < C / (Ei - Ec), i.e. that (at least with the simplified model) it makes sense to choose interpretation or codegen based on a constant threshold. The model also implies that it is somewhat safer to choose codegen because the additional cost of codegen is O(1) but the additional cost of interpretation is O(n). I ran some experiments with TPC-H Q1, varying the input table size, to determine what the cut-over point where codegen was beneficial was. The cutover was around 150k rows per node for both text and parquet. At 50k rows per node disabling codegen was very beneficial - around 0.12s versus 0.24s. To be somewhat conservative I set the default threshold to 50k rows. On more complex queries, e.g. TPC-H Q10, the cutover tends to be higher because there are plan nodes that process many fewer than the max rows. Fix a couple of minor issues in the frontend - the numNodes_ calculation could return 0 for Kudu, and the single node optimization didn't handle the case where for a scan node with conjuncts, a limit and missing stats correctly (it considered the estimate still valid.) Testing: Updated e2e tests that set disable_codegen to set disable_codegen_rows_threshold to 0, so that those tests run both with and without codegen still. Added an e2e test to make sure that the optimisation is applied in the backend. Added planner tests for various cases where codegen should and shouldn't be disabled. Perf: Added a targeted perf test for a join+agg over a small input, which benefits from this change. Change-Id: I273bcee58641f5b97de52c0b2caab043c914b32e Reviewed-on: http://gerrit.cloudera.org:8080/7153 Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com> Tested-by: Impala Public Jenkins |