[ 
https://issues.apache.org/jira/browse/FLINK-14617?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Flink Jira Bot updated FLINK-14617:
-----------------------------------
      Labels: auto-deprioritized-major auto-deprioritized-minor  (was: 
auto-deprioritized-major stale-minor)
    Priority: Not a Priority  (was: Minor)

This issue was labeled "stale-minor" 7 days ago and has not received any 
updates so it is being deprioritized. If this ticket is actually Minor, please 
raise the priority and ask a committer to assign you the issue or revive the 
public discussion.


> Dataset Parquet ClassCastException for SpecificRecord
> -----------------------------------------------------
>
>                 Key: FLINK-14617
>                 URL: https://issues.apache.org/jira/browse/FLINK-14617
>             Project: Flink
>          Issue Type: Bug
>          Components: API / DataSet
>    Affects Versions: 1.8.0
>         Environment: {code:java}
>  {code}
>            Reporter: Dominik Wosiński
>            Priority: Not a Priority
>              Labels: auto-deprioritized-major, auto-deprioritized-minor
>
> The following code runs smoothly when the _executionEnvironment_ is instance 
> of _StreamExecutionEnvironment_:
> {code:java}
> val filePaths = //some links to s3 files
> val job = Job.getInstance()
> AvroReadSupport.setAvroDataSupplier(job.getConfiguration, 
> classOf[AvroDataSupplierWithTimestampConversion])
> val avroParquetInputFormat = new AvroParquetInputFormat[GpsPointDTO]()
> val hadoopInputFormat = new HadoopInputFormat[Void, 
> GpsPointDTO](avroParquetInputFormat, classOf[Void], classOf[GpsPointDTO], job)
> FileInputFormat.addInputPaths(job, filePaths.head)
> executionEnvironment.createInput(hadoopInputFormat).map(_._2).print(){code}
> But when the _ExecutionEnvironment_ is used instead of 
> _StreamExecutionEnviroment,_ then the code throws the: 
> {code:java}
> Caused by: java.lang.ClassCastException: class 
> org.apache.avro.generic.GenericData$Record cannot be cast to class 
> com.company.GpsPointDTO (org.apache.avro.generic.GenericData$Record and 
> com.company.GpsPointDTO are in unnamed module of loader 'app'){code}
> I don't think this is the expected behavior. 
> The code simply reads some files from S3. It has the 
> _AvroSupplierWithTimestampConversion_ which is used to add timestamp 
> conversion to _DateTime_, _GpsPointDTO_ is a class generated from Avro schema.
> EDIT: It seems to work fine for Dataset API, if I remove the setting of 
> _avroDataSupplier_. Obviously, in such case I needed to change Avro schema to 
> use timestamp as _long_.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to