[
https://issues.apache.org/jira/browse/PHOENIX-8051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Kyle Purtell updated PHOENIX-8051:
-----------------------------------------
Description:
{{InListExpression}} treats only the left-hand operand as an AST child node,
maintaining the candidate values of the {{IN}} list as internal state.
Expression cloning previously only looked at child nodes. Because the literal
values were omitted from this traversal, the resulting clone lacked its target
set and evaluated to false for every row.
This surfaces whenever the query engine duplicates expressions, such as for
server side array, JSON, and BSON projection rewrites and to isolate
per-invocation functions like {{{}RAND(){}}}. Components such as {{UPSERT
SELECT}} and {{PhoenixRecordReader}} consume these cloned projections, causing
queries with projected, non-deterministic {{IN}} expressions to consistently
resolve to false.
The fix is for expression cloning to explicitly carry forward the source list's
literal values alongside the cloned operand.
was:
{{InListExpression}} treats only the left-hand operand as an AST child node,
maintaining the candidate values of the {{IN}} list as internal state.
Expression cloning previously only looked at child nodes. Because the literal
values were omitted from this traversal, the resulting clone lacked its target
set and evaluated to false for every row.
This failure emerges in execution paths where {{RowProjectors}} create local
expression copies to isolate per-invocation functions likeĀ {{{}RAND(){}}}.
Components such as {{UPSERT SELECT}} and {{PhoenixRecordReader}} consume these
cloned projections, causing queries with projected, non-deterministic {{IN}}
expressions to consistently resolve to false.
The fix is for expression cloning to explicitly carry forward the source list's
literal values alongside the cloned operand.
> Row projectors lose the values of IN lists
> ------------------------------------------
>
> Key: PHOENIX-8051
> URL: https://issues.apache.org/jira/browse/PHOENIX-8051
> Project: Phoenix
> Issue Type: Bug
> Components: core
> Affects Versions: 5.3.2
> Reporter: Andrew Kyle Purtell
> Assignee: Andrew Kyle Purtell
> Priority: Major
> Fix For: 5.4.0, 5.3.3
>
>
> {{InListExpression}} treats only the left-hand operand as an AST child node,
> maintaining the candidate values of the {{IN}} list as internal state.
> Expression cloning previously only looked at child nodes. Because the literal
> values were omitted from this traversal, the resulting clone lacked its
> target set and evaluated to false for every row.
> This surfaces whenever the query engine duplicates expressions, such as for
> server side array, JSON, and BSON projection rewrites and to isolate
> per-invocation functions like {{{}RAND(){}}}. Components such as {{UPSERT
> SELECT}} and {{PhoenixRecordReader}} consume these cloned projections,
> causing queries with projected, non-deterministic {{IN}} expressions to
> consistently resolve to false.
> The fix is for expression cloning to explicitly carry forward the source
> list's literal values alongside the cloned operand.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)