-
Notifications
You must be signed in to change notification settings - Fork 190
[FEATURE] Support GroupBy Window (time span) in Calcite #3354
Copy link
Copy link
Closed
Labels
Description
Is your feature request related to a problem?
The PPL
source=bank | stats avg(balance) by span(birthdate, 1 day)
Doesn't work as expected because Calcite doesn't support group by window, but it support Tumble table function. see https://github.com/apache/calcite/blob/main/core/src/test/java/org/apache/calcite/test/SqlToRelConverterTest.java
@Test void testTumble() {
final String sql = "select STREAM\n"
+ " TUMBLE_START(rowtime, INTERVAL '1' MINUTE) AS s,\n"
+ " TUMBLE_END(rowtime, INTERVAL '1' MINUTE) AS e\n"
+ "from Shipments\n"
+ "GROUP BY TUMBLE(rowtime, INTERVAL '1' MINUTE)";
sql(sql).ok();
}
@Test void testTableFunctionTumble() {
final String sql = "select *\n"
+ "from table(tumble(table Shipments, descriptor(rowtime), INTERVAL '1' MINUTE))";
sql(sql).ok();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Not Started