-
Notifications
You must be signed in to change notification settings - Fork 858
Open
Labels
C-featureCategory: featureCategory: feature
Description
Summary
The current SLEEP() function in Databend has a hard limit of 3 seconds, which is insufficient for certain testing and development scenarios. This proposal suggests making the
sleep duration configurable or supporting larger values, including potentially infinite duration (+inf).
Current Behavior
SELECT SLEEP(5);
Error:
APIError: QueryFailed: [1006]The maximum sleep time is 3 seconds. Requested: 5s
Expected Behavior
The SLEEP() function should support:
1. Longer sleep durations (e.g., minutes or hours) for testing scenarios
2. Optionally support +inf for infinite sleep (similar to Snowflake's SYSTEM$WAIT)
Use Cases
1. Integration Testing: Simulating long-running queries or processes
2. Connection Testing: Testing timeout behaviors and connection pooling
3. Rate Limiting: Implementing delays in ETL pipelines
4. Development/Debugging: Pausing execution for manual inspection
Proposed Solutions
Option 1: Increase or Remove Hard Limit
- Remove the 3-second hard limit entirely
Option 2: Make it Configurable
Add a configuration parameter:
[query]
max_sleep_seconds = 3600 # Default: 3600 (1 hour), 0 for unlimited
Reference
Snowflake's SYSTEM$WAIT function supports similar functionality:
- https://docs.snowflake.com/en/sql-reference/functions/system_waitReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-featureCategory: featureCategory: feature