impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Impala Public Jenkins (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-5294: Kudu INSERT partitioning fails with constants
Date Wed, 10 May 2017 22:53:03 GMT
Impala Public Jenkins has submitted this change and it was merged.

Change subject: IMPALA-5294: Kudu INSERT partitioning fails with constants

IMPALA-5294: Kudu INSERT partitioning fails with constants

An INSERT into a Kudu table with a constant value being inserted
into a partition column causes an IllegalStateExcaption. This is
because DistributedPlanner removes constants from the list of
partition exprs before creating the KuduPartitionExpr, but
KuduPartitionExpr expects to get one expr per partition column.

The fix is to pass the full list of partition exprs into the
KuduPartitionExpr, instead of the list that has had constants
removed. This preserves the behavior that if all of the partition
exprs are constant we fall back to UNPARTITIONED.

One complication is that if a partition expr is a NullLiteral, it
must be cast to a specific type to be passed to the BE. The
InsertStmt will cast the partition exprs to the partition column
types, but these casts may be lost from the copies of the partition
exprs stored by the KuduPartitionExpr during reset(). To fix this,
the KuduPartitionExpr can store the types of the partition cols and
recast the partition exprs to those types during analyze().

Change-Id: I12cbb319f9a5c47fdbfee347b47650186b27f8f9
Reviewed-by: Thomas Tauber-Marshall <>
Tested-by: Impala Public Jenkins
M fe/src/main/java/org/apache/impala/analysis/
M fe/src/main/java/org/apache/impala/planner/
M testdata/workloads/functional-query/queries/QueryTest/kudu_insert.test
3 files changed, 47 insertions(+), 3 deletions(-)

  Impala Public Jenkins: Verified
  Thomas Tauber-Marshall: Looks good to me, approved

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: I12cbb319f9a5c47fdbfee347b47650186b27f8f9
Gerrit-PatchSet: 4
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Thomas Tauber-Marshall <>
Gerrit-Reviewer: Impala Public Jenkins
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-Reviewer: Matthew Jacobs <>
Gerrit-Reviewer: Thomas Tauber-Marshall <>

View raw message