You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Andrey Gaskov (Jira)" <ji...@apache.org> on 2024/04/13 15:48:00 UTC

[jira] [Created] (FLINK-35098) Incorrect results for queries like "10 >= y" on tables using Filesystem connector and Orc format

Andrey Gaskov created FLINK-35098:
-------------------------------------

             Summary: Incorrect results for queries like "10 >= y" on tables using Filesystem connector and Orc format
                 Key: FLINK-35098
                 URL: https://issues.apache.org/jira/browse/FLINK-35098
             Project: Flink
          Issue Type: Bug
          Components: Connectors / ORC, Formats (JSON, Avro, Parquet, ORC, SequenceFile)
    Affects Versions: 1.18.1, 1.19.0, 1.17.2, 1.16.3, 1.15.4, 1.14.6, 1.13.6, 1.12.7
            Reporter: Andrey Gaskov


When working with ORC files, there is an issue with evaluation of SQL queries containing expressions with a literal as the first operand. Specifically, the query *10 >= y* does not always return the correct result.

This test added to OrcFileSystemITCase.java fails on the second check:

 
{code:java}
@TestTemplate
void testOrcFilterPushDownLiteralFirst() throws ExecutionException, InterruptedException {
    super.tableEnv()
            .executeSql("insert into orcLimitTable values('a', 10, 10)")
            .await();

    List<Row> expected = Collections.singletonList(Row.of(10));
    check("select y from orcLimitTable where y <= 10", expected);
    check("select y from orcLimitTable where 10 >= y", expected);
}

Results do not match for query:
  select y from orcLimitTable where 10 >= y
Results
 == Correct Result - 1 ==   == Actual Result - 0 ==
!+I[10]    {code}
The checks are equivalent and should evaluate to the same result. But the second query doesn't return the record with y=10.

The table is defined as:
{code:java}
create table orcLimitTable (
    x string,
    y int,
    a int) 
with (
    'connector' = 'filesystem',
    'path' = '/tmp/junit4374176500101507155/junit7109291529844202275/',
    'format'='orc'){code}
 



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