Hi ,

i'm looking for an comfortable way to read a CSV file with the DataStream API 
in Flink 1.11.

Without using the Table/SQL-API before.

This is my first approach:

val typeInfo = 
TypeInformation.of(classOf[CovidEvent]).asInstanceOf[PojoTypeInfo[CovidEvent]]

val csvInputFormat = new PojoCsvInputFormat(new Path(sourcePath), "\n", ",", 
typeInfo)

env.readFile(csvInputFormat, sourcePath)


But then I get the following error because I want to parse a string to Date 
directly:

Exception in thread "main" java.lang.IllegalArgumentException: The type 
'java.util.Date' is not supported for the CSV input format.


Or do I have to read it as String, then map it with some Jackson Parser and 
then call assignTimestampsAndWatermarks function on that?


Thanks four your help.


Best,
Jan

HINWEIS: Dies ist eine vertrauliche Nachricht und nur f?r den Adressaten 
bestimmt. Es ist nicht erlaubt, diese Nachricht zu kopieren oder Dritten 
zug?nglich zu machen. Sollten Sie diese Nachricht irrt?mlich erhalten haben, 
bitte ich um Ihre Mitteilung per E-Mail oder unter der oben angegebenen 
Telefonnummer.

Reply via email to