Kim Nguyen
08/04/2023, 4:19 AMTableResult input = tableEnv.executeSql(input_sql_table);
TableResult test_output = tableEnv.executeSql(output_sql_table);
Table input_raw = tableEnv.from("input"); // when this prints, it is correct
Table input_aggregate = simple_aggregate(input_raw); // when this prints, it is correct
TablePipeline tablePipeline = input_aggregate.insertInto("kim_test");
TableResult tableResult = tablePipeline.execute();
tableResult.await();
The output_sql_table string I have is:
String output_sql_table = "CREATE TABLE IF NOT EXISTS kim_test (\n" +
" account_id STRING,\n" +
" txn_aggregate_amount INT,\n" +
" txn_aggregate_count INT,\n" +
" PRIMARY KEY(account_id) NOT ENFORCED\n" +
" ) WITH (\n" +
" 'connector' = 'jdbc',\n" +
" 'url' = 'jdbc:<mysql://ip>:port/db',\n" +
" 'table-name' = 'kim_test',\n" +
" 'driver' = 'com.mysql.jdbc.Driver',\n" +
" 'username' = '" + username + "',\n" +
" 'password' = '" + password + "'"+
")";
Which runs into this error:
Caused by: java.sql.SQLSyntaxErrorException: Table 'db.kim_test' doesn't exist
I can manually go into the mysql db and can confirm that the db exists, and i’m able to read from db.input (one of the table I got my CDC from). db.kim_test doesn’t exist of course (because I want to create it as the MySQL output/sink). I’m tearing my hair out as how to proceed, and would love if anyone has any pointers!Kim Nguyen
08/04/2023, 4:20 AMsap1ens
08/04/2023, 4:41 AMsap1ens
08/04/2023, 4:42 AMKim Nguyen
08/04/2023, 4:51 AMDavid Anderson
08/04/2023, 3:47 PMIshan
08/04/2023, 5:58 PM