Skip to content

fix(csharp): validate statement options in SEA StatementExecutionStatement#431

Open
eric-wang-1990 wants to merge 3 commits into
mainfrom
fix/peco-3011-sea-statement-option-validation
Open

fix(csharp): validate statement options in SEA StatementExecutionStatement#431
eric-wang-1990 wants to merge 3 commits into
mainfrom
fix/peco-3011-sea-statement-option-validation

Conversation

@eric-wang-1990

Copy link
Copy Markdown
Collaborator

Summary

  • StatementExecutionStatement.SetOption now validates BatchSize, PollTimeMilliseconds, and QueryTimeoutSeconds options
  • Throws ArgumentOutOfRangeException for invalid values, matching the Thrift path behavior
  • Ensures API compatibility between SEA and Thrift protocols

Jira

Fixes PECO-3011

Test plan

  • CanSetOptionBatchSize passes for SEA protocol
  • CanSetOptionPollTime passes for SEA protocol
  • CanSetOptionQueryTimeout passes for SEA protocol

🤖 Generated with Claude Code

…ementExecutionStatement (PECO-3011)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eric-wang-1990 eric-wang-1990 force-pushed the fix/peco-3011-sea-statement-option-validation branch from e98051a to 4bc15fc Compare April 30, 2026 23:04
…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
@eric-wang-1990 eric-wang-1990 added the e2e-test Trigger E2E tests on this PR label Jun 1, 2026
@eric-wang-1990

Copy link
Copy Markdown
Collaborator Author

Hold on this until we support all the parameters

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e-test Trigger E2E tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant