flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From greghogan <...@git.apache.org>
Subject [GitHub] flink pull request: Flink 3691 extend avroinputformat to support g...
Date Mon, 25 Apr 2016 17:05:54 GMT
Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1920#discussion_r60949545
  
    --- Diff: flink-batch-connectors/flink-avro/src/main/java/org/apache/flink/api/java/io/AvroInputFormat.java
---
    @@ -119,12 +144,18 @@ public E nextRecord(E reuseValue) throws IOException {
     		if (reachedEnd()) {
     			return null;
     		}
    -		
    -		if (!reuseAvroValue) {
    -			reuseValue = InstantiationUtil.instantiate(avroValueType, Object.class);
    +		if (isGenericRecord) {
    --- End diff --
    
    Can we replace the nested-if with `return reuseAvroValue ? dataFileReader.next(reuseValue)
: dataFileReader.next();`, remove the `isGenericRecord` field, and flatten the `GenericDatumReader`
/ `SpecificDatumReader` / `ReflectDatumReader` if-statement above?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message