Hi all, I am trying to implement Kafka connector t...
# troubleshooting
k
Hi all, I am trying to implement Kafka connector to process log with SQL, like below
Copy code
String sourceDDL =
        "CREATE TABLE Log (\n" +
                "  a1 STRING,\n" +
                "  a2 INT\n" +
                ") WITH (\n" +
                "  'connector' = 'kafka',\n" +
                "  'topic' = 'source_topic',\n" +
                "  'value.format' = 'json', " +
                "  'properties.bootstrap.servers' = 'ip',\n" +
                "'scan.startup.mode' = 'latest-offset','properties.auto.offset.reset' = 'latest'" +
                ")";

streamTableEnvironment.executeSql(sourceDDL);

Table table = streamTableEnvironment.sqlQuery("SELECT * FROM Log");

DataStreamRow rowDataStream = streamTableEnvironment.toDataStream(table);
rowDataStream.print();
Now when I try below log it is working fine for me { “a1":“asdf”, “a2":1 } But if there any datatype mismatch({“a1”“asdf”,“a2”[1]}) then program is failing, Do anyone have idea how to handle the exception while using Kafka connector in SQL/Table API?
✅ 1
Solved issue by using below configuration options
Copy code
'format' = 'json',
  'json.ignore-parse-errors' = 'true'