Hi. Could you guide me to proper channel or websit...
# troubleshooting
j
Hi. Could you guide me to proper channel or website to report some issue i found. I have a java script to reproduce this behavior and i do not want to be in the wrong channel. It is related to previous issue i asked in this channel. Sorry if i am in the wrong channel. https://apache-flink.slack.com/archives/C03G7LJTS2G/p1676968781999069
m
You would need to file a ticket in Jira
But I do think that there’s not a bug but an error in your syntax somewhere
j
I am not so familiar with Jira process. Do you mind if i paste the script it here or i should create a ticket on Jira.
Copy code
package com.mypackage.streaming;

import org.apache.flink.api.common.eventtime.WatermarkStrategy;
import org.apache.flink.api.common.typeinfo.Types;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.table.api.StatementSet;
import org.apache.flink.table.api.Table;
import org.apache.flink.table.api.bridge.java.StreamTableEnvironment;
import org.apache.flink.types.Row;
import static org.apache.flink.table.api.Expressions.$;

public class HelloFlinkWindowJoin {
    public static void main(String[] args) throws Exception {
        System.out.println("Start Flink Application");
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
        Configuration configuration = tableEnv.getConfig().getConfiguration();
        configuration.setString("table.local-time-zone", "UTC");

        DataStream<Row> dataStream = env.fromElements(
            Row.of("U1234", "ORDER_ID1", 1, 1676900949000L),
            Row.of("U1234", "ORDER_ID2", 1, 1676910949000L),
            Row.of("U1234", "ORDER_ID3", 2, 1676920949000L),
            Row.of("U1234", "ORDER_ID4", 2, 1676930949000L),
            Row.of("U1234", "ORDER_ID5", 3, 1676940949000L),
            Row.of("U1234", "ORDER_ID6", 4, 1676950949000L),
            Row.of("U1234", "ORDER_ID7", 5, 1676960949000L)

        ).returns(
            Types.ROW(
                Types.STRING,
                Types.STRING,
                <http://Types.INT|Types.INT>,
                Types.LONG));
        dataStream = dataStream.assignTimestampsAndWatermarks(WatermarkStrategy.forMonotonousTimestamps() );

        Table table = tableEnv.fromDataStream(dataStream,$("user_id"), $("order_id"), $("amount"), $("event_time").rowtime());
        table.printSchema();
        table.execute().print();

        tableEnv.createTemporaryView("foodorder", table);
        String sql = "WITH food AS (" +
            " SELECT user_id, window_start, window_end" +
            " FROM TABLE(TUMBLE(TABLE foodorder, DESCRIPTOR(event_time), INTERVAL '1' MINUTES))" +
            " GROUP BY user_id, window_start, window_end)\n"+
            "select food.window_start\n" +
            "     ,food.window_end as id\n" +
            "     ,food.user_id as id\n" +
            "     ,DATE_FORMAT(food.window_end + INTERVAL '7' HOUR, 'yyyyMMdd') AS dt\n" +
            "     ,DATE_FORMAT(food.window_end + INTERVAL '7' HOUR, 'HH') AS `hour`\n" +
            "from food\n" +
            "left join food as a on food.user_id = a.user_id\n" +
            "and food.window_start = a.window_start\n" +
            "and food.window_end = a.window_end";
        String sinkSQL = "CREATE TABLE sink (\n" +
            "    window_start TIMESTAMP\n" +
            "    ,window_end TIMESTAMP\n" +
            "    ,user_id STRING\n" +
            "    ,dt STRING\n" +
            "    ,`hour` STRING\n" +
            ") WITH ( \n" +
            "    'connector' = 'print'\n" +
            ");";
        System.out.println(sinkSQL);
        tableEnv.executeSql(sinkSQL);
        table = tableEnv.sqlQuery(sql);
        StatementSet statementSet = tableEnv.createStatementSet();
        statementSet.add(table.insertInto("sink"));
        statementSet.add(table.insertInto("sink"));
        statementSet.printExplain();
        statementSet.execute();
    }
}
You could try this out. I am not sure it is an issue or not
@Martijn Visser Could you advice me how to proceed this further?
m
I can create the ticket for you
If there’s a reproducible piece of code for this issue
Is that complete in the thread?
j
Thank you so much. You can use this code to run in your local https://apache-flink.slack.com/archives/C03G7LJTS2G/p1677063298709069?thread_ts=1677034965.469419&amp;cid=C03G7LJTS2G. It should work fine.
Hi @Martijn Visser. Could you share me the ticket if you create one?
m
Sorry for the late reply. I would recommend to request a Jira account via the new ASF process at https://selfserve.apache.org/jira-account.html so you can create the ticket yourself, to avoid that I need to be a middle man in case additional information is needed
👍 1