Skip to content

Complete Fetch Phase (EXTERNAL_LINKS disposition and ARROW format) #598

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 298 commits into
base: sea-migration
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
298 commits
Select commit Hold shift + click to select a range
2cd04df
reduce diff (remove explicit tuple conversion)
varun-edachali-dbx Jun 10, 2025
067a019
remove has_more_rows from ExecuteResponse
varun-edachali-dbx Jun 10, 2025
48c83e0
remove un-necessary has_more_rows aclc
varun-edachali-dbx Jun 10, 2025
281a9e9
default has_more_rows to True
varun-edachali-dbx Jun 10, 2025
192901d
return has_more_rows from ExecResponse conversion during GetRespMetadata
varun-edachali-dbx Jun 10, 2025
55f5c45
remove unnecessary replacement
varun-edachali-dbx Jun 10, 2025
edc36b5
better mocked backend naming
varun-edachali-dbx Jun 10, 2025
81280e7
remove has_more_rows test in ExecuteResponse
varun-edachali-dbx Jun 10, 2025
c1d3be2
introduce replacement of original has_more_rows read test
varun-edachali-dbx Jun 10, 2025
5ee4136
call correct method in test_use_arrow_schema
varun-edachali-dbx Jun 10, 2025
b881ab0
call correct method in test_fall_back_to_hive_schema
varun-edachali-dbx Jun 10, 2025
53bf715
re-introduce result response read test
varun-edachali-dbx Jun 10, 2025
45a32be
simplify test
varun-edachali-dbx Jun 10, 2025
e3fe299
remove excess fetch_results mocks
varun-edachali-dbx Jun 10, 2025
e8038d3
more minimal changes to thrift_backend tests
varun-edachali-dbx Jun 10, 2025
2f6ec19
move back to old table types
varun-edachali-dbx Jun 10, 2025
73bc282
remove outdated arrow_schema_bytes return
varun-edachali-dbx Jun 10, 2025
e385d5b
backend from cloudfetch-sea
varun-edachali-dbx Jun 11, 2025
484064e
remove filtering, metadata ops
varun-edachali-dbx Jun 11, 2025
030edf8
raise NotImplementedErrror for metadata ops
varun-edachali-dbx Jun 11, 2025
4e07f1e
align SeaResultSet with new structure
varun-edachali-dbx Jun 11, 2025
65e7c6b
correct sea res set tests
varun-edachali-dbx Jun 11, 2025
30f8266
add metadata commands
varun-edachali-dbx Jun 11, 2025
033ae73
formatting (black)
varun-edachali-dbx Jun 11, 2025
33821f4
add metadata command unit tests
varun-edachali-dbx Jun 11, 2025
71b451a
minimal fetch phase intro
varun-edachali-dbx Jun 11, 2025
170f339
Merge branch 'exec-resp-norm' into fetch-json-inline
varun-edachali-dbx Jun 11, 2025
40f79b5
Merge branch 'sea-res-set' into fetch-json-inline
varun-edachali-dbx Jun 11, 2025
c038d5a
working JSON + INLINE
varun-edachali-dbx Jun 11, 2025
3e22c6c
change to valid table name
varun-edachali-dbx Jun 11, 2025
716304b
rmeove redundant queue init
varun-edachali-dbx Jun 11, 2025
e96e5b8
large query results
varun-edachali-dbx Jun 11, 2025
787f1f7
Merge branch 'sea-migration' into sea-test-scripts
varun-edachali-dbx Jun 11, 2025
165c4f3
remove un-necessary changes
varun-edachali-dbx Jun 11, 2025
a6e40d0
simplify test module
varun-edachali-dbx Jun 11, 2025
52e3088
logging -> debug level
varun-edachali-dbx Jun 11, 2025
641c09b
change table name in log
varun-edachali-dbx Jun 11, 2025
8bd12d8
Merge branch 'sea-migration' into exec-models-sea
varun-edachali-dbx Jun 11, 2025
ffded6e
remove un-necessary changes
varun-edachali-dbx Jun 11, 2025
227f6b3
remove un-necessary backend cahnges
varun-edachali-dbx Jun 11, 2025
68657a3
remove un-needed GetChunksResponse
varun-edachali-dbx Jun 11, 2025
3940eec
remove un-needed GetChunksResponse
varun-edachali-dbx Jun 11, 2025
37813ba
reduce code duplication in response parsing
varun-edachali-dbx Jun 11, 2025
267c9f4
reduce code duplication
varun-edachali-dbx Jun 11, 2025
2967119
more clear docstrings
varun-edachali-dbx Jun 11, 2025
47fd60d
introduce strongly typed ChunkInfo
varun-edachali-dbx Jun 11, 2025
982fdf2
remove is_volume_operation from response
varun-edachali-dbx Jun 12, 2025
9e14d48
add is_volume_op and more ResultData fields
varun-edachali-dbx Jun 12, 2025
be1997e
Merge branch 'exec-models-sea' into exec-phase-sea
varun-edachali-dbx Jun 12, 2025
e8e8ee7
Merge branch 'sea-test-scripts' into exec-phase-sea
varun-edachali-dbx Jun 12, 2025
05ee4e7
add test scripts
varun-edachali-dbx Jun 12, 2025
3ffa898
Merge branch 'exec-models-sea' into metadata-sea
varun-edachali-dbx Jun 12, 2025
2952d8d
Revert "Merge branch 'sea-migration' into exec-models-sea"
varun-edachali-dbx Jun 12, 2025
89e2aa0
Merge branch 'exec-phase-sea' into metadata-sea
varun-edachali-dbx Jun 12, 2025
cbace3f
Revert "Merge branch 'exec-models-sea' into exec-phase-sea"
varun-edachali-dbx Jun 12, 2025
c075b07
change logging level
varun-edachali-dbx Jun 12, 2025
c62f76d
remove un-necessary changes
varun-edachali-dbx Jun 12, 2025
199402e
remove excess changes
varun-edachali-dbx Jun 12, 2025
8ac574b
remove excess changes
varun-edachali-dbx Jun 12, 2025
398ca70
Merge branch 'sea-migration' into exec-phase-sea
varun-edachali-dbx Jun 12, 2025
b1acc5b
remove _get_schema_bytes (for now)
varun-edachali-dbx Jun 12, 2025
ef2a7ee
redundant comments
varun-edachali-dbx Jun 12, 2025
699942d
Merge branch 'sea-migration' into exec-phase-sea
varun-edachali-dbx Jun 12, 2025
af8f74e
remove fetch phase methods
varun-edachali-dbx Jun 12, 2025
5540c5c
reduce code repetititon + introduce gaps after multi line pydocs
varun-edachali-dbx Jun 12, 2025
efe3881
remove unused imports
varun-edachali-dbx Jun 12, 2025
36ab59b
move description extraction to helper func
varun-edachali-dbx Jun 12, 2025
1d57c99
formatting (black)
varun-edachali-dbx Jun 12, 2025
df6dac2
add more unit tests
varun-edachali-dbx Jun 12, 2025
ad0e527
streamline unit tests
varun-edachali-dbx Jun 12, 2025
ed446a0
test getting the list of allowed configurations
varun-edachali-dbx Jun 12, 2025
38e4b5c
reduce diff
varun-edachali-dbx Jun 12, 2025
94879c0
reduce diff
varun-edachali-dbx Jun 12, 2025
1809956
house constants in enums for readability and immutability
varun-edachali-dbx Jun 13, 2025
da5260c
add note on hybrid disposition
varun-edachali-dbx Jun 13, 2025
6ec265f
[squashed from cloudfetch-sea] introduce external links + arrow funct…
varun-edachali-dbx Jun 16, 2025
b2ad5e6
reduce responsibility of Queue
varun-edachali-dbx Jun 16, 2025
66d0df6
reduce repetition in arrow tablee creation
varun-edachali-dbx Jun 16, 2025
eb7ec80
reduce redundant code in CloudFetchQueue
varun-edachali-dbx Jun 16, 2025
a3a8a4a
move chunk link progression to separate func
varun-edachali-dbx Jun 16, 2025
ea79bc8
remove redundant log
varun-edachali-dbx Jun 16, 2025
5b49405
improve logging
varun-edachali-dbx Jun 16, 2025
015fb76
remove reliance on schema_bytes in SEA
varun-edachali-dbx Jun 16, 2025
0385ffb
remove redundant note on arrow_schema_bytes
varun-edachali-dbx Jun 16, 2025
5380c7a
use more fetch methods
varun-edachali-dbx Jun 16, 2025
27b781f
remove redundant schema_bytes from parent constructor
varun-edachali-dbx Jun 16, 2025
238dc0a
only call get_chunk_link with non null chunk index
varun-edachali-dbx Jun 16, 2025
b3bb07e
align SeaResultSet structure with ThriftResultSet
varun-edachali-dbx Jun 16, 2025
13e6346
remvoe _fill_result_buffer from SeaResultSet
varun-edachali-dbx Jun 16, 2025
f90b4d4
reduce code repetition
varun-edachali-dbx Jun 16, 2025
23963fc
align SeaResultSet with ext-links-sea
varun-edachali-dbx Jun 16, 2025
dd43715
remove redundant methods
varun-edachali-dbx Jun 16, 2025
34a7f66
update unit tests
varun-edachali-dbx Jun 16, 2025
715cc13
remove accidental venv changes
varun-edachali-dbx Jun 16, 2025
fb53dd9
pre-fetch next chunk link on processing current
varun-edachali-dbx Jun 17, 2025
d893877
reduce nesting
varun-edachali-dbx Jun 17, 2025
a165f1c
line break after multi line pydoc
varun-edachali-dbx Jun 17, 2025
d68e4ea
re-introduce schema_bytes for better abstraction (likely temporary)
varun-edachali-dbx Jun 17, 2025
be17812
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 17, 2025
a0705bc
add fetchmany_arrow and fetchall_arrow
varun-edachali-dbx Jun 17, 2025
1b90c4a
Merge branch 'metadata-sea' into fetch-json-inline
varun-edachali-dbx Jun 17, 2025
f7c11b9
remove accidental changes in sea backend tests
varun-edachali-dbx Jun 17, 2025
349c021
Merge branch 'exec-phase-sea' into metadata-sea
varun-edachali-dbx Jun 17, 2025
6229848
remove irrelevant changes
varun-edachali-dbx Jun 17, 2025
fd52356
remove un-necessary test changes
varun-edachali-dbx Jun 17, 2025
64e58b0
remove un-necessary changes in thrift backend tests
varun-edachali-dbx Jun 17, 2025
2903473
remove unimplemented methods test
varun-edachali-dbx Jun 17, 2025
b300709
Merge branch 'metadata-sea' into fetch-json-inline
varun-edachali-dbx Jun 17, 2025
021ff4c
remove unimplemented method tests
varun-edachali-dbx Jun 17, 2025
adecd53
modify example scripts to include fetch calls
varun-edachali-dbx Jun 17, 2025
d33e5fd
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 17, 2025
e3cef5c
add GetChunksResponse
varun-edachali-dbx Jun 17, 2025
ac50669
remove changes to sea test
varun-edachali-dbx Jun 17, 2025
03cdc4f
re-introduce accidentally removed description extraction method
varun-edachali-dbx Jun 17, 2025
e1842d8
fix type errors (ssl_options, CHUNK_PATH_WITH_ID..., etc.)
varun-edachali-dbx Jun 17, 2025
89a46af
access ssl_options through connection
varun-edachali-dbx Jun 17, 2025
1d0b28b
DEBUG level
varun-edachali-dbx Jun 17, 2025
c8820d4
remove explicit multi chunk test
varun-edachali-dbx Jun 17, 2025
fe47787
move cloud fetch queues back into utils.py
varun-edachali-dbx Jun 17, 2025
74f59b7
remove excess docstrings
varun-edachali-dbx Jun 17, 2025
4b456b2
move ThriftCloudFetchQueue above SeaCloudFetchQueue
varun-edachali-dbx Jun 17, 2025
bfc1f01
fix sea connector tests
varun-edachali-dbx Jun 17, 2025
a4447a1
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 17, 2025
4883aff
correct patch module path in cloud fetch queue tests
varun-edachali-dbx Jun 17, 2025
0a2cdfd
remove unimplemented methods test
varun-edachali-dbx Jun 17, 2025
cd3378c
correct add_link docstring
varun-edachali-dbx Jun 17, 2025
90bb09c
Merge branch 'sea-migration' into exec-phase-sea
varun-edachali-dbx Jun 17, 2025
cd22389
remove invalid import
varun-edachali-dbx Jun 17, 2025
82e0f8b
Merge branch 'sea-migration' into exec-phase-sea
varun-edachali-dbx Jun 17, 2025
e64b81b
Merge branch 'exec-phase-sea' into metadata-sea
varun-edachali-dbx Jun 17, 2025
27564ca
Merge branch 'metadata-sea' into fetch-json-inline
varun-edachali-dbx Jun 17, 2025
bc467d1
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 17, 2025
5ab9bbe
better align queries with JDBC impl
varun-edachali-dbx Jun 18, 2025
1ab6e87
line breaks after multi-line PRs
varun-edachali-dbx Jun 18, 2025
f469c24
remove unused imports
varun-edachali-dbx Jun 18, 2025
68ec65f
fix: introduce ExecuteResponse import
varun-edachali-dbx Jun 18, 2025
ffd478e
Merge branch 'sea-migration' into metadata-sea
varun-edachali-dbx Jun 18, 2025
f6d873d
remove unimplemented metadata methods test, un-necessary imports
varun-edachali-dbx Jun 18, 2025
28675f5
introduce unit tests for metadata methods
varun-edachali-dbx Jun 18, 2025
3578659
remove verbosity in ResultSetFilter docstring
varun-edachali-dbx Jun 20, 2025
8713023
remove un-necessary info in ResultSetFilter docstring
varun-edachali-dbx Jun 20, 2025
22dc252
remove explicit type checking, string literals around forward annotat…
varun-edachali-dbx Jun 20, 2025
390f592
house SQL commands in constants
varun-edachali-dbx Jun 20, 2025
dd7dc6a
convert complex types to string if not _use_arrow_native_complex_types
varun-edachali-dbx Jun 23, 2025
28308fe
Merge branch 'metadata-sea' into fetch-json-inline
varun-edachali-dbx Jun 23, 2025
2712d1c
introduce unit tests for altered functionality
varun-edachali-dbx Jun 23, 2025
dabba55
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 23, 2025
48ad7b3
Revert "Merge branch 'fetch-json-inline' into ext-links-sea"
varun-edachali-dbx Jun 23, 2025
a1f9b9c
reduce verbosity of ResultSetFilter docstring
varun-edachali-dbx Jun 23, 2025
984e8ee
remove unused imports
varun-edachali-dbx Jun 23, 2025
3a999c0
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 23, 2025
c313c2b
Revert "Merge branch 'fetch-json-inline' into ext-links-sea"
varun-edachali-dbx Jun 23, 2025
3bc615e
Revert "reduce verbosity of ResultSetFilter docstring"
varun-edachali-dbx Jun 23, 2025
b6e1a10
Reapply "Merge branch 'fetch-json-inline' into ext-links-sea"
varun-edachali-dbx Jun 23, 2025
2df3d39
Revert "Merge branch 'fetch-json-inline' into ext-links-sea"
varun-edachali-dbx Jun 23, 2025
5e75fb5
remove un-necessary filters changes
varun-edachali-dbx Jun 23, 2025
20822e4
remove un-necessary backend changes
varun-edachali-dbx Jun 23, 2025
802d045
remove constants changes
varun-edachali-dbx Jun 23, 2025
f3f795a
remove changes in filters tests
varun-edachali-dbx Jun 23, 2025
f6c5950
remove unit test backend and JSON queue changes
varun-edachali-dbx Jun 23, 2025
d210ccd
remove changes in sea result set testing
varun-edachali-dbx Jun 23, 2025
22a953e
Revert "remove changes in sea result set testing"
varun-edachali-dbx Jun 23, 2025
3aed144
Revert "remove unit test backend and JSON queue changes"
varun-edachali-dbx Jun 23, 2025
0fe4da4
Revert "remove changes in filters tests"
varun-edachali-dbx Jun 23, 2025
0e3c0a1
Revert "remove constants changes"
varun-edachali-dbx Jun 23, 2025
93edb93
Revert "remove un-necessary backend changes"
varun-edachali-dbx Jun 23, 2025
871a44f
Revert "remove un-necessary filters changes"
varun-edachali-dbx Jun 23, 2025
0ce144d
remove unused imports
varun-edachali-dbx Jun 23, 2025
08ca60d
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 23, 2025
8c5cc77
working version
varun-edachali-dbx Jun 23, 2025
7f5c715
adopy _wait_until_command_done
varun-edachali-dbx Jun 23, 2025
9ef5fad
introduce metadata commands
varun-edachali-dbx Jun 23, 2025
44183db
use new backend structure
varun-edachali-dbx Jun 23, 2025
d59b351
constrain backend diff
varun-edachali-dbx Jun 23, 2025
1edc80a
remove changes to filters
varun-edachali-dbx Jun 23, 2025
f82658a
make _parse methods in models internal
varun-edachali-dbx Jun 23, 2025
54eb0a4
reduce changes in unit tests
varun-edachali-dbx Jun 23, 2025
50cc1e2
run small queries with SEA during integration tests
varun-edachali-dbx Jun 24, 2025
242307a
run some tests for sea
varun-edachali-dbx Jun 24, 2025
8a138e8
allow empty schema bytes for alignment with SEA
varun-edachali-dbx Jun 25, 2025
82f9d6b
pass is_vl_op to Sea backend ExecuteResponse
varun-edachali-dbx Jun 25, 2025
35f1ef0
remove catalog requirement in get_tables
varun-edachali-dbx Jun 26, 2025
a515d26
move filters.py to SEA utils
varun-edachali-dbx Jun 26, 2025
59b1330
ensure SeaResultSet
varun-edachali-dbx Jun 26, 2025
293e356
Merge branch 'sea-migration' into metadata-sea
varun-edachali-dbx Jun 26, 2025
dd40beb
prevent circular imports
varun-edachali-dbx Jun 26, 2025
14057ac
remove unused imports
varun-edachali-dbx Jun 26, 2025
a4d5bdb
remove cast, throw error if not SeaResultSet
varun-edachali-dbx Jun 26, 2025
156421a
Merge branch 'metadata-sea' into fetch-json-inline
varun-edachali-dbx Jun 26, 2025
eb1a9b4
pass param as TSparkParameterValue
varun-edachali-dbx Jun 26, 2025
9000666
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 26, 2025
a3ca7c7
remove failing test (temp)
varun-edachali-dbx Jun 26, 2025
2c22010
remove SeaResultSet type assertion
varun-edachali-dbx Jun 26, 2025
c09508e
change errors to align with spec, instead of arbitrary ValueError
varun-edachali-dbx Jun 26, 2025
e9b1314
make SEA backend methods return SeaResultSet
varun-edachali-dbx Jun 26, 2025
8ede414
use spec-aligned Exceptions in SEA backend
varun-edachali-dbx Jun 26, 2025
09a1b11
remove defensive row type check
varun-edachali-dbx Jun 26, 2025
5e01e7b
Merge branch 'metadata-sea' into fetch-json-inline
varun-edachali-dbx Jun 26, 2025
3becefe
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 26, 2025
a026d31
raise ProgrammingError for invalid id
varun-edachali-dbx Jun 26, 2025
4446a9e
make is_volume_operation strict bool
varun-edachali-dbx Jun 26, 2025
138359d
remove complex types code
varun-edachali-dbx Jun 26, 2025
b99d0c4
Revert "remove complex types code"
varun-edachali-dbx Jun 26, 2025
21c389d
introduce type conversion for primitive types for JSON + INLINE
varun-edachali-dbx Jun 27, 2025
734321a
Merge branch 'sea-migration' into fetch-json-inline
varun-edachali-dbx Jun 27, 2025
9f0f969
remove SEA running on metadata queries (known failures
varun-edachali-dbx Jun 27, 2025
04a1936
remove un-necessary docstrings
varun-edachali-dbx Jun 27, 2025
278b8cd
align expected types with databricks sdk
varun-edachali-dbx Jun 27, 2025
91b7f7f
link rest api reference to validate types
varun-edachali-dbx Jun 27, 2025
7a5ae13
remove test_catalogs_returns_arrow_table test
varun-edachali-dbx Jun 27, 2025
f1776f3
fix fetchall_arrow and fetchmany_arrow
varun-edachali-dbx Jun 27, 2025
6143331
remove thrift aligned test_cancel_during_execute from SEA tests
varun-edachali-dbx Jun 27, 2025
8949d0c
Merge branch 'sea-migration' into fetch-json-inline
varun-edachali-dbx Jun 27, 2025
5eaded4
remove un-necessary changes in example scripts
varun-edachali-dbx Jun 27, 2025
eeed9a1
remove un-necessary chagnes in example scripts
varun-edachali-dbx Jun 27, 2025
f233886
_convert_json_table -> _create_json_table
varun-edachali-dbx Jun 27, 2025
68ac437
remove accidentally removed test
varun-edachali-dbx Jun 27, 2025
7fd0845
remove new unit tests (to be re-added based on new arch)
varun-edachali-dbx Jun 27, 2025
ea7ff73
remove changes in sea_result_set functionality (to be re-added)
varun-edachali-dbx Jun 27, 2025
563da71
introduce more integration tests
varun-edachali-dbx Jun 27, 2025
a018273
remove SEA tests in parameterized queries
varun-edachali-dbx Jun 27, 2025
c0e98f4
remove partial parameter fix changes
varun-edachali-dbx Jun 27, 2025
7343035
remove un-necessary timestamp tests
varun-edachali-dbx Jun 27, 2025
ec500b6
slightly stronger typing of _convert_json_types
varun-edachali-dbx Jun 27, 2025
0b3e91d
stronger typing of json utility func s
varun-edachali-dbx Jun 27, 2025
7664e44
stronger typing of fetch*_json
varun-edachali-dbx Jun 27, 2025
db7b8e5
remove unused helper methods in SqlType
varun-edachali-dbx Jun 27, 2025
f75f2b5
line breaks after multi line pydocs, remove excess logs
varun-edachali-dbx Jun 27, 2025
e2d4ef5
line breaks after multi line pydocs, reduce diff of redundant changes
varun-edachali-dbx Jun 27, 2025
21e3078
reduce diff of redundant changes
varun-edachali-dbx Jun 27, 2025
bb015e6
mandate ResultData in SeaResultSet constructor
varun-edachali-dbx Jun 27, 2025
3944e39
Merge branch 'fetch-json-inline' into ext-links-sea
varun-edachali-dbx Jun 27, 2025
b3273c7
remove complex type conversion
varun-edachali-dbx Jun 27, 2025
38c2b88
correct fetch*_arrow
varun-edachali-dbx Jun 27, 2025
b77acbe
Merge branch 'sea-migration' into ext-links-sea
varun-edachali-dbx Jul 3, 2025
fa2359d
recover old sea tests
varun-edachali-dbx Jul 3, 2025
c07f709
move queue and result set into SEA specific dir
varun-edachali-dbx Jul 3, 2025
9e4ef2e
pass ssl_options into CloudFetchQueue
varun-edachali-dbx Jul 3, 2025
b00c06c
reduce diff
varun-edachali-dbx Jul 3, 2025
10f55f0
remove redundant conversion.py
varun-edachali-dbx Jul 3, 2025
cd119e9
fix type issues
varun-edachali-dbx Jul 3, 2025
d79638b
ValueError not ProgrammingError
varun-edachali-dbx Jul 3, 2025
f84578a
reduce diff
varun-edachali-dbx Jul 3, 2025
c621c0c
introduce SEA cloudfetch e2e tests
varun-edachali-dbx Jul 3, 2025
7958cd9
allow empty cloudfetch result
varun-edachali-dbx Jul 3, 2025
e2d17ff
add unit tests for CloudFetchQueue and SeaResultSet
varun-edachali-dbx Jul 3, 2025
d348b35
skip pyarrow dependent tests
varun-edachali-dbx Jul 3, 2025
811205e
Merge branch 'sea-migration' into ext-links-sea
varun-edachali-dbx Jul 3, 2025
4bd290e
simplify download process: no pre-fetching
varun-edachali-dbx Jul 4, 2025
dfbbf79
correct class name in logs
varun-edachali-dbx Jul 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/databricks/sql/backend/databricks_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from abc import ABC, abstractmethod
from typing import Dict, Tuple, List, Optional, Any, Union, TYPE_CHECKING

from databricks.sql.types import SSLOptions

if TYPE_CHECKING:
from databricks.sql.client import Cursor

Expand All @@ -25,6 +27,13 @@


class DatabricksClient(ABC):
def __init__(self, ssl_options: SSLOptions, **kwargs):
self._use_arrow_native_complex_types = kwargs.get(
"_use_arrow_native_complex_types", True
)
self._max_download_threads = kwargs.get("max_download_threads", 10)
self._ssl_options = ssl_options

# == Connection and Session Management ==
@abstractmethod
def open_session(
Expand Down
53 changes: 42 additions & 11 deletions src/databricks/sql/backend/sea/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
from typing import Any, Dict, Tuple, List, Optional, Union, TYPE_CHECKING, Set

from databricks.sql.backend.sea.models.base import ResultManifest
from databricks.sql.backend.sea.models.base import ExternalLink, ResultManifest
from databricks.sql.backend.sea.utils.constants import (
ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP,
ResultFormat,
Expand All @@ -27,7 +27,7 @@
BackendType,
ExecuteResponse,
)
from databricks.sql.exc import DatabaseError, ProgrammingError, ServerOperationError
from databricks.sql.exc import DatabaseError, ServerOperationError
from databricks.sql.backend.sea.utils.http_client import SeaHttpClient
from databricks.sql.types import SSLOptions

Expand All @@ -43,6 +43,7 @@
GetStatementResponse,
CreateSessionResponse,
)
from databricks.sql.backend.sea.models.responses import GetChunksResponse

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -87,6 +88,7 @@ class SeaDatabricksClient(DatabricksClient):
STATEMENT_PATH = BASE_PATH + "statements"
STATEMENT_PATH_WITH_ID = STATEMENT_PATH + "/{}"
CANCEL_STATEMENT_PATH_WITH_ID = STATEMENT_PATH + "/{}/cancel"
CHUNK_PATH_WITH_ID_AND_INDEX = STATEMENT_PATH + "/{}/result/chunks/{}"

# SEA constants
POLL_INTERVAL_SECONDS = 0.2
Expand Down Expand Up @@ -121,7 +123,7 @@ def __init__(
http_path,
)

self._max_download_threads = kwargs.get("max_download_threads", 10)
super().__init__(ssl_options=ssl_options, **kwargs)

# Extract warehouse ID from http_path
self.warehouse_id = self._extract_warehouse_id(http_path)
Expand All @@ -133,7 +135,7 @@ def __init__(
http_path=http_path,
http_headers=http_headers,
auth_provider=auth_provider,
ssl_options=ssl_options,
ssl_options=self._ssl_options,
**kwargs,
)

Expand Down Expand Up @@ -172,7 +174,7 @@ def _extract_warehouse_id(self, http_path: str) -> str:
f"Note: SEA only works for warehouses."
)
logger.error(error_message)
raise ProgrammingError(error_message)
raise ValueError(error_message)

@property
def max_download_threads(self) -> int:
Expand Down Expand Up @@ -244,7 +246,7 @@ def close_session(self, session_id: SessionId) -> None:
session_id: The session identifier returned by open_session()

Raises:
ProgrammingError: If the session ID is invalid
ValueError: If the session ID is invalid
OperationalError: If there's an error closing the session
"""

Expand Down Expand Up @@ -341,7 +343,7 @@ def _results_message_to_execute_response(

# Check for compression
lz4_compressed = (
response.manifest.result_compression == ResultCompression.LZ4_FRAME
response.manifest.result_compression == ResultCompression.LZ4_FRAME.value
)

execute_response = ExecuteResponse(
Expand Down Expand Up @@ -422,7 +424,7 @@ def execute_command(
enforce_embedded_schema_correctness: Whether to enforce schema correctness

Returns:
ResultSet: A SeaResultSet instance for the executed command
SeaResultSet: A SeaResultSet instance for the executed command
"""

if session_id.backend_type != BackendType.SEA:
Expand Down Expand Up @@ -501,7 +503,7 @@ def cancel_command(self, command_id: CommandId) -> None:
command_id: Command identifier to cancel

Raises:
ProgrammingError: If the command ID is invalid
ValueError: If the command ID is invalid
"""

if command_id.backend_type != BackendType.SEA:
Expand All @@ -526,7 +528,7 @@ def close_command(self, command_id: CommandId) -> None:
command_id: Command identifier to close

Raises:
ProgrammingError: If the command ID is invalid
ValueError: If the command ID is invalid
"""

if command_id.backend_type != BackendType.SEA:
Expand Down Expand Up @@ -554,7 +556,7 @@ def get_query_state(self, command_id: CommandId) -> CommandState:
CommandState: The current state of the command

Raises:
ProgrammingError: If the command ID is invalid
ValueError: If the command ID is invalid
"""

if command_id.backend_type != BackendType.SEA:
Expand Down Expand Up @@ -627,6 +629,35 @@ def get_execution_result(
arraysize=cursor.arraysize,
)

def get_chunk_link(self, statement_id: str, chunk_index: int) -> ExternalLink:
"""
Get links for chunks starting from the specified index.
Args:
statement_id: The statement ID
chunk_index: The starting chunk index
Returns:
ExternalLink: External link for the chunk
"""

response_data = self.http_client._make_request(
method="GET",
path=self.CHUNK_PATH_WITH_ID_AND_INDEX.format(statement_id, chunk_index),
)
response = GetChunksResponse.from_dict(response_data)

links = response.external_links
link = next((l for l in links if l.chunk_index == chunk_index), None)
if not link:
raise ServerOperationError(
f"No link found for chunk index {chunk_index}",
{
"operation-id": statement_id,
"diagnostic-info": None,
},
)

return link

# == Metadata Operations ==

def get_catalogs(
Expand Down
2 changes: 2 additions & 0 deletions src/databricks/sql/backend/sea/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
ExecuteStatementResponse,
GetStatementResponse,
CreateSessionResponse,
GetChunksResponse,
)

__all__ = [
Expand All @@ -49,4 +50,5 @@
"ExecuteStatementResponse",
"GetStatementResponse",
"CreateSessionResponse",
"GetChunksResponse",
]
37 changes: 36 additions & 1 deletion src/databricks/sql/backend/sea/models/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
These models define the structures used in SEA API responses.
"""

from typing import Dict, Any
from typing import Dict, Any, List
from dataclasses import dataclass

from databricks.sql.backend.types import CommandState
Expand Down Expand Up @@ -154,3 +154,38 @@ class CreateSessionResponse:
def from_dict(cls, data: Dict[str, Any]) -> "CreateSessionResponse":
"""Create a CreateSessionResponse from a dictionary."""
return cls(session_id=data.get("session_id", ""))


@dataclass
class GetChunksResponse:
"""Response from getting chunks for a statement."""

statement_id: str
external_links: List[ExternalLink]

@classmethod
def from_dict(cls, data: Dict[str, Any]) -> "GetChunksResponse":
"""Create a GetChunksResponse from a dictionary."""
external_links = []
if "external_links" in data:
for link_data in data["external_links"]:
external_links.append(
ExternalLink(
external_link=link_data.get("external_link", ""),
expiration=link_data.get("expiration", ""),
chunk_index=link_data.get("chunk_index", 0),
byte_count=link_data.get("byte_count", 0),
row_count=link_data.get("row_count", 0),
row_offset=link_data.get("row_offset", 0),
next_chunk_index=link_data.get("next_chunk_index"),
next_chunk_internal_link=link_data.get(
"next_chunk_internal_link"
),
http_headers=link_data.get("http_headers"),
)
)

return cls(
statement_id=data.get("statement_id", ""),
external_links=external_links,
)
Loading
Loading