[
https://issues.apache.org/jira/browse/FLINK-35827?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lincoln lee closed FLINK-35827.
-------------------------------
Fix Version/s: 2.0-preview
Assignee: xuyang
Resolution: Fixed
fixed in master: 54b0d6a858cd18e57fde60966a01cd673cb6da7a
> Equality bewteen a row field and a row constant is wrong in SQL
> ---------------------------------------------------------------
>
> Key: FLINK-35827
> URL: https://issues.apache.org/jira/browse/FLINK-35827
> Project: Flink
> Issue Type: Bug
> Components: Table SQL / Planner
> Reporter: yisha zhou
> Assignee: xuyang
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.0-preview
>
>
> To reproduce the issue, you can add codes below in RowTypeTest
> {code:java}
> testAllApis(
> 'f2 === row(2, "foo", true),
> "f2 = row(2, 'foo', true)",
> "true"
> ) {code}
> f2 is actually the same as the constant `row(2, "foo", true)`, however the
> result of expression `f2 = row(2, 'foo', true)` is false.
> The root cause is that `ScalarOperatorGens.generateEquals` generates code
> like `$leftTerm.equals($rightTerm)` for row types. However f2 may be a
> GenericRowData, the constant may be a BinaryRowData, the equality between
> them are false.
>
> And after investigating the code, I believe logic in
> `EqualiserCodeGenerator.generateEqualsCode` can handle the issue here.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)