Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] predicate push-down time dimension table error #375

Open
hhoao opened this issue Jul 17, 2024 · 0 comments · May be fixed by #376
Open

[BugFix] predicate push-down time dimension table error #375

hhoao opened this issue Jul 17, 2024 · 0 comments · May be fixed by #376

Comments

@hhoao
Copy link

hhoao commented Jul 17, 2024

image image 第一张图表示flink api传过来的是谓词下推后的下标,使用该下标会构建错filterRichInfo

如何复现:
`package org.example;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.environment.ExecutionCheckpointingOptions;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.TableResult;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;

import java.time.Duration;

public class StarRocksSqlDimApp {
public static void main(String[] args) {
Configuration configuration = new Configuration();
configuration.set(ExecutionCheckpointingOptions.CHECKPOINTING_INTERVAL,
Duration.ofSeconds(30));

    StreamExecutionEnvironment executionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment(configuration);
    StreamTableEnvironment streamTableEnvironment = StreamTableEnvironment.create(executionEnvironment);
    streamTableEnvironment.executeSql("CREATE TABLE source (\n" +
        "  id INT,\n" +
        "  name STRING,\n" +
        "  proc_time AS PROCTIME()" +
        ") WITH (\n" +
        "   'connector' = 'starrocks',\n" +
        " 'password' = '',\n" +
        " 'table-name' = 'source', \n" +
        "  'scan-url' = '', \n" +
        " 'username'='root',\n" +
        "   'jdbc-url' = '',\n" +
        "   'database-name' = 'test'\n" +
        ");");
    streamTableEnvironment.executeSql("CREATE TABLE dim (\n" +
        "  id INT,\n" +
        "  name STRING\n" +
        ") WITH (\n" +
        "   'connector' = 'starrocks',\n" +
        " 'password' = '',\n" +
        " 'table-name' = 'dim', \n" +
        "  'scan-url' = '', \n" +
        " 'username'='root',\n" +
        "   'jdbc-url' = 'jdbc:mysql:///',\n" +
        "   'database-name' = 'test'\n" +
        ");");

    streamTableEnvironment.executeSql("CREATE TABLE sink (\n" +
        "  id INT,\n" +
        "  name STRING\n" +
        ") WITH (\n" +
        "   'connector' = 'starrocks',\n" +
        " 'password' = '',\n" +
        " 'table-name' = 'sink', \n" +
        "  'load-url' = '', \n" +
        " 'username'='root',\n" +
        "   'jdbc-url' = 'jdbc:mysql:///',\n" +
        "   'database-name' = 'test'\n" +
        ");");

    TableResult tableResult = streamTableEnvironment.executeSql(
        "INSERT INTO sink\n" +
            "SELECT source.id, dim.name FROM source\n" +
            "LEFT JOIN\n" +
            "dim for SYSTEM_TIME as OF source.proc_time\n" +
            "on dim.name = source.name;");
    tableResult.print();
}

}
`

@hhoao hhoao linked a pull request Jul 17, 2024 that will close this issue
11 tasks
hhoao added a commit to hhoao/starrocks-connector-for-apache-flink that referenced this issue Jul 18, 2024
hhoao added a commit to hhoao/starrocks-connector-for-apache-flink that referenced this issue Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant