Dawid Wysakowicz created FLINK-34938:
----------------------------------------

             Summary: 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
             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)

Reply via email to