Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
create table acid_uami(i int, de decimal(5,2) constraint nn1 not null enforced, vc varchar(128) constraint nn2 not null enforced) clustered by (i) into 2 buckets stored as orc TBLPROPERTIES ('transactional'='true'); explain update acid_uami set de=null where i=1;
Non-CBO path:
Map Operator Tree: TableScan alias: acid_uami filterExpr: ((i = 1) and enforce_constraint(vc is not null)) (type: boolean) Statistics: Num rows: 1 Data size: 216 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: ((i = 1) and enforce_constraint(vc is not null)) (type: boolean)
CBO path:
Map Reduce Map Operator Tree: TableScan alias: acid_uami filterExpr: (i = 1) (type: boolean) Statistics: Num rows: 1 Data size: 216 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (i = 1) (type: boolean) ... Reduce Operator Tree: ... Filter Operator predicate: enforce_constraint((null is not null and _col3 is not null)) (type: boolean)
In CBO path the enforce_constraint function is added to the plan when CBO plan is already generated and optimized.
HiveSortExchange(distribution=[any], collation=[[0]]) HiveProject(row__id=[$5], i=[CAST(1):INTEGER], _o__c2=[null:NULL], vc=[$2]) HiveFilter(condition=[=($0, 1)]) HiveTableScan(table=[[default, acid_uami]], table:alias=[acid_uami])
Attachments
Attachments
Issue Links
- is related to
-
HIVE-25109 CBO fails when updating table has constraints defined
- Resolved
-
HIVE-26371 Constant propagation does not evaluate constraint expressions at merge when CBO is enabled
- Closed
-
HIVE-22785 Update/delete/merge statements not optimized through CBO
- Closed
- links to