You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dawid Wysakowicz (Jira)" <ji...@apache.org> on 2024/03/27 08:40:00 UTC

[jira] [Closed] (FLINK-34938) Incorrect behaviour for comparison functions

     [ https://issues.apache.org/jira/browse/FLINK-34938?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dawid Wysakowicz closed FLINK-34938.
------------------------------------
    Resolution: Fixed

Implemented in 7ea5bcce6a58b69543b571e9746d7374ded028c5

> Incorrect behaviour for comparison functions
> --------------------------------------------
>
>                 Key: FLINK-34938
>                 URL: https://issues.apache.org/jira/browse/FLINK-34938
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>    Affects Versions: 1.19.0
>            Reporter: Dawid Wysakowicz
>            Assignee: Dawid Wysakowicz
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.20.0
>
>
> There are a few issues with comparison functions.
> Some versions throw:
> {code}
> Incomparable types: TIMESTAMP_LTZ(3) NOT NULL and TIMESTAMP(3)
> {code}
> Results of some depend on the comparison order, because the least restrictive precision is not calculated correctly.
> E.g.
> {code}
>         final Instant ltz3 = Instant.ofEpochMilli(1_123);
>         final Instant ltz0 = Instant.ofEpochMilli(1_000);
>         TestSetSpec.forFunction(BuiltInFunctionDefinitions.EQUALS)
>                         .onFieldsWithData(ltz3, ltz0)
>                         .andDataTypes(TIMESTAMP_LTZ(3), TIMESTAMP_LTZ(0))
>                         // compare same type, but different precision, should always adjust to the higher precision
>                         .testResult($("f0").isEqual($("f1")), "f0 = f1", false, DataTypes.BOOLEAN())
>                         .testResult($("f1").isEqual($("f0")), "f1 = f0", true /* but should be false */, DataTypes.BOOLEAN())
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)