You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/07/06 11:33:00 UTC
[jira] [Updated] (HIVE-26371) Constant propagation does not evaluate constraint expressions at merge when CBO is enabled
[ https://issues.apache.org/jira/browse/HIVE-26371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated HIVE-26371:
----------------------------------
Labels: pull-request-available (was: )
> Constant propagation does not evaluate constraint expressions at merge when CBO is enabled
> ------------------------------------------------------------------------------------------
>
> Key: HIVE-26371
> URL: https://issues.apache.org/jira/browse/HIVE-26371
> Project: Hive
> Issue Type: Bug
> Components: CBO, Logical Optimizer
> Reporter: Krisztian Kasa
> Assignee: Krisztian Kasa
> Priority: Major
> Labels: pull-request-available
> Fix For: 4.0.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> {code}
> CREATE TABLE t_target(
> name string CHECK (length(name)<=20),
> age int,
> gpa double CHECK (gpa BETWEEN 0.0 AND 4.0))
> stored as orc TBLPROPERTIES ('transactional'='true');
> CREATE TABLE t_source(
> name string,
> age int,
> gpa double);
> insert into t_source(name, age, gpa) values ('student1', 16, null);
> insert into t_target(name, age, gpa) values ('student1', 16, 2.0);
> merge into t_target using t_source source on source.age=t_target.age when matched then update set gpa=6;
> {code}
> Currently CBO can not handle constraint checks when merging so the filter operator with the {{enforce_constraint}} call is added to the Hive operator plan after CBO is succeeded and {{ConstantPropagate}} optimization is called only from TezCompiler with {{ConstantPropagateOption.SHORTCUT}}.
> With this option {{ConstantPropagate}} does not evaluate deterministic functions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)