flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hequn Cheng (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-12402) Make validation error message for CallExpression more user friendly
Date Sun, 05 May 2019 07:57:00 GMT
Hequn Cheng created FLINK-12402:

             Summary: Make validation error message for CallExpression more user friendly
                 Key: FLINK-12402
                 URL: https://issues.apache.org/jira/browse/FLINK-12402
             Project: Flink
          Issue Type: Improvement
          Components: Table SQL / API
            Reporter: Hequn Cheng
            Assignee: Hequn Cheng

Currently, the error message for CallExpression validation may not display the root cause
which may confuse our users. Take the following test as an example:

  def testSimpleSelectAllWithAs(): Unit = {

    val env = StreamExecutionEnvironment.getExecutionEnvironment
    val tEnv = StreamTableEnvironment.create(env)
    StreamITCase.testResults = mutable.MutableList()
    val ds = StreamTestData.getSmall3TupleDataStream(env).toTable(tEnv, 'a, 'b, 'c)
      .select('a, 'b.log as 'b, 'c)

    val results = ds.toAppendStream[Row]
    results.addSink(new StreamITCase.StringSink[Row])

    val expected = mutable.MutableList(
        "3,2,Hello world")
    assertEquals(expected.sorted, StreamITCase.testResults.sorted)

The error message is:
org.apache.flink.table.api.ValidationException: Invalid arguments [log(b), 'b'] for function:

>From the error message, it shows there is something wrong with the `as` function. However,
the root cause is the log function can only accept a double parameter while b is a long number.

To make it more user friendly, it would be better to display the root cause error message.

This message was sent by Atlassian JIRA

View raw message