twalthr commented on a change in pull request #8521: [FLINK-12601][table] Make 
the DataStream & DataSet conversion to a Table independent from Calcite
URL: https://github.com/apache/flink/pull/8521#discussion_r289790092
 
 

 ##########
 File path: 
flink-table/flink-table-api-java/src/test/java/org/apache/flink/table/operations/TableOperationTest.java
 ##########
 @@ -51,14 +55,38 @@ public void testSummaryString() {
                        SetTableOperation.SetTableOperationType.UNION,
                        true);
 
-               assertEquals("UNION: (all: [true])\n" +
+               assertEquals("Union: (all: [true])\n" +
                        "    Project: (projections: [a])\n" +
                        "        CatalogTable(path: [cat1, db1, tab1], fields: 
[a])\n" +
                        "    Project: (projections: [a])\n" +
                        "        CatalogTable(path: [cat1, db1, tab1], fields: 
[a])",
                        unionTableOperation.asSummaryString());
        }
 
+       @Test
+       public void testWindowAggregationSummaryString() {
+               TableSchema schema = TableSchema.builder().field("a", 
DataTypes.INT()).build();
+               FieldReferenceExpression field = new 
FieldReferenceExpression("a", Types.INT, 0, 0);
+               WindowAggregateTableOperation tableOperation = new 
WindowAggregateTableOperation(
+                       Collections.singletonList(field),
+                       Collections.singletonList(new 
CallExpression(BuiltInFunctionDefinitions.SUM, Arrays.asList(field))),
+                       Collections.emptyList(),
+                       
WindowAggregateTableOperation.ResolvedGroupWindow.sessionWindow("w", field, 
ApiExpressionUtils.valueLiteral(
+                               10,
+                               TimeIntervalTypeInfo.INTERVAL_MILLIS)),
+                       new CatalogTableOperation(
+                               Arrays.asList("cat1", "db1", "tab1"),
+                               schema),
+                       schema
+               );
+
+               assertEquals(
+                       "WindowAggregate: (group: [a], agg: [sum(a)], 
windowProperties: []," +
+                               " window: [SessionWindow(field: [a], gap: 
[10.millis])])\n" +
+                               "    CatalogTable(path: [cat1, db1, tab1], 
fields: [a])",
 
 Review comment:
   `CatalogTable: (`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to