- Notifications
You must be signed in to change notification settings - Fork126
Introduce models forSeaDatabricksClient#595
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
50 commits Select commitHold shift + click to select a range
138c2ae [squash from exec-sea] bring over execution phase changes
varun-edachali-dbx3e3ab94 remove excess test
varun-edachali-dbx4a78165 add docstring
varun-edachali-dbx0dac4aa remvoe exec func in sea backend
varun-edachali-dbx1b794c7 remove excess files
varun-edachali-dbxda5a6fe remove excess models
varun-edachali-dbx686ade4 remove excess sea backend tests
varun-edachali-dbx31e6c83 cleanup
varun-edachali-dbx69ea238 re-introduce get_schema_desc
varun-edachali-dbx66d7517 remove SeaResultSet
varun-edachali-dbx71feef9 clean imports and attributes
varun-edachali-dbxae9862f pass CommandId to ExecResp
varun-edachali-dbxd8aa69e remove changes in types
varun-edachali-dbxdb139bc add back essential types (ExecResponse, from_sea_state)
varun-edachali-dbxb977b12 fix fetch types
varun-edachali-dbxda615c0 excess imports
varun-edachali-dbx0da04a6 reduce diff by maintaining logs
varun-edachali-dbxea9d456 fix int test types
varun-edachali-dbx8985c62 [squashed from exec-sea] init execution func
varun-edachali-dbxd9bcdbe remove irrelevant changes
varun-edachali-dbxee9fa1c remove ResultSetFilter functionality
varun-edachali-dbx24c6152 remove more irrelevant changes
varun-edachali-dbx67fd101 remove more irrelevant changes
varun-edachali-dbx271fcaf even more irrelevant changes
varun-edachali-dbxbf26ea3 remove sea response as init option
varun-edachali-dbxed7cf91 exec test example scripts
varun-edachali-dbxdae15e3 formatting (black)
varun-edachali-dbxdb5bbea [squashed from sea-exec] merge sea stuffs
varun-edachali-dbxd5d3699 remove excess changes
varun-edachali-dbx6137a3d remove excess removed docstring
varun-edachali-dbx75b0773 remove excess changes in backend
varun-edachali-dbx4494dcd remove excess imports
varun-edachali-dbx4d0aeca remove accidentally removed _get_schema_desc
varun-edachali-dbx7cece5e remove unnecessary init with sea_response tests
varun-edachali-dbx8977c06 rmeove unnecessary changes
varun-edachali-dbx0216d7a formatting (black)
varun-edachali-dbx4cb15fd improved models and filters from cloudfetch-sea branch
varun-edachali-dbxdee47f7 filters stuff (align with JDBC)
varun-edachali-dbxe385d5b backend from cloudfetch-sea
varun-edachali-dbx484064e remove filtering, metadata ops
varun-edachali-dbx030edf8 raise NotImplementedErrror for metadata ops
varun-edachali-dbx8bd12d8 Merge branch 'sea-migration' into exec-models-sea
varun-edachali-dbxffded6e remove un-necessary changes
varun-edachali-dbx227f6b3 remove un-necessary backend cahnges
varun-edachali-dbx3940eec remove un-needed GetChunksResponse
varun-edachali-dbx267c9f4 reduce code duplication
varun-edachali-dbx2967119 more clear docstrings
varun-edachali-dbx47fd60d introduce strongly typed ChunkInfo
varun-edachali-dbx982fdf2 remove is_volume_operation from response
varun-edachali-dbx9e14d48 add is_volume_op and more ResultData fields
varun-edachali-dbxFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
30 changes: 30 additions & 0 deletionssrc/databricks/sql/backend/sea/models/__init__.py
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
95 changes: 95 additions & 0 deletionssrc/databricks/sql/backend/sea/models/base.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| """ | ||
| Base models for the SEA (Statement Execution API) backend. | ||
| These models define the common structures used in SEA API requests and responses. | ||
| """ | ||
| from typing import Dict, List, Any, Optional, Union | ||
| from dataclasses import dataclass, field | ||
| from databricks.sql.backend.types import CommandState | ||
| @dataclass | ||
| class ServiceError: | ||
| """Error information returned by the SEA API.""" | ||
| message: str | ||
| error_code: Optional[str] = None | ||
| @dataclass | ||
| class StatementStatus: | ||
| """Status information for a statement execution.""" | ||
| state: CommandState | ||
| error: Optional[ServiceError] = None | ||
| sql_state: Optional[str] = None | ||
| @dataclass | ||
| class ExternalLink: | ||
| """External link information for result data.""" | ||
| external_link: str | ||
| expiration: str | ||
| chunk_index: int | ||
| byte_count: int = 0 | ||
| row_count: int = 0 | ||
| row_offset: int = 0 | ||
| next_chunk_index: Optional[int] = None | ||
| next_chunk_internal_link: Optional[str] = None | ||
| http_headers: Optional[Dict[str, str]] = None | ||
| @dataclass | ||
| class ChunkInfo: | ||
| """Information about a chunk in the result set.""" | ||
| chunk_index: int | ||
| byte_count: int | ||
| row_offset: int | ||
| row_count: int | ||
| @dataclass | ||
| class ResultData: | ||
| """Result data from a statement execution.""" | ||
| data: Optional[List[List[Any]]] = None | ||
| external_links: Optional[List[ExternalLink]] = None | ||
| byte_count: Optional[int] = None | ||
| chunk_index: Optional[int] = None | ||
| next_chunk_index: Optional[int] = None | ||
| next_chunk_internal_link: Optional[str] = None | ||
| row_count: Optional[int] = None | ||
| row_offset: Optional[int] = None | ||
| attachment: Optional[bytes] = None | ||
| @dataclass | ||
| class ColumnInfo: | ||
| """Information about a column in the result set.""" | ||
| name: str | ||
| type_name: str | ||
| type_text: str | ||
| nullable: bool = True | ||
| precision: Optional[int] = None | ||
| scale: Optional[int] = None | ||
| ordinal_position: Optional[int] = None | ||
| @dataclass | ||
| class ResultManifest: | ||
| """Manifest information for a result set.""" | ||
| format: str | ||
| schema: Dict[str, Any] # Will contain column information | ||
| total_row_count: int | ||
| total_byte_count: int | ||
| total_chunk_count: int | ||
| truncated: bool = False | ||
| chunks: Optional[List[ChunkInfo]] = None | ||
| result_compression: Optional[str] = None | ||
varun-edachali-dbx marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| is_volume_operation: Optional[bool] = None | ||
98 changes: 96 additions & 2 deletionssrc/databricks/sql/backend/sea/models/requests.py
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
142 changes: 142 additions & 0 deletionssrc/databricks/sql/backend/sea/models/responses.py
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
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.