|
1 | 1 | importlogging |
2 | | -importuuid |
3 | 2 | importtime |
4 | 3 | importre |
5 | | -fromtypingimportDict,Tuple,List,Optional,Any,Union,TYPE_CHECKING,Set |
| 4 | +fromtypingimportDict,Tuple,List,Optional,Union,TYPE_CHECKING,Set |
6 | 5 |
|
7 | 6 | fromdatabricks.sql.backend.sea.utils.constantsimport ( |
8 | 7 | ALLOWED_SESSION_CONF_TO_DEFAULT_VALUES_MAP, |
|
23 | 22 | ) |
24 | 23 | fromdatabricks.sql.excimportError,NotSupportedError,ServerOperationError |
25 | 24 | fromdatabricks.sql.backend.sea.utils.http_clientimportSeaHttpClient |
26 | | -fromdatabricks.sql.thrift_api.TCLIServiceimportttypes |
27 | 25 | fromdatabricks.sql.typesimportSSLOptions |
28 | | -fromdatabricks.sql.utilsimportSeaResultSetQueueFactory |
29 | 26 | fromdatabricks.sql.backend.sea.models.baseimport ( |
30 | 27 | ResultData, |
31 | 28 | ExternalLink, |
@@ -716,3 +713,55 @@ def get_execution_result( |
716 | 713 | result_data=result_data, |
717 | 714 | manifest=manifest, |
718 | 715 | ) |
| 716 | + |
| 717 | +# == Metadata Operations == |
| 718 | + |
| 719 | +defget_catalogs( |
| 720 | +self, |
| 721 | +session_id:SessionId, |
| 722 | +max_rows:int, |
| 723 | +max_bytes:int, |
| 724 | +cursor:"Cursor", |
| 725 | + )->"ResultSet": |
| 726 | +"""Get available catalogs by executing 'SHOW CATALOGS'.""" |
| 727 | +raiseNotImplementedError("get_catalogs is not implemented for SEA backend") |
| 728 | + |
| 729 | +defget_schemas( |
| 730 | +self, |
| 731 | +session_id:SessionId, |
| 732 | +max_rows:int, |
| 733 | +max_bytes:int, |
| 734 | +cursor:"Cursor", |
| 735 | +catalog_name:Optional[str]=None, |
| 736 | +schema_name:Optional[str]=None, |
| 737 | + )->"ResultSet": |
| 738 | +"""Get schemas by executing 'SHOW SCHEMAS IN catalog [LIKE pattern]'.""" |
| 739 | +raiseNotImplementedError("get_schemas is not implemented for SEA backend") |
| 740 | + |
| 741 | +defget_tables( |
| 742 | +self, |
| 743 | +session_id:SessionId, |
| 744 | +max_rows:int, |
| 745 | +max_bytes:int, |
| 746 | +cursor:"Cursor", |
| 747 | +catalog_name:Optional[str]=None, |
| 748 | +schema_name:Optional[str]=None, |
| 749 | +table_name:Optional[str]=None, |
| 750 | +table_types:Optional[List[str]]=None, |
| 751 | + )->"ResultSet": |
| 752 | +"""Get tables by executing 'SHOW TABLES IN catalog [SCHEMA LIKE pattern] [LIKE pattern]'.""" |
| 753 | +raiseNotImplementedError("get_tables is not implemented for SEA backend") |
| 754 | + |
| 755 | +defget_columns( |
| 756 | +self, |
| 757 | +session_id:SessionId, |
| 758 | +max_rows:int, |
| 759 | +max_bytes:int, |
| 760 | +cursor:"Cursor", |
| 761 | +catalog_name:Optional[str]=None, |
| 762 | +schema_name:Optional[str]=None, |
| 763 | +table_name:Optional[str]=None, |
| 764 | +column_name:Optional[str]=None, |
| 765 | + )->"ResultSet": |
| 766 | +"""Get columns by executing 'SHOW COLUMNS IN CATALOG catalog [SCHEMA LIKE pattern] [TABLE LIKE pattern] [LIKE pattern]'.""" |
| 767 | +raiseNotImplementedError("get_columns is not implemented for SEA backend") |