You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/10/02 20:01:07 UTC

[jira] [Commented] (FLINK-7678) SQL UserDefineTableFunction does not take CompositeType input correctly

    [ https://issues.apache.org/jira/browse/FLINK-7678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16188729#comment-16188729 ] 

ASF GitHub Bot commented on FLINK-7678:
---------------------------------------

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

    https://github.com/apache/flink/pull/4726#discussion_r142238516
  
    --- Diff: flink-libraries/flink-table/src/test/scala/org/apache/flink/table/runtime/stream/table/CorrelateITCase.scala ---
    @@ -210,6 +213,31 @@ class CorrelateITCase extends StreamingMultipleProgramsTestBase {
         assertEquals(expected.sorted, StreamITCase.testResults.sorted)
       }
     
    +  @Test
    +  def testRowType(): Unit = {
    +    val row = Row.of(
    +      12.asInstanceOf[Integer],
    +      true.asInstanceOf[JBoolean],
    +      Row.of(1.asInstanceOf[Integer], 2.asInstanceOf[Integer], 3.asInstanceOf[Integer])
    +    )
    +
    +    val rowType = Types.ROW(Types.INT, Types.BOOLEAN, Types.ROW(Types.INT, Types.INT, Types.INT))
    +    val in = env.fromElements(row, row)(rowType).toTable(tEnv).as('a, 'b, 'c)
    +
    +    val tableFunc4 = new TableFunc4()
    +    val result = in
    +      .join(tableFunc4('c) as ('f0, 'f1, 'f2))
    +      .select('c, 'f2)
    +
    +    result.addSink(new StreamITCase.StringSink[Row])
    +    env.execute()
    +
    +    val expected = mutable.MutableList(
    +      "1,2,3,3",
    --- End diff --
    
    is this the correct result? Shouldn't `'c` remain nested? We did not ask to flatten it.


> SQL UserDefineTableFunction does not take CompositeType input correctly
> -----------------------------------------------------------------------
>
>                 Key: FLINK-7678
>                 URL: https://issues.apache.org/jira/browse/FLINK-7678
>             Project: Flink
>          Issue Type: Bug
>          Components: Table API & SQL
>    Affects Versions: 1.3.2
>            Reporter: Rong Rong
>            Assignee: Timo Walther
>
> UDF is using FlinkTypeFactory to infer operand type while UDTF does not go through the same code path. This result in:
> {code:console}
> org.apache.flink.table.api.ValidationException: SQL validation failed. From line 1, column 38 to line 1, column 44: No match found for function signature func(<COMPOSITE(Row(f0: Integer, f1: String))>) 
> Caused by: org.apache.calcite.runtime.CalciteContextException: From line 1, column 38 to line 1, column 44: No match found for function signature func(<COMPOSITE(Row(f0: Integer, f1: String))>)
> {code}
> Please see github code for more info:
> https://github.com/walterddr/flink/blob/bug_report/flink-libraries/flink-table/src/test/scala/org/apache/flink/table/api/batch/sql/UDTFCompositeTypeTestFailure.scala



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)