Skip to content

[FEATURE] Support GroupBy Window (time span) in Calcite #3354

Closed

Description

@LantaoJin

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();
  }

Activity

  1. added
    enhancement
    on Feb 26, 2025
  2. added
    calcite
    and removed
    enhancement
    on Feb 26, 2025
  3. songkant-aws commented on Mar 19, 2025

    @songkant-aws
    Collaborator

    Worked on this issue by implementing a custom SPAN UDF to unblock the integration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Priority-Highcalcitefeature

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions