[
https://issues.apache.org/jira/browse/FLINK-3631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15204556#comment-15204556
]
ASF GitHub Bot commented on FLINK-3631:
---------------------------------------
GitHub user ramkrish86 opened a pull request:
https://github.com/apache/flink/pull/1823
[FLINK-3631] CodeGenerator does not check type compatibility for equa…
Adds a check on the CodeGenerator.scala code which does a check on the left
and right operands so that all the comparison expressions can work now.
(=,!=,>,<)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ramkrish86/flink FLINK-3631
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1823.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1823
----
commit d107f4825d40998b9e40a5270b8df48dd48b8eb2
Author: ramkrishna <[email protected]>
Date: 2016-03-21T16:33:42Z
[FLINK-3631] CodeGenerator does not check type compatibility for equality
expressions
----
> CodeGenerator does not check type compatibility for equality expressions
> ------------------------------------------------------------------------
>
> Key: FLINK-3631
> URL: https://issues.apache.org/jira/browse/FLINK-3631
> Project: Flink
> Issue Type: Bug
> Components: Table API
> Affects Versions: 1.1.0
> Reporter: Fabian Hueske
>
> The following Table API query does not fail but produces an empty result:
> {code}
> val env = ExecutionEnvironment.getExecutionEnvironment
> val ds = CollectionDataSets.get3TupleDataSet(env).as('a, 'b, 'c)
> // must fail. Field 'a is not a string.
> ds.filter( 'a === "nope" ).collect()
> {code}
> The generated flatMap code looks like this:
> {code}
> @Override
> public void flatMap(Object _in1, org.apache.flink.util.Collector c) throws
> Exception {
> org.apache.flink.api.table.Row in1 = (org.apache.flink.api.table.Row) _in1;
>
> java.lang.String result$17 = (java.lang.String) in1.productElement(2);
> int result$11 = (java.lang.Integer) in1.productElement(0);
> long result$14 = (java.lang.Long) in1.productElement(1);
> java.lang.String result$19 = "nope";
>
> boolean result$21 = result$19.equals(result$11);
>
> if (result$21) {
> out.setField(0, result$11);
> out.setField(1, result$14);
> out.setField(2, result$17);
> c.collect(out);
> }
> }
> {code}
> I would expect the query to fail due to a Integer/String type conflict.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)