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:14:35 GMT
Github user greghogan commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1920#discussion_r60950868
  
    --- Diff: flink-batch-connectors/flink-avro/src/test/java/org/apache/flink/api/io/avro/AvroRecordInputFormatTest.java
---
    @@ -289,6 +290,119 @@ public void testDeserializeToSpecificType() throws IOException {
     		}
     	}
     
    +	/**
    +	 * Test if the AvroInputFormat is able to properly read data from an Avro
    +	 * file as a GenericRecord.
    +	 * 
    +	 * @throws IOException,
    +	 *             if there is an exception
    +	 */
    +	@SuppressWarnings("unchecked")
    +	@Test
    +	public void testDeserialisationGenericRecord() throws IOException {
    +		Configuration parameters = new Configuration();
    +
    +		AvroInputFormat<GenericRecord> format = new AvroInputFormat<GenericRecord>(new
Path(testFile.getAbsolutePath()),
    +				GenericRecord.class);
    +		try {
    +			format.configure(parameters);
    +			FileInputSplit[] splits = format.createInputSplits(1);
    +			assertEquals(splits.length, 1);
    +			format.open(splits[0]);
    +
    +			GenericRecord u = format.nextRecord(null);
    --- End diff --
    
    I think this should be `format.nextRecord()` since `nextRecord(reuse)` requires an object
to be passed in.


---
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