feat: add options support to Store for format-specific storage configuration - #19
Merged
Merged
Conversation
…uration Allow users to pass format-specific options (e.g. ignoreNullFields, header, delimiter) when using Store.forDownload(), corresponding to Spark's OPTIONS clause. Adds a new forDownload(format, options) factory method while keeping the existing API fully backward compatible.
james-willis
marked this pull request as draft
March 2, 2026 20:08
james-willis
marked this pull request as ready for review
March 2, 2026 21:24
sfishel18
approved these changes
Mar 3, 2026
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
Store.forDownload(StorageFormat format, Map<String, String> options)factory method, allowing users to pass format-specific storage options (e.g.ignoreNullFields,header,delimiter) that correspond to Spark'sOPTIONS (...)clauseoptionsmap is serialized as a nested JSON object in thestorefield of theexecute_sqlrequestforDownload()andforDownload(format)methods are fully backward compatible — no changes required for current usersMotivation
Users storing results via
wstmt.setStore(Store.forDownload())had no way to pass configurations like:Now they can:
Changes
Store.java— AddedMap<String, String> optionsfield, newforDownload(format, options)factory method, andgetOptions()getter. Options are defensively copied and stored as an unmodifiable map; empty/null options are normalized tonulland omitted from JSON serialization.StoreTest.java(new) — 8 tests covering serialization, backward compatibility, empty/null handling, immutability, and end-to-endExecuteSqlRequestserialization.README.md— Updated Store Options section with the new factory method and usage examples.