Hey team, I am trying to read JSON files where eac...
# troubleshooting
d
Hey team, I am trying to read JSON files where each element is in a new line using Table API, but JSON assumes we have every object in one line. I also tried to eliminate newlines using datastream but it does so line by line so removing newlines does not affect the file. Any thoughts? Example: { "a":1, "b": "a" } CREATE TABLE my_table (entry ROW<`a` INT,
b
STRING>) WITH ( 'connector' = 'filesystem', 'path' = 'my_file.json', 'format'='json'); select * from my_table; gives: [ERROR] Could not execute SQL statement. Reason: org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.io.JsonEOFException: Unexpected end-of-input: expected close marker for Object (start marker at [Source: (byte[])"{"; line: 1, column: 1]) at [Source: UNKNOWN; line: 1, column: 2]
s
I am not sure about the Table API but can you check if there is some property like
(multiline, true)
in the Table API?
d
No I dont think I have seen one.