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 2019/05/05 09:37:00 UTC
[jira] [Updated] (FLINK-12402) Make validation error message for
CallExpression more user friendly
[ https://issues.apache.org/jira/browse/FLINK-12402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated FLINK-12402:
-----------------------------------
Labels: pull-request-available (was: )
> 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
> Priority: Major
> Labels: pull-request-available
>
> 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:
> {code:java}
> @Test
> 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])
> env.execute()
> val expected = mutable.MutableList(
> "1,1,Hi",
> "2,2,Hello",
> "3,2,Hello world")
> assertEquals(expected.sorted, StreamITCase.testResults.sorted)
> }
> {code}
> The error message is:
> {code:java}
> org.apache.flink.table.api.ValidationException: Invalid arguments [log(b), 'b'] for function: as
> {code}
> 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
(v7.6.3#76005)