[PECOBLR-1172] Add Configuration and Protocol Selection for SEA Phase 1#302
Open
jayantsing-db wants to merge 4 commits intomainfrom
Open
[PECOBLR-1172] Add Configuration and Protocol Selection for SEA Phase 1#302jayantsing-db wants to merge 4 commits intomainfrom
jayantsing-db wants to merge 4 commits intomainfrom
Conversation
74664bc to
62d4f09
Compare
Author
|
Why is DCO check failing post sign-off? |
Signed-off-by: Jayant Singh <jayant.singh@databricks.com>
This commit implements the foundational configuration support for protocol selection between Thrift and REST protocols as part of Statement Execution API (SEA) Phase 1. Changes: - Added ExecutionProtocol field to UserConfig (defaults to "thrift") - Added WarehouseID field to UserConfig (required for REST protocol) - Added MaxPollInterval and PollBackoffMultiplier fields to Config - Implemented DSN parsing for protocol/executionProtocol parameters - Implemented DSN parsing for warehouse_id/warehouseId parameters - Added validation to require warehouse_id when using REST protocol - Updated DeepCopy methods to include new fields - Updated WithDefaults to set proper default values: - ExecutionProtocol: "thrift" (backward compatible) - MaxPollInterval: 60 seconds - PollBackoffMultiplier: 2.0 - Added comprehensive unit tests for all new functionality The implementation supports both snake_case and camelCase parameter names for user convenience (protocol/executionProtocol, warehouse_id/warehouseId). Related design doc: statement-execution-api-design-go.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jayant Singh <jayant.singh@databricks.com>
Fix gofmt linting issues by aligning struct field declarations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jayant Singh <jayant.singh@databricks.com>
Update connector test expectations to include ExecutionProtocol: 'thrift' as the default value, consistent with the new configuration defaults. This fixes test failures in: - Connector initialized with functional options - Connector initialized minimal settings - Connector initialized with retries turned off 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Jayant Singh <jayant.singh@databricks.com>
62d4f09 to
466291c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:mytoken@example.databricks.com: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