You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by fhueske <gi...@git.apache.org> on 2016/05/03 00:59:22 UTC

[GitHub] flink pull request: [Flink-3691] extend avroinputformat to support...

Github user fhueske commented on a diff in the pull request:

    https://github.com/apache/flink/pull/1920#discussion_r61819193
  
    --- 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 --
    
    But this test tests the `GenericRecord` mode with object reuse. Is it valid to give `null` as a reuse object?


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