Aljoscha Krettek created FLINK-1156:
---------------------------------------

             Summary: Bug in Constant Fields Annotation (Semantic Properties) 
                 Key: FLINK-1156
                 URL: https://issues.apache.org/jira/browse/FLINK-1156
             Project: Flink
          Issue Type: Bug
            Reporter: Aljoscha Krettek


When I change the first test in SemanticPropUtilTest.java to this:

{code}
@Test
public void testConstantWithArrowIndividualStrings() {
        String[] constantFields = { "0->0,1", "1->3" };

        TypeInformation<?> type = new TupleTypeInfo<Tuple3<Integer, Integer, 
Integer>>(BasicTypeInfo.INT_TYPE_INFO,
                        BasicTypeInfo.INT_TYPE_INFO, 
BasicTypeInfo.INT_TYPE_INFO);
        TypeInformation<?> outType = new TupleTypeInfo<Tuple4<Integer, Integer, 
Integer, Integer>>(BasicTypeInfo.INT_TYPE_INFO,
                        BasicTypeInfo.INT_TYPE_INFO, 
BasicTypeInfo.INT_TYPE_INFO, BasicTypeInfo.INT_TYPE_INFO);

        SingleInputSemanticProperties sp = 
SemanticPropUtil.getSemanticPropsSingleFromString(constantFields, null, null, 
type, outType);

        FieldSet fs = sp.getForwardedField(0);
        Assert.assertTrue(fs.size() == 2);
        Assert.assertTrue(fs.contains(0));
        Assert.assertTrue(fs.contains(1));

        fs = sp.getForwardedField(1);
        Assert.assertTrue(fs.size() == 1);
        Assert.assertTrue(fs.contains(2));
}
{code}

It fails. It seems the check whether a tuple field is in range is performed on 
the input type and the output type is being ignored.

Also, I'm not sure this whole thing works anymore with [~rmetzger]'s recent 
POJO rework and nested tuple field selection rework.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to