fix(csharp): validate statement options in SEA StatementExecutionStatement#431
Open
eric-wang-1990 wants to merge 3 commits into
Open
fix(csharp): validate statement options in SEA StatementExecutionStatement#431eric-wang-1990 wants to merge 3 commits into
eric-wang-1990 wants to merge 3 commits into
Conversation
…ementExecutionStatement (PECO-3011) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e98051a to
4bc15fc
Compare
…tement-option-validation
…e PECO-3011 PR #431 added SetOption validation but the inherited CanSetOption{PollTime,BatchSize, QueryTimeout} tests also assert that bad config throws ArgumentOutOfRangeException at NewConnection(...).CreateStatement(). SEA only validated in SetOption and its connection-level parsers threw plain ArgumentException for non-numeric input (and never validated BatchSize), so those tests stayed skipped on SEA. - Add StatementOptionValidator (poll time >= 0, batch size > 0 long, query timeout >= 0), each throwing ArgumentOutOfRangeException with the exact Thrift message text. - StatementExecutionStatement.SetOption delegates to it. - StatementExecutionStatement constructor validates QueryTimeoutSeconds and BatchSize from config. - StatementExecutionConnection.ValidateProperties validates PollTimeMilliseconds via the same helper (AOORE, allows 0 like Thrift). - Remove the three ValidateCanSetOption* SEA skip overrides + PECO-3011 TODOs so the inherited theories now run on both protocols. Adds StatementOptionValidatorTests (25 cases mirroring the base theory InlineData). The shared validators duplicate the Thrift HiveServer2Statement/ApacheUtility logic for now; consolidating them into the hiveserver2 submodule's ApacheUtility is a tracked follow-up. Co-authored-by: Isaac
Collaborator
Author
|
Hold on this until we support all the parameters |
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
StatementExecutionStatement.SetOptionnow validatesBatchSize,PollTimeMilliseconds, andQueryTimeoutSecondsoptionsArgumentOutOfRangeExceptionfor invalid values, matching the Thrift path behaviorJira
Fixes PECO-3011
Test plan
CanSetOptionBatchSizepasses for SEA protocolCanSetOptionPollTimepasses for SEA protocolCanSetOptionQueryTimeoutpasses for SEA protocol🤖 Generated with Claude Code