You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Flink Jira Bot (Jira)" <ji...@apache.org> on 2022/04/19 22:40:00 UTC

[jira] [Updated] (FLINK-20765) ScalarOperatorGens doesn't set proper nullability for result type of generated expressions

     [ https://issues.apache.org/jira/browse/FLINK-20765?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Flink Jira Bot updated FLINK-20765:
-----------------------------------
    Labels: auto-deprioritized-major auto-deprioritized-minor stale-major  (was: auto-deprioritized-major auto-deprioritized-minor)

I am the [Flink Jira Bot|https://github.com/apache/flink-jira-bot/] and I help the community manage its development. I see this issues has been marked as Major but is unassigned and neither itself nor its Sub-Tasks have been updated for 60 days. I have gone ahead and added a "stale-major" to the issue". If this ticket is a Major, please either assign yourself or give an update. Afterwards, please remove the label or in 7 days the issue will be deprioritized.


> ScalarOperatorGens doesn't set proper nullability for result type of generated expressions
> ------------------------------------------------------------------------------------------
>
>                 Key: FLINK-20765
>                 URL: https://issues.apache.org/jira/browse/FLINK-20765
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Runtime
>            Reporter: Rui Li
>            Priority: Major
>              Labels: auto-deprioritized-major, auto-deprioritized-minor, stale-major
>
> Suppose we have a function that takes a BOOLEAN NOT NULL parameter:
> {code}
> 	/**
> 	 * A function that takes BOOLEAN NOT NULL.
> 	 */
> 	public static class BoolEcho extends ScalarFunction {
> 		public Boolean eval(@DataTypeHint("BOOLEAN NOT NULL") Boolean b) {
> 			return b;
> 		}
> 	}
> {code}
> Then the following test case will fail:
> {code}
> CREATE TABLE SourceTable(x INT NOT NULL,y INT) WITH ('connector' = 'COLLECTION');
> SELECT BoolEcho(x=1 and y is null) FROM SourceTable;
> {code}
> with exception:
> {noformat}
> org.apache.flink.table.planner.codegen.CodeGenException: Mismatch of function's argument data type 'BOOLEAN NOT NULL' and actual argument type 'BOOLEAN'.
> 	at org.apache.flink.table.planner.codegen.calls.BridgingFunctionGenUtil$$anonfun$verifyArgumentTypes$1.apply(BridgingFunctionGenUtil.scala:323)
> 	at org.apache.flink.table.planner.codegen.calls.BridgingFunctionGenUtil$$anonfun$verifyArgumentTypes$1.apply(BridgingFunctionGenUtil.scala:320)
> 	at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
> 	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
> 	at org.apache.flink.table.planner.codegen.calls.BridgingFunctionGenUtil$.verifyArgumentTypes(BridgingFunctionGenUtil.scala:320)
> 	at org.apache.flink.table.planner.codegen.calls.BridgingFunctionGenUtil$.generateFunctionAwareCallWithDataType(BridgingFunctionGenUtil.scala:95)
> 	at org.apache.flink.table.planner.codegen.calls.BridgingFunctionGenUtil$.generateFunctionAwareCall(BridgingFunctionGenUtil.scala:65)
> 	at org.apache.flink.table.planner.codegen.calls.BridgingSqlFunctionCallGen.generate(BridgingSqlFunctionCallGen.scala:62)
> 	at org.apache.flink.table.planner.codegen.ExprCodeGenerator.generateCallExpression(ExprCodeGenerator.scala:832)
> 	at org.apache.flink.table.planner.codegen.ExprCodeGenerator.visitCall(ExprCodeGenerator.scala:529)
> 	at org.apache.flink.table.planner.codegen.ExprCodeGenerator.visitCall(ExprCodeGenerator.scala:56)
> 	at org.apache.calcite.rex.RexCall.accept(RexCall.java:174)
> 	at org.apache.flink.table.planner.codegen.ExprCodeGenerator.generateExpression(ExprCodeGenerator.scala:155)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)