[
https://issues.apache.org/jira/browse/FLINK-6618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
sunjincheng updated FLINK-6618:
---
Description:
I find 2 bugs as follows:
1. {{GroupWindowStringExpressionTest}} testcase bug:
{{Assert.assertEquals("Logical Plans do not match", resJava.logicalPlan,
resJava.logicalPlan)}} -> {{verifyTableEquals(resJava, resScala)}}
2. Window properties can not select in JAVA API:
Java Code:
{code}
// String / Java API
val resJava = t
.window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w)
.groupBy("w, string")
.select(
"string, " +
"myCountFun(string), " +
"int.sum, " +
"weightAvgFun(long, int), " +
"weightAvgFun(int, int) * 2, " +
"start(w)," +
"end(w)")
{code}
Exception Info:
{code}
org.apache.flink.table.api.ValidationException: Cannot resolve [w] given input
[int, long, string, rowtime].
at
org.apache.flink.table.plan.logical.LogicalNode.failValidation(LogicalNode.scala:143)
at
org.apache.flink.table.plan.logical.LogicalNode$$anonfun$validate$1.applyOrElse(LogicalNode.scala:86)
at
org.apache.flink.table.plan.logical.LogicalNode$$anonfun$validate$1.applyOrElse(LogicalNode.scala:83)
at
org.apache.flink.table.plan.TreeNode.postOrderTransform(TreeNode.scala:72)
at
org.apache.flink.table.plan.logical.LogicalNode.org$apache$flink$table$plan$logical$LogicalNode$$expressionPostOrderTransform$1(LogicalNode.scala:119)
at
org.apache.flink.table.plan.logical.LogicalNode$$anonfun$7$$anonfun$apply$1.apply(LogicalNode.scala:132)
at
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at
scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at
scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
{code}
was:
I find 2 bugs as follows:
1. {{GroupWindowStringExpressionTest}} testcase bug:
{{Assert.assertEquals("Logical Plans do not match", resJava.logicalPlan,
resJava.logicalPlan)}} -> {{Assert.assertEquals("Logical Plans do not match",
resJava.logicalPlan, resScala.logicalPlan)}}
2. When i fix the bug above, we got anther bug:
{code}
java.lang.AssertionError: Logical Plans do not match
Expected :Project(ListBuffer('string, 'TMP_4, 'TMP_5, 'TMP_6, ('TMP_7 * 2) as
'_c4),WindowAggregate(List('string),SlidingGroupWindow('w, 'rowtime,
1440.millis, 720.millis),List(),List(CountAggFunction(List('string)) as
'TMP_4, sum('int) as 'TMP_5, WeightedAvg(List('long, 'int)) as 'TMP_6,
WeightedAvg(List('int, 'int)) as 'TMP_7),Project(ArrayBuffer('string, 'int,
'long,
'rowtime),CatalogNode(WrappedArray(_DataStreamTable_0),RecordType(INTEGER int,
BIGINT long, VARCHAR(2147483647) string, TIMESTAMP(3) rowtime)
Actual :Project(ListBuffer('string, 'TMP_0, 'TMP_1, 'TMP_2, ('TMP_3 * 2) as
'_c4),WindowAggregate(ArrayBuffer('string),SlidingGroupWindow('w, 'rowtime,
1440.millis,
720.millis),List(),List(CountAggFunction(ArrayBuffer('string)) as 'TMP_0,
sum('int) as 'TMP_1, WeightedAvg(ArrayBuffer('long, 'int)) as 'TMP_2,
WeightedAvg(ArrayBuffer('int, 'int)) as 'TMP_3),Project(ArrayBuffer('string,
'int, 'long,
'rowtime),CatalogNode(WrappedArray(_DataStreamTable_0),RecordType(INTEGER int,
BIGINT long, VARCHAR(2147483647) string, TIMESTAMP(3) rowtime)
{code}
> Fix GroupWindowStringExpressionTest testcase bug
>
>
> Key: FLINK-6618
> URL: https://issues.apache.org/jira/browse/FLINK-6618
> Project: Flink
> Issue Type: Sub-task
> Components: Table API & SQL
>Affects Versions: 1.3.0
>Reporter: sunjincheng
>Assignee: sunjincheng
>
> I find 2 bugs as follows:
> 1. {{GroupWindowStringExpressionTest}} testcase bug:
> {{Assert.assertEquals("Logical Plans do not match", resJava.logicalPlan,
> resJava.logicalPlan)}} -> {{verifyTableEquals(resJava, resScala)}}
> 2. Window properties can not select in JAVA API:
> Java Code:
> {code}
> // String / Java API
> val resJava = t
> .window(JSlide.over("4.hours").every("2.hours").on("rowtime") as 'w)
> .groupBy("w, string")
> .select(
> "string, " +
> "myCountFun(string), " +
> "int.sum, " +
> "weightAvgFun(long, int), " +
> "weightAvgFun(int, int) * 2, " +
> "start(w)," +
> "end(w)")
> {code}
> Exception Info:
> {code}
> org.apache.flink.table.api.ValidationException: Cannot resolve [w] given
> input [int, long, string, rowtime].
> at
> org.apache.flink.table.plan.logical.LogicalNode.failValidation(LogicalNode.scala:143)
> at
> org.apache.flink.table.plan.logical.LogicalNode$$anonfun$validate$1.applyOrElse(LogicalNode.scala:86)
> at
> org.apache.flink.table.plan.logical.LogicalNod