Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-6632

Unable to run Query with TUMBLE interval >= 25 DAY

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • 2.9.0, 2.10.0
    • 2.11.0
    • dsl-sql
    • None

    Description

      I am not able to run query with interval DAY >= 25.

      Example:

      SELECT f_int2, COUNT(*) AS `getFieldCount`,
      TUMBLE_START(f_timestamp, INTERVAL '31' DAY) AS `window_start`,
      TUMBLE_END(f_timestamp, INTERVAL '31' DAY) AS `window_end` 
      FROM TABLE_A 
      GROUP BY f_int2, TUMBLE(f_timestamp, INTERVAL '31' DAY)
      

      It result to IllegalArgumentException: FixedWindows WindowingStrategies must have 0 <= offset < size

       

      Caused by: java.lang.IllegalArgumentException: FixedWindows WindowingStrategies must have 0 <= offset < size
      	at org.apache.beam.sdk.transforms.windowing.FixedWindows.<init>(FixedWindows.java:65)
      	at org.apache.beam.sdk.transforms.windowing.FixedWindows.of(FixedWindows.java:50)
      	at org.apache.beam.sdk.extensions.sql.impl.rule.BeamAggregationRule.createWindowFn(BeamAggregationRule.java:137)
      	at org.apache.beam.sdk.extensions.sql.impl.rule.BeamAggregationRule.updateWindow(BeamAggregationRule.java:77)
      	at org.apache.beam.sdk.extensions.sql.impl.rule.BeamAggregationRule.onMatch(BeamAggregationRule.java:59)
      	at org.apache.beam.repackaged.beam_sdks_java_extensions_sql.org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:212)

      Looks like Integer overflow in BeamAggregationRule.java#L184. Solution should be simple: getting long value from RexNode.

       

      I can create PR and TestCase for this bug. 

       

      Attachments

        Issue Links

          Activity

            People

              LesTR Lukas Drbal
              LesTR Lukas Drbal
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 3h 50m
                  3h 50m