You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by jo...@apache.org on 2022/05/24 21:09:04 UTC
[impala] branch master updated (d00d3463c -> d0cfdd139)
This is an automated email from the ASF dual-hosted git repository.
joemcdonnell pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
from d00d3463c Revert "IMPALA-9057: Disable test_transactional_insert_events"
new b58966b98 IMPALA-11289: Push-down compound predicates to iceberg
new ad915ca58 IMPALA-11306: Create symlink for dataset of scale factor 1
new d0cfdd139 IMPALA-10199: Add Ubuntu 20 toolchain configuration
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
bin/bootstrap_toolchain.py | 4 +-
bin/impala-config.sh | 8 +-
docker/CMakeLists.txt | 2 +
.../org/apache/impala/planner/IcebergScanNode.java | 131 ++++--
.../java/org/apache/impala/util/IcebergUtil.java | 50 ++-
testdata/datasets/tpcds/preload | 6 +
testdata/datasets/tpch/preload | 6 +
.../iceberg-compound-predicate-push-down.test | 461 +++++++++++++++++++++
tests/query_test/test_iceberg.py | 6 +-
9 files changed, 612 insertions(+), 62 deletions(-)
create mode 100644 testdata/workloads/functional-query/queries/QueryTest/iceberg-compound-predicate-push-down.test
[impala] 03/03: IMPALA-10199: Add Ubuntu 20 toolchain configuration
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit d0cfdd139fe81a52f420c7878b5e90c6e30ea6fe
Author: Joe McDonnell <jo...@cloudera.com>
AuthorDate: Sun May 22 16:47:06 2022 -0700
IMPALA-10199: Add Ubuntu 20 toolchain configuration
Ubuntu 20 has been using the toolchain from Ubuntu 18.
Since Ubuntu 20 has been added to the toolchain, this
switches Impala to use a toolchain with Ubuntu 20 support
and uses the Ubuntu 20 bits. This is expected to help
with IMPALA-10962.
Testing:
- Ran a core build on Ubuntu 20
Change-Id: If2394b668ef3c56b1a4c0773fd5e4ff92be4a846
Reviewed-on: http://gerrit.cloudera.org:8080/18559
Reviewed-by: Joe McDonnell <jo...@cloudera.com>
Reviewed-by: Michael Smith <mi...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
bin/bootstrap_toolchain.py | 4 +---
bin/impala-config.sh | 8 ++++----
docker/CMakeLists.txt | 2 ++
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/bin/bootstrap_toolchain.py b/bin/bootstrap_toolchain.py
index 6624c6652..60bb57093 100755
--- a/bin/bootstrap_toolchain.py
+++ b/bin/bootstrap_toolchain.py
@@ -71,8 +71,6 @@ from string import Template
# Maps return values from 'lsb_release -irs' to the corresponding OS labels for both the
# toolchain and the CDP components.
-# For Ubuntu20.04, the toolchain and CDP components to be mapped to are still 18.04
-# based, due to the unavailability of 20.04 parts on EC2.
OsMapping = namedtuple('OsMapping', ['lsb_release', 'toolchain', 'cdh'])
OS_MAPPING = [
OsMapping("centos5", "ec2-package-centos-5", None),
@@ -96,7 +94,7 @@ OS_MAPPING = [
OsMapping("ubuntu15.10", "ec2-package-ubuntu-14-04", None),
OsMapping('ubuntu16.04', "ec2-package-ubuntu-16-04", "ubuntu1604"),
OsMapping('ubuntu18.04', "ec2-package-ubuntu-18-04", "ubuntu1804"),
- OsMapping('ubuntu20.04', "ec2-package-ubuntu-18-04", "ubuntu1804")
+ OsMapping('ubuntu20.04', "ec2-package-ubuntu-20-04", "ubuntu2004")
]
diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index bf8c360cc..8c48ffc55 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -77,7 +77,7 @@ export IMPALA_VERSION=4.1.0-SNAPSHOT
# moving to a different build of the toolchain, e.g. when a version is bumped or a
# compile option is changed. The build id can be found in the output of the toolchain
# build jobs, it is constructed from the build number and toolchain git hash prefix.
-export IMPALA_TOOLCHAIN_BUILD_ID=158-18c815af9d
+export IMPALA_TOOLCHAIN_BUILD_ID=162-3b0a0d993a
# Versions of toolchain dependencies.
# -----------------------------------
export IMPALA_AVRO_VERSION=1.7.4-p5
@@ -120,9 +120,9 @@ export IMPALA_LIBEV_VERSION=4.20-p1
unset IMPALA_LIBEV_URL
export IMPALA_LIBUNWIND_VERSION=1.3-rc1-p3
unset IMPALA_LIBUNWIND_URL
-export IMPALA_LLVM_VERSION=5.0.1-p3
+export IMPALA_LLVM_VERSION=5.0.1-p4
unset IMPALA_LLVM_URL
-export IMPALA_LLVM_ASAN_VERSION=5.0.1-p3
+export IMPALA_LLVM_ASAN_VERSION=5.0.1-p4
unset IMPALA_LLVM_ASAN_URL
# Maximum memory available for mini-cluster and CDH cluster
@@ -135,7 +135,7 @@ export IMPALA_LLVM_UBSAN_BASE_VERSION=5.0.1
# Debug builds should use the release+asserts build to get additional coverage.
# Don't use the LLVM debug build because the binaries are too large to distribute.
-export IMPALA_LLVM_DEBUG_VERSION=5.0.1-asserts-p3
+export IMPALA_LLVM_DEBUG_VERSION=5.0.1-asserts-p4
unset IMPALA_LLVM_DEBUG_URL
export IMPALA_LZ4_VERSION=1.9.3
unset IMPALA_LZ4_URL
diff --git a/docker/CMakeLists.txt b/docker/CMakeLists.txt
index 9b45a11a4..37396c67f 100644
--- a/docker/CMakeLists.txt
+++ b/docker/CMakeLists.txt
@@ -39,6 +39,8 @@ if(${LSB_RELEASE_ID} STREQUAL "Ubuntu" AND ${LSB_RELEASE_VERSION} STREQUAL "16.0
set(DISTRO_BASE_IMAGE "ubuntu:16.04")
elseif(${LSB_RELEASE_ID} STREQUAL "Ubuntu" AND ${LSB_RELEASE_VERSION} STREQUAL "18.04")
set(DISTRO_BASE_IMAGE "ubuntu:18.04")
+elseif(${LSB_RELEASE_ID} STREQUAL "Ubuntu" AND ${LSB_RELEASE_VERSION} STREQUAL "20.04")
+ set(DISTRO_BASE_IMAGE "ubuntu:20.04")
else()
set(DISTRO_BASE_IMAGE "UNSUPPORTED")
endif()
[impala] 02/03: IMPALA-11306: Create symlink for dataset of scale factor 1
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit ad915ca58eaa004925d545057e9ebdba5d62131b
Author: Riza Suminto <ri...@cloudera.com>
AuthorDate: Thu May 19 15:08:12 2022 -0700
IMPALA-11306: Create symlink for dataset of scale factor 1
single_node_perf_run.py and load-data.py can fail if user set scale
factor argument 1. This is because generate-schema-statements.py will
insert the scale factor into the database name (ie., "tpch1"), but the
preload script omit the scale factor when creating dataset
directory (ie., "tpch"). This patch fix the issue by additionally
creating symlink for scale factor 1.
Testing:
- Manual test by running the following script:
./bin/load-data.py --scale_factor=1 --workloads=targeted-perf \
--table_formats=text/none/none
Change-Id: I76c9c90b243df6213626e11652cfed59643aed2c
Reviewed-on: http://gerrit.cloudera.org:8080/18545
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
testdata/datasets/tpcds/preload | 6 ++++++
testdata/datasets/tpch/preload | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/testdata/datasets/tpcds/preload b/testdata/datasets/tpcds/preload
index 99b1f7bc3..f4a9c2ec8 100755
--- a/testdata/datasets/tpcds/preload
+++ b/testdata/datasets/tpcds/preload
@@ -42,6 +42,12 @@ echo "Generating TPC-DS data into ${TPC_DS_DATA}"
# Delete any preexisting data or symlinks
rm -rf ${TPC_DS_DATA}
mkdir -p ${TPC_DS_DATA}
+# Create symlink if scale factor is 1
+if [ ${SCALE_FACTOR} -eq 1 ]
+then
+ rm -rf ${TPC_DS_DATA}${SCALE_FACTOR}
+ ln -s ${TPC_DS_DATA} ${TPC_DS_DATA}${SCALE_FACTOR}
+fi
cd ${TPC_DS_DATA}
# dsdgen uses fixed size buffers that cause bizarre issues if the path to the
diff --git a/testdata/datasets/tpch/preload b/testdata/datasets/tpch/preload
index 4bbfe0620..2ecbfd692 100755
--- a/testdata/datasets/tpch/preload
+++ b/testdata/datasets/tpch/preload
@@ -50,6 +50,12 @@ echo "Generating TPC-H data into ${TPC_H_DATA}"
chmod +w ${TPC_H_DATA} || true
rm -rf ${TPC_H_DATA}
mkdir -p ${TPC_H_DATA}
+# Create symlink if scale factor is 1
+if [ ${SCALE_FACTOR} -eq 1 ]
+then
+ rm -rf ${TPC_H_DATA}${SCALE_FACTOR}
+ ln -s ${TPC_H_DATA} ${TPC_H_DATA}${SCALE_FACTOR}
+fi
cd ${TPC_H_DATA}
if [ -t 1 ]
[impala] 01/03: IMPALA-11289: Push-down compound predicates to iceberg
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joemcdonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git
commit b58966b98391209a073cda61f538d84056343b75
Author: LPL <li...@sensorsdata.cn>
AuthorDate: Sat May 14 18:18:30 2022 +0800
IMPALA-11289: Push-down compound predicates to iceberg
This patch implements pushing compound predicates down to Iceberg. The
compound predicates include NOT, AND, and OR.
Testing:
- Added end-to-end test
Change-Id: I27bc67b71033900c466183da5b1907ac90844177
Reviewed-on: http://gerrit.cloudera.org:8080/18535
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
.../org/apache/impala/planner/IcebergScanNode.java | 131 ++++--
.../java/org/apache/impala/util/IcebergUtil.java | 50 ++-
.../iceberg-compound-predicate-push-down.test | 461 +++++++++++++++++++++
tests/query_test/test_iceberg.py | 6 +-
4 files changed, 593 insertions(+), 55 deletions(-)
diff --git a/fe/src/main/java/org/apache/impala/planner/IcebergScanNode.java b/fe/src/main/java/org/apache/impala/planner/IcebergScanNode.java
index f3d521d13..547b02e0d 100644
--- a/fe/src/main/java/org/apache/impala/planner/IcebergScanNode.java
+++ b/fe/src/main/java/org/apache/impala/planner/IcebergScanNode.java
@@ -26,6 +26,7 @@ import java.util.List;
import org.apache.hadoop.fs.Path;
import org.apache.iceberg.DataFile;
import org.apache.iceberg.Schema;
+import org.apache.iceberg.expressions.Expression;
import org.apache.iceberg.expressions.Expressions;
import org.apache.iceberg.expressions.Expression.Operation;
import org.apache.iceberg.expressions.UnboundPredicate;
@@ -33,6 +34,7 @@ import org.apache.iceberg.types.Types;
import org.apache.impala.analysis.Analyzer;
import org.apache.impala.analysis.BinaryPredicate;
import org.apache.impala.analysis.BoolLiteral;
+import org.apache.impala.analysis.CompoundPredicate;
import org.apache.impala.analysis.DateLiteral;
import org.apache.impala.analysis.Expr;
import org.apache.impala.analysis.InPredicate;
@@ -76,8 +78,8 @@ public class IcebergScanNode extends HdfsScanNode {
private final FeIcebergTable icebergTable_;
- // Exprs in icebergConjuncts_ converted to UnboundPredicate.
- private final List<UnboundPredicate> icebergPredicates_ = new ArrayList<>();
+ // Exprs in icebergConjuncts_ converted to Expression.
+ private final List<Expression> icebergPredicates_ = new ArrayList<>();
private TimeTravelSpec timeTravelSpec_;
@@ -208,87 +210,162 @@ public class IcebergScanNode extends HdfsScanNode {
}
}
+ /**
+ * Returns Iceberg operator by CompoundPredicate operator, or null if the operation
+ * is not supported by Iceberg.
+ */
+ private Operation getIcebergOperator(CompoundPredicate.Operator op) {
+ switch (op) {
+ case AND: return Operation.AND;
+ case OR: return Operation.OR;
+ case NOT: return Operation.NOT;
+ default: return null;
+ }
+ }
+
/**
* Transform impala predicate to iceberg predicate
*/
private void tryConvertIcebergPredicate(Analyzer analyzer, Expr expr)
throws ImpalaException {
+ Expression predicate = convertIcebergPredicate(analyzer, expr);
+ if (predicate != null) {
+ icebergPredicates_.add(predicate);
+ LOG.debug("Push down the predicate: " + predicate + " to iceberg");
+ }
+ }
+
+ private Expression convertIcebergPredicate(Analyzer analyzer, Expr expr)
+ throws ImpalaException {
if (expr instanceof BinaryPredicate) {
- convertIcebergPredicate(analyzer, (BinaryPredicate) expr);
+ return convertIcebergPredicate(analyzer, (BinaryPredicate) expr);
} else if (expr instanceof InPredicate) {
- convertIcebergPredicate(analyzer, (InPredicate) expr);
+ return convertIcebergPredicate(analyzer, (InPredicate) expr);
} else if (expr instanceof IsNullPredicate) {
- convertIcebergPredicate((IsNullPredicate) expr);
+ return convertIcebergPredicate((IsNullPredicate) expr);
+ } else if (expr instanceof CompoundPredicate) {
+ return convertIcebergPredicate(analyzer, (CompoundPredicate) expr);
+ } else {
+ return null;
}
}
- private void convertIcebergPredicate(Analyzer analyzer, BinaryPredicate predicate)
- throws ImpalaException {
+ private UnboundPredicate<Object> convertIcebergPredicate(Analyzer analyzer,
+ BinaryPredicate predicate) throws ImpalaException {
Operation op = getIcebergOperator(predicate.getOp());
- if (op == null) return;
+ if (op == null) {
+ return null;
+ }
// Do not convert if there is an implicit cast
- if (!(predicate.getChild(0) instanceof SlotRef)) return;
+ if (!(predicate.getChild(0) instanceof SlotRef)) {
+ return null;
+ }
SlotRef ref = (SlotRef) predicate.getChild(0);
- if (!(predicate.getChild(1) instanceof LiteralExpr)) return;
+ if (!(predicate.getChild(1) instanceof LiteralExpr)) {
+ return null;
+ }
LiteralExpr literal = (LiteralExpr) predicate.getChild(1);
// If predicate contains map/struct, this column would be null
Column col = ref.getDesc().getColumn();
- if (col == null) return;
+ if (col == null) {
+ return null;
+ }
Object value = getIcebergValue(analyzer, ref, literal);
- if (value == null) return;
+ if (value == null) {
+ return null;
+ }
- icebergPredicates_.add(Expressions.predicate(op, col.getName(), value));
+ return Expressions.predicate(op, col.getName(), value);
}
- private void convertIcebergPredicate(Analyzer analyzer, InPredicate predicate)
- throws ImpalaException {
+ private UnboundPredicate<Object> convertIcebergPredicate(Analyzer analyzer,
+ InPredicate predicate) throws ImpalaException {
// TODO: convert NOT_IN predicate
- if (predicate.isNotIn()) return;
+ if (predicate.isNotIn()) {
+ return null;
+ }
// Do not convert if there is an implicit cast
- if (!(predicate.getChild(0) instanceof SlotRef)) return;
+ if (!(predicate.getChild(0) instanceof SlotRef)) {
+ return null;
+ }
SlotRef ref = (SlotRef) predicate.getChild(0);
// If predicate contains map/struct, this column would be null
Column col = ref.getDesc().getColumn();
- if (col == null) return;
+ if (col == null) {
+ return null;
+ }
// Expressions takes a list of values as Objects
List<Object> values = new ArrayList<>();
for (int i = 1; i < predicate.getChildren().size(); ++i) {
- if (!Expr.IS_LITERAL.apply(predicate.getChild(i))) return;
+ if (!Expr.IS_LITERAL.apply(predicate.getChild(i))) {
+ return null;
+ }
LiteralExpr literal = (LiteralExpr) predicate.getChild(i);
// Cannot push IN or NOT_IN predicate with null literal values
- if (Expr.IS_NULL_LITERAL.apply(literal)) return;
+ if (Expr.IS_NULL_LITERAL.apply(literal)) {
+ return null;
+ }
Object value = getIcebergValue(analyzer, ref, literal);
- if (value == null) return;
+ if (value == null) {
+ return null;
+ }
values.add(value);
}
- icebergPredicates_.add(Expressions.in(col.getName(), values));
+ return Expressions.in(col.getName(), values);
}
- private void convertIcebergPredicate(IsNullPredicate predicate) {
+ private UnboundPredicate<Object> convertIcebergPredicate(IsNullPredicate predicate) {
// Do not convert if there is an implicit cast
- if (!(predicate.getChild(0) instanceof SlotRef)) return;
+ if (!(predicate.getChild(0) instanceof SlotRef)) {
+ return null;
+ }
SlotRef ref = (SlotRef) predicate.getChild(0);
// If predicate contains map/struct, this column would be null
Column col = ref.getDesc().getColumn();
- if (col == null) return;
+ if (col == null) {
+ return null;
+ }
if (predicate.isNotNull()) {
- icebergPredicates_.add(Expressions.notNull(col.getName()));
+ return Expressions.notNull(col.getName());
} else{
- icebergPredicates_.add(Expressions.isNull(col.getName()));
+ return Expressions.isNull(col.getName());
+ }
+ }
+
+ private Expression convertIcebergPredicate(Analyzer analyzer,
+ CompoundPredicate predicate) throws ImpalaException {
+ Operation op = getIcebergOperator(predicate.getOp());
+ if (op == null) {
+ return null;
+ }
+
+ Expression left = convertIcebergPredicate(analyzer, predicate.getChild(0));
+ if (left == null) {
+ return null;
+ }
+ if (op.equals(Operation.NOT)) {
+ return Expressions.not(left);
+ }
+
+ Expression right = convertIcebergPredicate(analyzer, predicate.getChild(1));
+ if (right == null) {
+ return null;
}
+ return op.equals(Operation.AND) ? Expressions.and(left, right)
+ : Expressions.or(left, right);
}
private Object getIcebergValue(Analyzer analyzer, SlotRef ref, LiteralExpr literal)
diff --git a/fe/src/main/java/org/apache/impala/util/IcebergUtil.java b/fe/src/main/java/org/apache/impala/util/IcebergUtil.java
index 8f4fca0df..5c70bfa85 100644
--- a/fe/src/main/java/org/apache/impala/util/IcebergUtil.java
+++ b/fe/src/main/java/org/apache/impala/util/IcebergUtil.java
@@ -17,6 +17,14 @@
package org.apache.impala.util;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
+import com.google.common.hash.Hasher;
+import com.google.common.hash.Hashing;
+import com.google.common.primitives.Ints;
+import com.google.common.primitives.Longs;
+import com.google.flatbuffers.FlatBufferBuilder;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.time.Instant;
@@ -32,36 +40,20 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-
-import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.Maps;
-import com.google.common.hash.Hasher;
-import com.google.common.hash.Hashing;
-import com.google.common.primitives.Ints;
-import com.google.common.primitives.Longs;
-import com.google.flatbuffers.FlatBufferBuilder;
-
-import org.apache.impala.common.Pair;
-import org.apache.impala.fb.FbFileMetadata;
-import org.apache.impala.fb.FbIcebergDataFileFormat;
-import org.apache.impala.fb.FbIcebergMetadata;
-import org.apache.impala.fb.FbIcebergPartitionTransformValue;
-import org.apache.impala.fb.FbIcebergTransformType;
-import org.apache.iceberg.Transaction;
-import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.iceberg.DataFile;
import org.apache.iceberg.FileFormat;
import org.apache.iceberg.FileScanTask;
-import org.apache.iceberg.TableScan;
-import org.apache.iceberg.expressions.UnboundPredicate;
-import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.PartitionField;
import org.apache.iceberg.PartitionSpec;
import org.apache.iceberg.Schema;
import org.apache.iceberg.Snapshot;
import org.apache.iceberg.StructLike;
import org.apache.iceberg.Table;
+import org.apache.iceberg.TableScan;
+import org.apache.iceberg.Transaction;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.expressions.Expression;
+import org.apache.iceberg.io.CloseableIterable;
import org.apache.iceberg.mr.Catalogs;
import org.apache.iceberg.transforms.PartitionSpecVisitor;
import org.apache.iceberg.types.Conversions;
@@ -77,12 +69,18 @@ import org.apache.impala.catalog.FeIcebergTable;
import org.apache.impala.catalog.HdfsFileFormat;
import org.apache.impala.catalog.IcebergTable;
import org.apache.impala.catalog.TableLoadingException;
+import org.apache.impala.catalog.iceberg.IcebergCatalog;
+import org.apache.impala.catalog.iceberg.IcebergCatalogs;
import org.apache.impala.catalog.iceberg.IcebergHadoopCatalog;
import org.apache.impala.catalog.iceberg.IcebergHadoopTables;
import org.apache.impala.catalog.iceberg.IcebergHiveCatalog;
-import org.apache.impala.catalog.iceberg.IcebergCatalog;
-import org.apache.impala.catalog.iceberg.IcebergCatalogs;
import org.apache.impala.common.ImpalaRuntimeException;
+import org.apache.impala.common.Pair;
+import org.apache.impala.fb.FbFileMetadata;
+import org.apache.impala.fb.FbIcebergDataFileFormat;
+import org.apache.impala.fb.FbIcebergMetadata;
+import org.apache.impala.fb.FbIcebergPartitionTransformValue;
+import org.apache.impala.fb.FbIcebergTransformType;
import org.apache.impala.thrift.TCompressionCodec;
import org.apache.impala.thrift.THdfsCompression;
import org.apache.impala.thrift.THdfsFileFormat;
@@ -523,17 +521,17 @@ public class IcebergUtil {
* DataFiles in the first element.
*/
public static Pair<List<DataFile>, Boolean> getIcebergDataFiles(FeIcebergTable table,
- List<UnboundPredicate> predicates, TimeTravelSpec timeTravelSpec)
+ List<Expression> predicates, TimeTravelSpec timeTravelSpec)
throws TableLoadingException {
if (table.snapshotId() == -1) return new Pair<>(Collections.emptyList(), false);
TableScan scan = createScanAsOf(table, timeTravelSpec);
- for (UnboundPredicate predicate : predicates) {
+ for (Expression predicate : predicates) {
scan = scan.filter(predicate);
}
List<DataFile> dataFileList = new ArrayList<>();
- Boolean hasDeleteFile = false;
+ boolean hasDeleteFile = false;
try (CloseableIterable<FileScanTask> fileScanTasks = scan.planFiles()) {
for (FileScanTask task : fileScanTasks) {
if (!task.deletes().isEmpty()) {
diff --git a/testdata/workloads/functional-query/queries/QueryTest/iceberg-compound-predicate-push-down.test b/testdata/workloads/functional-query/queries/QueryTest/iceberg-compound-predicate-push-down.test
new file mode 100644
index 000000000..8e7afedb2
--- /dev/null
+++ b/testdata/workloads/functional-query/queries/QueryTest/iceberg-compound-predicate-push-down.test
@@ -0,0 +1,461 @@
+====
+---- QUERY
+create table ice_compound_pred_pd (
+ col_i INT,
+ col_bi BIGINT,
+ col_db DOUBLE,
+ col_str STRING,
+ col_ts TIMESTAMP
+) partitioned by spec (col_i) stored as iceberg tblproperties ('write.format.default' = 'parquet');
+---- RESULTS
+'Table has been created.'
+====
+---- QUERY
+insert into
+ ice_compound_pred_pd
+values
+ (0, NULL, 2.71820, '_1700-01-01 00:00:00', '1400-01-01 00:00:00'),
+ (1, 12345678901, NULL, 'A1700-01-01 00:00:00', '1400-01-01 01:01:01'),
+ (2, 12345678902, 2.71822, NULL, '1400-01-01 02:02:02'),
+ (3, 12345678903, 2.71823, '1700-01-01 00:00:00', '1500-01-01 00:00:00'),
+ (4, 12345678904, 2.71824, '1700-01-01 00:00:00', NULL),
+ (5, 12345678908, 2.71828, '1700-01-01 00:00:00', '1600-01-01 02:02:02'),
+ (0, NULL, 2.71820, '_1700-01-01 00:00:00', '1400-01-01 00:00:00'),
+ (1, 12345678901, NULL, 'A1700-01-01 00:00:00', '1400-01-01 01:01:01'),
+ (2, 12345678902, 2.71822, NULL, '1400-01-01 02:02:02'),
+ (3, 12345678903, 2.71823, '1700-01-01 00:00:00', '1500-01-01 00:00:00'),
+ (4, 12345678904, 2.71824, '1700-01-01 00:00:00', NULL),
+ (5, 12345678908, 2.71828, '1700-01-01 00:00:00', '1600-01-01 02:02:02'),
+ (6, NULL, 2.71820, '_1700-01-01 00:00:00', '1400-01-01 00:00:00'),
+ (7, 12345678901, NULL, 'A1700-01-01 00:00:00', '1400-01-01 01:01:01'),
+ (8, 12345678902, 2.71822, NULL, '1400-01-01 02:02:02'),
+ (9, 12345678903, 2.71823, '1700-01-01 00:00:00', '1500-01-01 00:00:00'),
+ (10, 12345678904, 2.71824, '1700-01-01 00:00:00', NULL),
+ (11, 12345678908, 2.71828, '1700-01-01 00:00:00', '1600-01-01 02:02:02');
+select count(1) from ice_compound_pred_pd;
+---- RESULTS
+18
+---- TYPES
+BIGINT
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 0
+aggregation(SUM, NumFileMetadataRead): 12
+====
+---- QUERY
+show files in ice_compound_pred_pd;
+---- RESULTS
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=0/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=1/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=10/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=11/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=2/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=3/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=4/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=5/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=6/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=7/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=8/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd/data/col_i=9/.*.0.parq','.*',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+# icebergPredicates_:
+# 0: in_list
+# 1: in_list or eq
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ col_str in ('1700-01-01 00:00:00')
+ and (
+ col_ts in ('1500-01-01 00:00:00')
+ or col_db = 2.71823
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+# 0: eq or in_list
+# 1: in_list
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_db = 2.71823
+ or col_ts in ('1500-01-01 00:00:00')
+ )
+ and col_str in ('1700-01-01 00:00:00');
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+# 0: eq or is_null
+# 1: not_null or eq
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_bi = 12345678902
+ or col_str is null
+ )
+ and (
+ col_ts is not null
+ or col_db = 2.71823
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+# 0: eq or in_list
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_bi != -1
+ or cast(col_str as timestamp) in ('1700-01-01 00:00:00')
+ )
+ and (
+ col_db = 2.71823
+ or col_ts in ('1500-01-01 00:00:00')
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+# 0: in_list or eq
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ cast(col_str as timestamp) in ('1700-01-01 00:00:00')
+ and (
+ col_ts in ('1500-01-01 00:00:00')
+ or cast(col_db as double) = 2.71823
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ cast(col_str as timestamp) in ('1700-01-01 00:00:00')
+ and (
+ cast(col_db as bigint) = 2.71823
+ or col_ts in ('1500-01-01 00:00:00')
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 12
+====
+---- QUERY
+# icebergPredicates_:
+# 0: eq or in_list
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ col_bi = 12345678902
+ or col_db in (2.71823);
+---- RESULTS
+6
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 4
+====
+---- QUERY
+# icebergPredicates_:
+# 0: in_list or (in_list and eq)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ col_bi in (12345678902)
+ or (
+ col_ts in ('1500-01-01 00:00:00')
+ and col_db = 2.71823
+ );
+---- RESULTS
+6
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 4
+====
+---- QUERY
+# icebergPredicates_:
+# 0: (eq and in_list) or in_list
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_db = 2.71823
+ and col_ts in ('1500-01-01 00:00:00')
+ )
+ or col_bi in (12345678902);
+---- RESULTS
+6
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 4
+====
+---- QUERY
+# icebergPredicates_:
+# 0: (eq and in_list) or (in_list and not_null)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_db = 1.71823 + 1
+ and col_ts in ('1500-01-01 00:00:00')
+ )
+ or (
+ col_bi in (12345678902)
+ and col_str is not null
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_db = 2.71823
+ and cast(col_ts as string) in ('1500-01-01 00:00:00')
+ )
+ or (
+ col_bi in (12345678902)
+ and col_str is not null
+ );
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 12
+====
+---- QUERY
+# icebergPredicates_:
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ (
+ col_db = 1.71823 + col_db
+ and col_ts in ('1500-01-01 00:00:00')
+ )
+ or (
+ col_bi in (12345678902)
+ and col_str is not null
+ );
+---- RESULTS
+0
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 12
+====
+---- QUERY
+# icebergPredicates_:
+# 0: not(not_null)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ not col_bi is not null;
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+# 0: (not(not_null)) or (eq)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ not col_bi is not null
+ or col_bi = 12345678908;
+---- RESULTS
+6
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 4
+====
+---- QUERY
+# icebergPredicates_:
+# 0: not(not_eq)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ not (col_bi != 12345678901);
+---- RESULTS
+3
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 2
+====
+---- QUERY
+# icebergPredicates_:
+# 0: not(not_eq or eq)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ not (
+ col_bi != 123
+ or col_db = 2.71822
+ );
+---- RESULTS
+0
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 0
+====
+---- QUERY
+# icebergPredicates_:
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ not (
+ col_bi + 1 != 123
+ or col_db = 2.71822
+ );
+---- RESULTS
+0
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 12
+====
+---- QUERY
+# icebergPredicates_:
+# 0: is_null or (gt_eq and lt_eq)
+select
+ count(1)
+from
+ ice_compound_pred_pd
+where
+ col_bi is null
+ or col_bi between 12345678901
+ and 12345678902;
+---- RESULTS
+9
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 6
+====
+---- QUERY
+create table ice_compound_pred_pd1 (
+ col_i INT,
+ col_bi_0 BIGINT,
+ col_bi_1 BIGINT,
+ col_bi_2 BIGINT,
+ col_bi_3 BIGINT,
+ col_bi_4 BIGINT,
+ col_bi_5 BIGINT,
+ col_bi_6 BIGINT,
+ col_bi_7 BIGINT,
+ col_bi_8 BIGINT,
+ col_bi_9 BIGINT
+) partitioned by spec (col_i) stored as iceberg tblproperties ('write.format.default' = 'parquet');
+---- RESULTS
+'Table has been created.'
+====
+---- QUERY
+insert into
+ ice_compound_pred_pd1
+values
+ (0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
+ (1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19),
+ (2, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29),
+ (3, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39),
+ (4, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49),
+ (5, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59),
+ (6, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69),
+ (7, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79),
+ (8, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89),
+ (9, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99);
+select count(1) from ice_compound_pred_pd1;
+---- RESULTS
+10
+---- TYPES
+BIGINT
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 0
+aggregation(SUM, NumFileMetadataRead): 10
+====
+---- QUERY
+show files in ice_compound_pred_pd1;
+---- RESULTS
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=0/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=1/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=2/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=3/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=4/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=5/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=6/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=7/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=8/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/ice_compound_pred_pd1/data/col_i=9/.*.0.parq','.*',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+select
+ count(1)
+from
+ ice_compound_pred_pd1
+where
+ col_bi_0 = 0
+ or col_bi_1 is null
+ or not(
+ col_bi_2 < 22
+ or col_bi_2 > 22
+ )
+ or col_bi_3 is null
+ or col_bi_4 = 44
+ or col_bi_5 is null
+ or col_bi_6 = 66
+ or col_bi_7 is null
+ or col_bi_8 = 88
+ or col_bi_9 is null;
+---- RESULTS
+5
+---- RUNTIME_PROFILE
+aggregation(SUM, NumRowGroups): 5
+====
diff --git a/tests/query_test/test_iceberg.py b/tests/query_test/test_iceberg.py
index 727540449..c5ff5a539 100644
--- a/tests/query_test/test_iceberg.py
+++ b/tests/query_test/test_iceberg.py
@@ -613,12 +613,14 @@ class TestIcebergTable(ImpalaTestSuite):
split_stats = collect_split_stats(profile)
assert ref_split_stats == split_stats
- @pytest.mark.execute_serially
def test_in_predicate_push_down(self, vector, unique_database):
self.run_test_case('QueryTest/iceberg-in-predicate-push-down', vector,
use_db=unique_database)
- @pytest.mark.execute_serially
def test_is_null_predicate_push_down(self, vector, unique_database):
self.run_test_case('QueryTest/iceberg-is-null-predicate-push-down', vector,
use_db=unique_database)
+
+ def test_compound_predicate_push_down(self, vector, unique_database):
+ self.run_test_case('QueryTest/iceberg-compound-predicate-push-down', vector,
+ use_db=unique_database)