08-Recalc¶
¶
Recalc: super table watermark
Test WATERMARK option with out-of-order data:
1. Create database and super table with WATERMARK option
2. Create trigger tables for different stream types
3. Create streams with various trigger types using the trigger tables
4. Write initial trigger data to set baseline
5. Write source data to test WATERMARK handling
6. Check stream status to ensure they are running
7. Check results to verify correct handling of out-of-order data
¶
Meta change: table
test recalc bugs in stream
¶
Recalc: delete data
Test DELETE_RECALC option with data deletion:
1. Delete data from trigger table - streams with DELETE_RECALC should trigger recalculation
2. Delete child table - streams with DELETE_RECALC should trigger recalculation
3. Different trigger types behavior with data deletion
¶
Recalc: delete child table
Test DELETE_RECALC option with data deletion:
1. Delete data from trigger table - streams with DELETE_RECALC should trigger recalculation
2. Delete child table - streams with DELETE_RECALC should trigger recalculation
3. Different trigger types behavior with data deletion
¶
Recalc: watermark with out-of-order data
Test WATERMARK option with out-of-order data:
1. Write out-of-order data within WATERMARK tolerance - should trigger recalculation
2. Write out-of-order data exceeding WATERMARK tolerance - should be handled by recalculation mechanism
3. Different trigger types behavior with WATERMARK
¶
Recalc: time range
Test manual recalculation functionality:
1. Manual recalculation with time range - should recalculate specified time period
2. Manual recalculation without end time - should recalculate from start time to current
3. Different trigger types behavior with manual recalculation
4. Edge cases and error handling
¶
Recalc: different trigger with watermark
Test WATERMARK option with out-of-order data:
1. Write out-of-order data within WATERMARK tolerance - should trigger recalculation
2. Write out-of-order data exceeding WATERMARK tolerance - should be handled by recalculation mechanism
3. Different trigger types behavior with WATERMARK
4. EVENT_WINDOW with WATERMARK - should handle out-of-order data within tolerance
5. Check data correctness
¶
Recalc: watermark with expired_time option
Test EXPIRED_TIME option with expired data:
1. Write expired data - all windows should not trigger recalculation
2. Combine with WATERMARK - test boundary value behavior
3. Different trigger types behavior with expired data
¶
Recalc: mixed options
Test complex interactions between multiple stream recalculation options:
1. Test [EXPIRED_TIME + WATERMARK] Combination
1.1 Test option compatibility verification
1.1.1 Both options specified - verify legal combination
1.1.2 Option value conflict checking - verify error handling
1.2 Test data processing behavior
1.2.1 Data within watermark tolerance - should process normally
1.2.2 Data beyond watermark but within expired_time - should trigger recalculation
1.2.3 Data beyond both watermark and expired_time - should be ignored
1.3 Test boundary conditions
1.3.1 Data exactly at watermark boundary
1.3.2 Data exactly at expired_time boundary
1.3.3 Watermark value equals expired_time value
2. Test [IGNORE_DISORDER + WATERMARK] Combination
2.1 Test option conflict resolution
2.1.1 IGNORE_DISORDER true with WATERMARK - verify conflict handling
2.1.2 IGNORE_DISORDER false with WATERMARK - verify normal operation
2.2 Test out-of-order data handling
2.2.1 Disorder within watermark tolerance - test processing priority
2.2.2 Disorder beyond watermark tolerance - test ignore behavior
2.3 Test window trigger behavior
2.3.1 INTERVAL windows with conflicting options
2.3.2 SESSION windows with conflicting options
2.3.3 STATE_WINDOW with conflicting options
3. Test [DELETE_RECALC + EXPIRED_TIME] Combination
3.1 Test delete operation with expired data
3.1.1 Delete recent data - should trigger recalculation
3.1.2 Delete expired data - should not trigger recalculation
3.1.3 Delete data at expired_time boundary
3.2 Test different deletion scenarios
3.2.1 Delete from trigger table
3.2.2 Delete entire child table
3.2.3 Batch delete operations
4. Test [WATERMARK + DELETE_RECALC + EXPIRED_TIME] Comprehensive Combination
4.1 Test three-option interaction
4.1.1 All options compatible - verify normal operation
4.1.2 Option precedence verification
4.1.3 Performance impact assessment
4.2 Test complex data scenarios
4.2.1 Mixed operations (insert, update, delete) with all options
4.2.2 Out-of-order data with deletion and expiration
4.2.3 Boundary data across all option thresholds
4.3 Test error handling and recovery
4.3.1 Invalid option combinations
4.3.2 Resource constraints with multiple options
4.3.3 Stream recovery after option conflicts
5. Test Window Type Compatibility
5.1 Test INTERVAL windows with combined options
5.1.1 Different sliding window configurations
5.1.2 Option behavior with overlapping windows
5.2 Test SESSION windows with combined options
5.2.1 Session timeout interaction with options
5.2.2 Session boundary handling
5.3 Test STATE_WINDOW with combined options
5.3.1 State change detection with multiple options
5.3.2 State persistence across option boundaries
¶
Recalc: full deletion scenarios
Test DELETE_RECALC option behavior with various data deletion scenarios:
1. Test [DELETE_RECALC] Option Specification
1.1 Test option existence verification
1.1.1 DELETE_RECALC specified - verify recalculation on deletion
1.1.2 DELETE_RECALC not specified - verify no recalculation on deletion
1.1.3 DELETE_RECALC with invalid syntax - verify error handling
1.2 Test option value validation
1.2.1 Valid DELETE_RECALC specification
1.2.2 Invalid DELETE_RECALC syntax
1.2.3 DELETE_RECALC with other conflicting options
2. Test [Data Record Deletion] Scenarios
2.1 Test single record deletion
2.1.1 Delete recent data - should trigger recalculation
2.1.2 Delete historical data - should trigger recalculation
2.1.3 Delete data from closed window - verify window reopening
2.2 Test batch record deletion
2.2.1 Delete multiple records from same window
2.2.2 Delete records across multiple windows
2.2.3 Delete all records from a window
2.3 Test conditional deletion
2.3.1 DELETE with WHERE clause affecting single window
2.3.2 DELETE with WHERE clause affecting multiple windows
2.3.3 DELETE with complex WHERE conditions
3. Test [Child Table Deletion] Scenarios
3.1 Test entire child table deletion
3.1.1 DROP child table - verify impact on stream calculation
3.1.2 Delete all records from child table - verify empty table handling
3.1.3 Recreate child table after deletion - verify stream recovery
3.2 Test multiple child table operations
3.2.1 Delete multiple child tables simultaneously
3.2.2 Mix of record deletion and table deletion
3.2.3 Partial child table set deletion
4. Test [Window Type Behavior] with DELETE_RECALC
4.1 Test INTERVAL windows
4.1.1 Delete data from current window - verify immediate recalculation
4.1.2 Delete data from sliding windows - verify overlapping window updates
4.1.3 Delete data causing empty windows - verify window state handling
4.2 Test SESSION windows
4.2.1 Delete data from active session - verify session recalculation
4.2.2 Delete data causing session split - verify session boundary changes
4.2.3 Delete data causing session merge - verify session consolidation
4.3 Test STATE_WINDOW
4.3.1 Delete data causing state change - verify state window recalculation
4.3.2 Delete data from state boundary - verify window boundary updates
4.3.3 Delete all data from state window - verify window closure
4.4 Test EVENT_WINDOW
4.4.1 Delete start event data - verify window start recalculation
4.4.2 Delete end event data - verify window end recalculation
4.4.3 Delete intermediate data - verify window content recalculation
5. Test [Performance and Resource Impact]
5.1 Test large-scale deletion impact
5.1.1 Delete large volume of data - verify performance
5.1.2 Concurrent deletion operations - verify system stability
5.1.3 Resource usage during deletion recalculation
5.2 Test recovery scenarios
5.2.1 System restart after deletion - verify state recovery
5.2.2 Network interruption during deletion - verify consistency
5.2.3 Storage failure scenarios - verify data integrity
¶
Recalc: 6 different window with expire_time
Test EXPIRED_TIME(1h) option with 6 different window types and verify expired data handling:
1. Test [INTERVAL+SLIDING Window] with EXPIRED_TIME(1h)
1.1 Create s_interval_expired: interval(2m) sliding(2m) with expired_time(1h)
1.1.1 Process data from '2025-01-01 02:00:00' onwards (within 1h)
1.1.2 Insert expired data from '2025-01-01 01:00:00' (beyond 1h)
1.1.3 Verify expired data does not increase result count
1.1.4 Check result table structure: ts, cnt, avg_val
2. Test [SESSION Window] with EXPIRED_TIME(1h)
2.1 Create s_session_expired: session(ts,45s) with expired_time(1h)
2.1.1 Insert normal trigger data at '2025-01-01 02:00:00' series
2.1.2 Insert non-expired data at '2025-01-01 01:30:00' (within 1h)
2.1.3 Insert expired data at '2025-01-01 01:00:00' (beyond 1h)
2.1.4 Verify session results: 3 sessions created, expired data ignored
3. Test [STATE_WINDOW] with EXPIRED_TIME(1h)
3.1 Create s_state_expired: state_window(status) with expired_time(1h)
3.1.1 Insert state changes: normal->warning->error at '2025-01-01 02:00:00'
3.1.2 Insert non-expired state data at '2025-01-01 01:30:00'
3.1.3 Insert expired state data at '2025-01-01 01:00:00'
3.1.4 Verify 4 state windows created, expired data ignored
4. Test [EVENT_WINDOW] with EXPIRED_TIME(1h)
4.1 Create s_event_expired: event_window(start with event_val >= 5 end with event_val > 10)
4.1.1 Insert event trigger data with event_val pattern: 6,7,12 at '2025-01-01 02:00:00'
4.1.2 Insert non-expired events at '2025-01-01 01:30:00'
4.1.3 Insert expired events at '2025-01-01 01:00:00'
4.1.4 Verify 3 event windows, expired data ignored in final result
5. Test [PERIOD Window] with EXPIRED_TIME(1h)
5.1 Create s_period_expired: period(30s) with expired_time(1h)|ignore_nodata_trigger
5.1.1 Insert period trigger data every 30s from '2025-01-01 02:00:00'
5.1.2 Test periodic triggering with current timestamp data
5.1.3 Verify period computation ignores expired data
5.1.4 Check ignore_nodata_trigger option interaction
6. Test [COUNT_WINDOW] with EXPIRED_TIME(1h) - Option Ignored
6.1 Create s_count_expired: count_window(3) with expired_time(1h)
6.1.1 Insert count trigger data in batches of 3
6.1.2 Insert both current and expired data
6.1.3 Verify COUNT_WINDOW ignores EXPIRED_TIME option
6.1.4 Confirm all data processed regardless of timestamp
¶
Recalc: 6 different window with ignore_disorder
Test IGNORE_DISORDER option behavior with six different window types to verify out-of-order data handling:
1. INTERVAL Window with IGNORE_DISORDER Test
1.1 Create interval(2m) sliding(2m) stream with ignore_disorder (s_interval_disorder)
1.2 Test out-of-order data processing behavior - should not trigger recalculation
1.3 Verify sliding window results without recalculation for disorder
2. SESSION Window with IGNORE_DISORDER Test
2.1 Create session(ts,45s) stream with ignore_disorder (s_session_disorder)
2.2 Test session boundary maintenance with out-of-order data
2.3 Verify session windows are not recalculated for disorder
3. STATE_WINDOW with IGNORE_DISORDER Test
3.1 Create state_window(status) stream with ignore_disorder (s_state_disorder)
3.2 Test state transition handling with out-of-order data
3.3 Verify state windows are not recalculated for disorder
4. EVENT_WINDOW with IGNORE_DISORDER Test
4.1 Create event_window(start with event_val >= 5 end with event_val > 10) stream with ignore_disorder (s_event_disorder)
4.2 Test event sequence maintenance with out-of-order events
4.3 Verify event windows are not recalculated for disorder
5. PERIOD Window with IGNORE_DISORDER Test
5.1 Create period(30s) stream with ignore_disorder (s_period_disorder)
5.2 Test periodic window handling with out-of-order data
5.3 Verify period windows are not recalculated for disorder
6. COUNT_WINDOW with IGNORE_DISORDER Test
6.1 Create count_window(3) stream with ignore_disorder (s_count_disorder)
6.2 Test count-based window handling with out-of-order data
6.3 Verify count windows are not recalculated for disorder
¶
Recalc: manual basic
Test manual recalculation functionality for four different window types, verifying the recalculate stream command in various window scenarios:
1. INTERVAL Window Stream Manual Recalculation Test
1.1 Create interval(2m) sliding(2m) stream (s_interval_manual)
1.2 Insert test data and execute recalculation from specified time point
1.3 Verify data correctness in result table after recalculation
2. SESSION Window Stream Manual Recalculation Test
2.1 Create session(ts,45s) stream (s_session_manual)
2.2 Insert test data and execute recalculation from specified time point
2.3 Verify session window data correctness after recalculation
3. STATE_WINDOW Stream Manual Recalculation Test
3.1 Create state_window(status) stream (s_state_manual)
3.2 Insert test data and execute recalculation for specified time range
3.3 Verify state window data correctness after recalculation
4. EVENT_WINDOW Stream Manual Recalculation Test
4.1 Create event_window(start with event_val >= 5 end with event_val > 10) stream (s_event_manual)
4.2 Verify initial computation results for event window
4.3 Test event window manual recalculation functionality (currently blocked by TD-36691)
¶
Recalc: manual with options
Test manual recalculation functionality combined with four different stream options:
1. Manual Recalculation with WATERMARK Option Test
1.1 Create interval(2m) sliding(2m) stream with watermark(30s) (s_watermark_interval)
1.2 Test manual recalculation behavior within watermark tolerance
1.3 Verify watermark option interaction with manual recalc commands
2. Manual Recalculation with EXPIRED_TIME Option Test
2.1 Create interval(2m) sliding(2m) stream with expired_time(5m) (s_expired_interval)
2.2 Test manual recalculation for expired data processing
2.3 Verify expired_time option behavior during manual recalc
3. Manual Recalculation with IGNORE_DISORDER Option Test
3.1 Create interval(2m) sliding(2m) stream with ignore_disorder (s_disorder_interval)
3.2 Test manual recalculation for previously ignored out-of-order data
3.3 Verify disorder handling during manual recalc operations
4. Manual Recalculation without DELETE_RECALC Option Test
4.1 Create interval(2m) sliding(2m) stream without DELETE_RECALC (s_delete_interval)
4.2 Test manual recalculation behavior after data deletion
4.3 Verify recalculation consistency without automatic deletion handling
¶
Recalc: watermark basic
Test WATERMARK option behavior with six different window types and out-of-order data handling:
1. INTERVAL Window with WATERMARK Test
1.1 Create interval(2m) sliding(2m) stream with watermark(45s) (s_interval_watermark)
1.2 Test out-of-order data handling within watermark tolerance
1.3 Verify recalculation triggered by data within watermark window
2. SESSION Window with WATERMARK Test
2.1 Create session(ts,45s) stream with watermark(1m) (s_session_watermark)
2.2 Test session modification with out-of-order data within tolerance
2.3 Verify session window recalculation behavior
3. STATE_WINDOW with WATERMARK Test
3.1 Create state_window(status) stream with watermark(45s) (s_state_watermark)
3.2 Test state window recalculation with delayed state changes
3.3 Verify state transition handling within watermark tolerance
4. EVENT_WINDOW with WATERMARK Test
4.1 Create event_window(start with event_val >= 5 end with event_val > 10) stream with watermark(1m) (s_event_watermark)
4.2 Test event sequence processing with out-of-order events
4.3 Verify event window completion with delayed events
5. PERIOD Window with WATERMARK Test
5.1 Create period(30s) stream with watermark(45s) (s_period_watermark)
5.2 Test periodic window recalculation with out-of-order data
5.3 Verify period-based time window behavior
6. COUNT_WINDOW with WATERMARK Test
6.1 Create count_window(3) stream with watermark(1m) (s_count_watermark)
6.2 Test count-based window recalculation with delayed records
6.3 Verify count window completion with out-of-order data