experiencedProcrastinator opened a new issue, #32458:
URL: https://github.com/apache/beam/issues/32458

   ### What happened?
   
   When using a DAY tumble window, the aggregated output is correct. However, 
when using a MONTH tumble window, all input records pass through without 
aggregation
   
   I ran the following SQL query using DirectRunner on batch data with:
   - window = "'1' DAY"
   - window = "'1' MONTH"
   
   Query:
   ```java
   private static String getSQLQuery(String window) {
      return String.format("SELECT user_id, SUM(amount) as amount_sum, 
TUMBLE_START(ts, INTERVAL %s) AS start_ts, TUMBLE_END(ts, INTERVAL %s) AS 
end_ts from PCOLLECTION group by user_id, TUMBLE(ts, INTERVAL %s)", window, 
window, window);
   }
   ```
   
   Test code
   
[beam-test.zip](https://github.com/user-attachments/files/17002017/beam-test.zip)
   
   Input
   ```json
   [
     {
       "user_id": "user1",
       "amount": 100,
       "ts": "2022-05-09T12:10:00.00Z"
     },
     {
       "user_id": "user1",
       "amount": 200,
       "ts": "2022-05-09T12:50:00.00Z"
     },
     {
       "user_id": "user1",
       "amount": 500,
       "ts": "2022-08-10T11:40:00.00Z"
     }
   ]
   ```
   
   Output with 1 DAY window:
   ```
   Row: 
   user_id:user1
   amount_sum:300
   start_ts:2022-05-09T00:00:00.000Z
   end_ts:2022-05-10T00:00:00.000Z
   
   Row: 
   user_id:user1
   amount_sum:500
   start_ts:2022-08-10T00:00:00.000Z
   end_ts:2022-08-11T00:00:00.000Z
   ```
   
   Output with 1 MONTH window:
   ```
   Row: 
   user_id:user1
   amount_sum:100
   start_ts:2022-05-09T12:10:00.000Z
   end_ts:2022-05-09T12:10:00.001Z
   
   Row: 
   user_id:user1
   amount_sum:500
   start_ts:2022-08-10T11:40:00.000Z
   end_ts:2022-08-10T11:40:00.001Z
   
   Row: 
   user_id:user1
   amount_sum:200
   start_ts:2022-05-09T12:50:00.000Z
   end_ts:2022-05-09T12:50:00.001Z
   ```
   
   
   ### Issue Priority
   
   Priority: 2 (default / most bugs should be filed as P2)
   
   ### Issue Components
   
   - [ ] Component: Python SDK
   - [X] Component: Java SDK
   - [ ] Component: Go SDK
   - [ ] Component: Typescript SDK
   - [ ] Component: IO connector
   - [ ] Component: Beam YAML
   - [ ] Component: Beam examples
   - [ ] Component: Beam playground
   - [ ] Component: Beam katas
   - [ ] Component: Website
   - [ ] Component: Infrastructure
   - [ ] Component: Spark Runner
   - [ ] Component: Flink Runner
   - [ ] Component: Samza Runner
   - [ ] Component: Twister2 Runner
   - [ ] Component: Hazelcast Jet Runner
   - [ ] Component: Google Cloud Dataflow Runner


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to