flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wuchong <...@git.apache.org>
Subject [GitHub] flink pull request #3027: [FLINK-5358] add RowTypeInfo exctraction in TypeEx...
Date Tue, 20 Dec 2016 02:03:13 GMT
Github user wuchong commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3027#discussion_r93159264
  
    --- Diff: flink-core/src/test/java/org/apache/flink/api/java/typeutils/TypeExtractorTest.java
---
    @@ -345,8 +346,22 @@ public CustomType cross(CustomType first, Integer second) throws
Exception {
     
     		Assert.assertFalse(TypeExtractor.getForClass(PojoWithNonPublicDefaultCtor.class) instanceof
PojoTypeInfo);
     	}
    -	
     
    +	@Test
    +	public void testRow() {
    +		Row row = new Row(2);
    +		row.setField(0, "string");
    +		row.setField(1, 15);
    +		TypeInformation<Row> rowInfo = TypeExtractor.getForObject(row);
    +		Assert.assertEquals(rowInfo.getClass(), RowTypeInfo.class);
    +		Assert.assertEquals(2, rowInfo.getArity());
    +
    +		Row nullRow = new Row(2);
    +		TypeInformation<Row> genericRowInfo = TypeExtractor.getForObject(nullRow);
    +		Assert.assertEquals(genericRowInfo, new GenericTypeInfo<>(Row.class));
    +		int arity = genericRowInfo.getArity();
    +		genericRowInfo.hashCode();
    --- End diff --
    
    Why do we call `getArity()` and `hashCode()` here ? 


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