[PECOBLR-1172] Add Configuration and Protocol Selection for SEA Phase 1 #302
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Task 1 of SEA (Statement Execution API) Phase 1: Add Configuration and Protocol Selection support for the Databricks SQL Go driver.
This is a foundational change that enables protocol selection between Thrift (existing) and REST (new Statement Execution API) protocols.
Changes
Configuration Fields Added
UserConfig:
ExecutionProtocol(string): Selects between "thrift" (default) or "rest"WarehouseID(string): Required when using REST protocolConfig:
MaxPollInterval(time.Duration): Maximum polling interval for exponential backoff (default: 60s)PollBackoffMultiplier(float64): Multiplier for exponential backoff (default: 2.0)DSN Parsing
Implemented parsing for the following query parameters:
protocolorexecutionProtocol: Sets the execution protocolwarehouse_idorwarehouseId: Sets the warehouse ID (supports both naming conventions)Example DSN:
token:[email protected]:443/sql/1.0/endpoints/abc123?protocol=rest&warehouse_id=warehouse123
Validation
Added validation to ensure
warehouse_idis provided when usingprotocol=rest. Returns a clear error message if missing.Default Values
ExecutionProtocol: "thrift" (maintains backward compatibility)MaxPollInterval: 60 secondsPollBackoffMultiplier: 2.0PollInterval: 1 second (unchanged)Testing
All tests pass successfully.
Design Reference
Implementation follows the design document:
statement-execution-api-design-go.mdBackward Compatibility
✅ All changes are backward compatible:
Next Steps
This PR enables the foundation for subsequent SEA Phase 1 tasks:
Test Plan
Related