Kaiwen Yuan
08/14/2023, 10:24 PMload local avro files, convert them into source / stream to process but in vain. I have tried FileSource.forRecordStreamFormat but no luck. Does anyone happen to solve a problem like this before ?Benjamin Leff
08/14/2023, 11:07 PMKaiwen Yuan
08/14/2023, 11:12 PMBenjamin Leff
08/14/2023, 11:12 PMBenjamin Leff
08/14/2023, 11:14 PMval format = ParquetColumnarRowInputFormat.createPartitionedFormat(
hadoopConfig=new Configuration(),
producedRowType=rowType,
producedTypeInfo=rowTypeInfo,
partitionKeys=partitionKeys,
extractor=extractor,
batchSize=2048,
isUtcTimestamp=true,
isCaseSensitive=false
)
// // Monitor the Paths to read data as unbounded data
val source = FileSource
.forBulkFileFormat(format, datalakeS3Path)
.monitorContinuously(Duration.ofMillis(5L))
.build()
val dataStream = env.fromSource(source, WatermarkStrategy.noWatermarks(), "DataLake")
dataStreamKaiwen Yuan
08/14/2023, 11:24 PMExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
AvroInputFormat<User> users = new AvroInputFormat<User>(new Path(avroFilePath), User.class);
DataSet<User> userDataSet = env.createInput(users);
List<User> userDataList = userDataSet.collect();
StreamExecutionEnvironment streamEnv = StreamExecutionEnvironment.getExecutionEnvironment();
DataStream<User> stream = streamEnv.fromCollection(userDataList);Kaiwen Yuan
08/14/2023, 11:24 PMKaiwen Yuan
08/14/2023, 11:25 PMBenjamin Leff
08/14/2023, 11:29 PMFileSource api is not easy to useKaiwen Yuan
08/14/2023, 11:30 PMBenjamin Leff
08/14/2023, 11:30 PMSimon Gabet
09/06/2023, 3:34 PMAvroInputFormat is for the old API. I saw what you did but I don't want (nor can...) collect my dataset, so your solution would not work for me πBenjamin Leff
09/06/2023, 6:21 PM