pyodps-catalog 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyodps_catalog-0.1.1/PKG-INFO +35 -0
- pyodps_catalog-0.1.1/pyodps_catalog/__init__.py +1 -0
- pyodps_catalog-0.1.1/pyodps_catalog/client.py +115 -0
- pyodps_catalog-0.1.1/pyodps_catalog/models.py +624 -0
- pyodps_catalog-0.1.1/pyodps_catalog.egg-info/PKG-INFO +35 -0
- pyodps_catalog-0.1.1/pyodps_catalog.egg-info/SOURCES.txt +9 -0
- pyodps_catalog-0.1.1/pyodps_catalog.egg-info/dependency_links.txt +1 -0
- pyodps_catalog-0.1.1/pyodps_catalog.egg-info/requires.txt +2 -0
- pyodps_catalog-0.1.1/pyodps_catalog.egg-info/top_level.txt +1 -0
- pyodps_catalog-0.1.1/setup.cfg +4 -0
- pyodps_catalog-0.1.1/setup.py +77 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pyodps_catalog
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Alibaba Cloud MaxCompute openapi SDK Library for Python
|
|
5
|
+
Home-page: https://github.com/aliyun/darabonba-openapi
|
|
6
|
+
Author: Alibaba Cloud SDK
|
|
7
|
+
Author-email: sdk-team@alibabacloud.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Keywords: pyodps,catalog
|
|
10
|
+
Platform: any
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Requires-Python: >=3.6
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: maxcompute_tea_openapi<2.0.0,>=1.0.0
|
|
24
|
+
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.13
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: platform
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.1"
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from Tea.core import TeaCore
|
|
4
|
+
|
|
5
|
+
from maxcompute_tea_openapi.client import Client as OpenApiClient
|
|
6
|
+
from maxcompute_tea_openapi import models as open_api_models
|
|
7
|
+
from pyodps_catalog import models as catalog_api_models
|
|
8
|
+
from alibabacloud_tea_util import models as util_models
|
|
9
|
+
from alibabacloud_tea_util.client import Client as UtilClient
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Client(OpenApiClient):
|
|
13
|
+
def __init__(
|
|
14
|
+
self,
|
|
15
|
+
config: open_api_models.Config,
|
|
16
|
+
):
|
|
17
|
+
super().__init__(config)
|
|
18
|
+
|
|
19
|
+
def update_table(
|
|
20
|
+
self,
|
|
21
|
+
table: catalog_api_models.Table,
|
|
22
|
+
) -> catalog_api_models.Table:
|
|
23
|
+
runtime = util_models.RuntimeOptions()
|
|
24
|
+
return TeaCore.from_map(
|
|
25
|
+
catalog_api_models.Table(),
|
|
26
|
+
self.request_with_model(table, 'PUT', self.get_table_path(table), runtime)
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
async def update_table_async(
|
|
30
|
+
self,
|
|
31
|
+
table: catalog_api_models.Table,
|
|
32
|
+
) -> catalog_api_models.Table:
|
|
33
|
+
runtime = util_models.RuntimeOptions()
|
|
34
|
+
return TeaCore.from_map(
|
|
35
|
+
catalog_api_models.Table(),
|
|
36
|
+
await self.request_with_model_async(table, 'PUT', self.get_table_path(table), runtime)
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
def delete_table(
|
|
40
|
+
self,
|
|
41
|
+
table: catalog_api_models.Table,
|
|
42
|
+
) -> catalog_api_models.HttpResponse:
|
|
43
|
+
runtime = util_models.RuntimeOptions()
|
|
44
|
+
return TeaCore.from_map(
|
|
45
|
+
catalog_api_models.HttpResponse(),
|
|
46
|
+
self.request_without_model(table, 'DELETE', self.get_table_path(table), runtime)
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
async def delete_table_async(
|
|
50
|
+
self,
|
|
51
|
+
table: catalog_api_models.Table,
|
|
52
|
+
) -> catalog_api_models.HttpResponse:
|
|
53
|
+
runtime = util_models.RuntimeOptions()
|
|
54
|
+
return TeaCore.from_map(
|
|
55
|
+
catalog_api_models.HttpResponse(),
|
|
56
|
+
await self.request_without_model_async(table, 'DELETE', self.get_table_path(table), runtime)
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
def create_table(
|
|
60
|
+
self,
|
|
61
|
+
table: catalog_api_models.Table,
|
|
62
|
+
) -> catalog_api_models.Table:
|
|
63
|
+
runtime = util_models.RuntimeOptions()
|
|
64
|
+
return TeaCore.from_map(
|
|
65
|
+
catalog_api_models.Table(),
|
|
66
|
+
self.request_with_model(table, 'POST', self.get_tables_path(table), runtime)
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
async def create_table_async(
|
|
70
|
+
self,
|
|
71
|
+
table: catalog_api_models.Table,
|
|
72
|
+
) -> catalog_api_models.Table:
|
|
73
|
+
runtime = util_models.RuntimeOptions()
|
|
74
|
+
return TeaCore.from_map(
|
|
75
|
+
catalog_api_models.Table(),
|
|
76
|
+
await self.request_with_model_async(table, 'POST', self.get_tables_path(table), runtime)
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
def get_table(
|
|
80
|
+
self,
|
|
81
|
+
table: catalog_api_models.Table,
|
|
82
|
+
) -> catalog_api_models.Table:
|
|
83
|
+
runtime = util_models.RuntimeOptions()
|
|
84
|
+
return TeaCore.from_map(
|
|
85
|
+
catalog_api_models.Table(),
|
|
86
|
+
self.request_with_model(table, 'GET', self.get_table_path(table), runtime)
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
async def get_table_async(
|
|
90
|
+
self,
|
|
91
|
+
table: catalog_api_models.Table,
|
|
92
|
+
) -> catalog_api_models.Table:
|
|
93
|
+
runtime = util_models.RuntimeOptions()
|
|
94
|
+
return TeaCore.from_map(
|
|
95
|
+
catalog_api_models.Table(),
|
|
96
|
+
await self.request_with_model_async(table, 'GET', self.get_table_path(table), runtime)
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
def get_table_path(
|
|
100
|
+
self,
|
|
101
|
+
table: catalog_api_models.Table,
|
|
102
|
+
) -> str:
|
|
103
|
+
if UtilClient.is_unset(table.schema_name):
|
|
104
|
+
return f'/api/catalog/v1alpha/projects/{table.project_id}/schemas/default/tables/{table.table_name}'
|
|
105
|
+
else:
|
|
106
|
+
return f'/api/catalog/v1alpha/projects/{table.project_id}/schemas/{table.schema_name}/tables/{table.table_name}'
|
|
107
|
+
|
|
108
|
+
def get_tables_path(
|
|
109
|
+
self,
|
|
110
|
+
table: catalog_api_models.Table,
|
|
111
|
+
) -> str:
|
|
112
|
+
if UtilClient.is_unset(table.schema_name):
|
|
113
|
+
return f'/api/catalog/v1alpha/projects/{table.project_id}/schemas/default/tables'
|
|
114
|
+
else:
|
|
115
|
+
return f'/api/catalog/v1alpha/projects/{table.project_id}/schemas/{table.schema_name}/tables'
|
|
@@ -0,0 +1,624 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# This file is auto-generated, don't edit it. Thanks.
|
|
3
|
+
from Tea.model import TeaModel
|
|
4
|
+
from typing import List, Dict
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class PolicyTag(TeaModel):
|
|
8
|
+
def __init__(
|
|
9
|
+
self,
|
|
10
|
+
names: List[str] = None,
|
|
11
|
+
):
|
|
12
|
+
self.names = names
|
|
13
|
+
|
|
14
|
+
def validate(self):
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
def to_map(self):
|
|
18
|
+
_map = super().to_map()
|
|
19
|
+
if _map is not None:
|
|
20
|
+
return _map
|
|
21
|
+
|
|
22
|
+
result = dict()
|
|
23
|
+
if self.names is not None:
|
|
24
|
+
result['names'] = self.names
|
|
25
|
+
return result
|
|
26
|
+
|
|
27
|
+
def from_map(self, m: dict = None):
|
|
28
|
+
m = m or dict()
|
|
29
|
+
if m.get('names') is not None:
|
|
30
|
+
self.names = m.get('names')
|
|
31
|
+
return self
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class TableFieldSchema(TeaModel):
|
|
35
|
+
def __init__(
|
|
36
|
+
self,
|
|
37
|
+
field_name: str = None,
|
|
38
|
+
sql_type_definition: str = None,
|
|
39
|
+
type_category: str = None,
|
|
40
|
+
mode: str = None,
|
|
41
|
+
fields: List['TableFieldSchema'] = None,
|
|
42
|
+
description: str = None,
|
|
43
|
+
policy_tags: PolicyTag = None,
|
|
44
|
+
max_length: str = None,
|
|
45
|
+
precision: str = None,
|
|
46
|
+
scale: str = None,
|
|
47
|
+
default_value_expression: str = None,
|
|
48
|
+
):
|
|
49
|
+
# 列名(如果是顶层列),或者 struct 字段名。
|
|
50
|
+
self.field_name = field_name
|
|
51
|
+
# 在 SQL DDL 语句中填写的表示列类型的字符串定义。
|
|
52
|
+
self.sql_type_definition = sql_type_definition
|
|
53
|
+
# 字段类型。
|
|
54
|
+
self.type_category = type_category
|
|
55
|
+
# REQUIRED 或 NULLABLE。
|
|
56
|
+
self.mode = mode
|
|
57
|
+
# 如果是 STRUCT 类型,表示 STRUCT 的子字段。
|
|
58
|
+
self.fields = fields
|
|
59
|
+
# 列的评论。
|
|
60
|
+
self.description = description
|
|
61
|
+
# 可选。列绑定的 policy tag。
|
|
62
|
+
self.policy_tags = policy_tags
|
|
63
|
+
# 如果是 CHAR/VARCHAR 类型,表示字段的最大长度。
|
|
64
|
+
self.max_length = max_length
|
|
65
|
+
# 如果 DECIMAL 类型,表示精度。
|
|
66
|
+
self.precision = precision
|
|
67
|
+
# 如果 DECIMAL 类型,表示 scale。
|
|
68
|
+
self.scale = scale
|
|
69
|
+
# 可选。默认值的表达式字符串。
|
|
70
|
+
self.default_value_expression = default_value_expression
|
|
71
|
+
|
|
72
|
+
def validate(self):
|
|
73
|
+
if self.fields:
|
|
74
|
+
for k in self.fields:
|
|
75
|
+
if k:
|
|
76
|
+
k.validate()
|
|
77
|
+
if self.policy_tags:
|
|
78
|
+
self.policy_tags.validate()
|
|
79
|
+
|
|
80
|
+
def to_map(self):
|
|
81
|
+
_map = super().to_map()
|
|
82
|
+
if _map is not None:
|
|
83
|
+
return _map
|
|
84
|
+
|
|
85
|
+
result = dict()
|
|
86
|
+
if self.field_name is not None:
|
|
87
|
+
result['fieldName'] = self.field_name
|
|
88
|
+
if self.sql_type_definition is not None:
|
|
89
|
+
result['sqlTypeDefinition'] = self.sql_type_definition
|
|
90
|
+
if self.type_category is not None:
|
|
91
|
+
result['typeCategory'] = self.type_category
|
|
92
|
+
if self.mode is not None:
|
|
93
|
+
result['mode'] = self.mode
|
|
94
|
+
result['fields'] = []
|
|
95
|
+
if self.fields is not None:
|
|
96
|
+
for k in self.fields:
|
|
97
|
+
result['fields'].append(k.to_map() if k else None)
|
|
98
|
+
if self.description is not None:
|
|
99
|
+
result['description'] = self.description
|
|
100
|
+
if self.policy_tags is not None:
|
|
101
|
+
result['policyTags'] = self.policy_tags.to_map()
|
|
102
|
+
if self.max_length is not None:
|
|
103
|
+
result['maxLength'] = self.max_length
|
|
104
|
+
if self.precision is not None:
|
|
105
|
+
result['precision'] = self.precision
|
|
106
|
+
if self.scale is not None:
|
|
107
|
+
result['scale'] = self.scale
|
|
108
|
+
if self.default_value_expression is not None:
|
|
109
|
+
result['defaultValueExpression'] = self.default_value_expression
|
|
110
|
+
return result
|
|
111
|
+
|
|
112
|
+
def from_map(self, m: dict = None):
|
|
113
|
+
m = m or dict()
|
|
114
|
+
if m.get('fieldName') is not None:
|
|
115
|
+
self.field_name = m.get('fieldName')
|
|
116
|
+
if m.get('sqlTypeDefinition') is not None:
|
|
117
|
+
self.sql_type_definition = m.get('sqlTypeDefinition')
|
|
118
|
+
if m.get('typeCategory') is not None:
|
|
119
|
+
self.type_category = m.get('typeCategory')
|
|
120
|
+
if m.get('mode') is not None:
|
|
121
|
+
self.mode = m.get('mode')
|
|
122
|
+
self.fields = []
|
|
123
|
+
if m.get('fields') is not None:
|
|
124
|
+
for k in m.get('fields'):
|
|
125
|
+
temp_model = TableFieldSchema()
|
|
126
|
+
self.fields.append(temp_model.from_map(k))
|
|
127
|
+
if m.get('description') is not None:
|
|
128
|
+
self.description = m.get('description')
|
|
129
|
+
if m.get('policyTags') is not None:
|
|
130
|
+
temp_model = PolicyTag()
|
|
131
|
+
self.policy_tags = temp_model.from_map(m['policyTags'])
|
|
132
|
+
if m.get('maxLength') is not None:
|
|
133
|
+
self.max_length = m.get('maxLength')
|
|
134
|
+
if m.get('precision') is not None:
|
|
135
|
+
self.precision = m.get('precision')
|
|
136
|
+
if m.get('scale') is not None:
|
|
137
|
+
self.scale = m.get('scale')
|
|
138
|
+
if m.get('defaultValueExpression') is not None:
|
|
139
|
+
self.default_value_expression = m.get('defaultValueExpression')
|
|
140
|
+
return self
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
class Field(TeaModel):
|
|
144
|
+
def __init__(
|
|
145
|
+
self,
|
|
146
|
+
field_name: str = None,
|
|
147
|
+
):
|
|
148
|
+
# 列名(如果是顶层列),或者 struct 字段名。
|
|
149
|
+
self.field_name = field_name
|
|
150
|
+
|
|
151
|
+
def validate(self):
|
|
152
|
+
pass
|
|
153
|
+
|
|
154
|
+
def to_map(self):
|
|
155
|
+
_map = super().to_map()
|
|
156
|
+
if _map is not None:
|
|
157
|
+
return _map
|
|
158
|
+
|
|
159
|
+
result = dict()
|
|
160
|
+
if self.field_name is not None:
|
|
161
|
+
result['fieldName'] = self.field_name
|
|
162
|
+
return result
|
|
163
|
+
|
|
164
|
+
def from_map(self, m: dict = None):
|
|
165
|
+
m = m or dict()
|
|
166
|
+
if m.get('fieldName') is not None:
|
|
167
|
+
self.field_name = m.get('fieldName')
|
|
168
|
+
return self
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class SortingField(TeaModel):
|
|
172
|
+
def __init__(
|
|
173
|
+
self,
|
|
174
|
+
field_name: str = None,
|
|
175
|
+
order: str = None,
|
|
176
|
+
):
|
|
177
|
+
# 列名(如果是顶层列),或者 struct 字段名。
|
|
178
|
+
self.field_name = field_name
|
|
179
|
+
# 排序顺序
|
|
180
|
+
self.order = order
|
|
181
|
+
|
|
182
|
+
def validate(self):
|
|
183
|
+
pass
|
|
184
|
+
|
|
185
|
+
def to_map(self):
|
|
186
|
+
_map = super().to_map()
|
|
187
|
+
if _map is not None:
|
|
188
|
+
return _map
|
|
189
|
+
|
|
190
|
+
result = dict()
|
|
191
|
+
if self.field_name is not None:
|
|
192
|
+
result['fieldName'] = self.field_name
|
|
193
|
+
if self.order is not None:
|
|
194
|
+
result['order'] = self.order
|
|
195
|
+
return result
|
|
196
|
+
|
|
197
|
+
def from_map(self, m: dict = None):
|
|
198
|
+
m = m or dict()
|
|
199
|
+
if m.get('fieldName') is not None:
|
|
200
|
+
self.field_name = m.get('fieldName')
|
|
201
|
+
if m.get('order') is not None:
|
|
202
|
+
self.order = m.get('order')
|
|
203
|
+
return self
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class Clustering(TeaModel):
|
|
207
|
+
def __init__(
|
|
208
|
+
self,
|
|
209
|
+
type: str = None,
|
|
210
|
+
fields: List[str] = None,
|
|
211
|
+
num_buckets: str = None,
|
|
212
|
+
):
|
|
213
|
+
# 表的聚簇类型,目前支持 hash/range。
|
|
214
|
+
self.type = type
|
|
215
|
+
# 聚簇列定义。
|
|
216
|
+
self.fields = fields
|
|
217
|
+
# 聚簇桶的个数。只有 hash clustering 才有此属性。创建 hash clustering 表时,如不指定桶个数,默认为 16。
|
|
218
|
+
self.num_buckets = num_buckets
|
|
219
|
+
|
|
220
|
+
def validate(self):
|
|
221
|
+
pass
|
|
222
|
+
|
|
223
|
+
def to_map(self):
|
|
224
|
+
_map = super().to_map()
|
|
225
|
+
if _map is not None:
|
|
226
|
+
return _map
|
|
227
|
+
|
|
228
|
+
result = dict()
|
|
229
|
+
if self.type is not None:
|
|
230
|
+
result['type'] = self.type
|
|
231
|
+
if self.fields is not None:
|
|
232
|
+
result['fields'] = self.fields
|
|
233
|
+
if self.num_buckets is not None:
|
|
234
|
+
result['numBuckets'] = self.num_buckets
|
|
235
|
+
return result
|
|
236
|
+
|
|
237
|
+
def from_map(self, m: dict = None):
|
|
238
|
+
m = m or dict()
|
|
239
|
+
if m.get('type') is not None:
|
|
240
|
+
self.type = m.get('type')
|
|
241
|
+
if m.get('fields') is not None:
|
|
242
|
+
self.fields = m.get('fields')
|
|
243
|
+
if m.get('numBuckets') is not None:
|
|
244
|
+
self.num_buckets = m.get('numBuckets')
|
|
245
|
+
return self
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
class Fields(TeaModel):
|
|
249
|
+
def __init__(
|
|
250
|
+
self,
|
|
251
|
+
fields: List[str] = None,
|
|
252
|
+
):
|
|
253
|
+
# 主键列名列表。
|
|
254
|
+
self.fields = fields
|
|
255
|
+
|
|
256
|
+
def validate(self):
|
|
257
|
+
pass
|
|
258
|
+
|
|
259
|
+
def to_map(self):
|
|
260
|
+
_map = super().to_map()
|
|
261
|
+
if _map is not None:
|
|
262
|
+
return _map
|
|
263
|
+
|
|
264
|
+
result = dict()
|
|
265
|
+
if self.fields is not None:
|
|
266
|
+
result['fields'] = self.fields
|
|
267
|
+
return result
|
|
268
|
+
|
|
269
|
+
def from_map(self, m: dict = None):
|
|
270
|
+
m = m or dict()
|
|
271
|
+
if m.get('fields') is not None:
|
|
272
|
+
self.fields = m.get('fields')
|
|
273
|
+
return self
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
class TableConstraints(TeaModel):
|
|
277
|
+
def __init__(
|
|
278
|
+
self,
|
|
279
|
+
primary_key: Fields = None,
|
|
280
|
+
):
|
|
281
|
+
# 表的主键。系统不为主键自动去重。
|
|
282
|
+
self.primary_key = primary_key
|
|
283
|
+
|
|
284
|
+
def validate(self):
|
|
285
|
+
if self.primary_key:
|
|
286
|
+
self.primary_key.validate()
|
|
287
|
+
|
|
288
|
+
def to_map(self):
|
|
289
|
+
_map = super().to_map()
|
|
290
|
+
if _map is not None:
|
|
291
|
+
return _map
|
|
292
|
+
|
|
293
|
+
result = dict()
|
|
294
|
+
if self.primary_key is not None:
|
|
295
|
+
result['primaryKey'] = self.primary_key.to_map()
|
|
296
|
+
return result
|
|
297
|
+
|
|
298
|
+
def from_map(self, m: dict = None):
|
|
299
|
+
m = m or dict()
|
|
300
|
+
if m.get('primaryKey') is not None:
|
|
301
|
+
temp_model = Fields()
|
|
302
|
+
self.primary_key = temp_model.from_map(m['primaryKey'])
|
|
303
|
+
return self
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
class PartitionedColumn(TeaModel):
|
|
307
|
+
def __init__(
|
|
308
|
+
self,
|
|
309
|
+
field: str = None,
|
|
310
|
+
):
|
|
311
|
+
self.field = field
|
|
312
|
+
|
|
313
|
+
def validate(self):
|
|
314
|
+
pass
|
|
315
|
+
|
|
316
|
+
def to_map(self):
|
|
317
|
+
_map = super().to_map()
|
|
318
|
+
if _map is not None:
|
|
319
|
+
return _map
|
|
320
|
+
|
|
321
|
+
result = dict()
|
|
322
|
+
if self.field is not None:
|
|
323
|
+
result['field'] = self.field
|
|
324
|
+
return result
|
|
325
|
+
|
|
326
|
+
def from_map(self, m: dict = None):
|
|
327
|
+
m = m or dict()
|
|
328
|
+
if m.get('field') is not None:
|
|
329
|
+
self.field = m.get('field')
|
|
330
|
+
return self
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
class PartitionDefinition(TeaModel):
|
|
334
|
+
def __init__(
|
|
335
|
+
self,
|
|
336
|
+
partitioned_column: List[PartitionedColumn] = None,
|
|
337
|
+
):
|
|
338
|
+
self.partitioned_column = partitioned_column
|
|
339
|
+
|
|
340
|
+
def validate(self):
|
|
341
|
+
if self.partitioned_column:
|
|
342
|
+
for k in self.partitioned_column:
|
|
343
|
+
if k:
|
|
344
|
+
k.validate()
|
|
345
|
+
|
|
346
|
+
def to_map(self):
|
|
347
|
+
_map = super().to_map()
|
|
348
|
+
if _map is not None:
|
|
349
|
+
return _map
|
|
350
|
+
|
|
351
|
+
result = dict()
|
|
352
|
+
result['partitionedColumn'] = []
|
|
353
|
+
if self.partitioned_column is not None:
|
|
354
|
+
for k in self.partitioned_column:
|
|
355
|
+
result['partitionedColumn'].append(k.to_map() if k else None)
|
|
356
|
+
return result
|
|
357
|
+
|
|
358
|
+
def from_map(self, m: dict = None):
|
|
359
|
+
m = m or dict()
|
|
360
|
+
self.partitioned_column = []
|
|
361
|
+
if m.get('partitionedColumn') is not None:
|
|
362
|
+
for k in m.get('partitionedColumn'):
|
|
363
|
+
temp_model = PartitionedColumn()
|
|
364
|
+
self.partitioned_column.append(temp_model.from_map(k))
|
|
365
|
+
return self
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
class TableFormatDefinition(TeaModel):
|
|
369
|
+
def __init__(
|
|
370
|
+
self,
|
|
371
|
+
transactional: bool = None,
|
|
372
|
+
version: str = None,
|
|
373
|
+
):
|
|
374
|
+
self.transactional = transactional
|
|
375
|
+
self.version = version
|
|
376
|
+
|
|
377
|
+
def validate(self):
|
|
378
|
+
pass
|
|
379
|
+
|
|
380
|
+
def to_map(self):
|
|
381
|
+
_map = super().to_map()
|
|
382
|
+
if _map is not None:
|
|
383
|
+
return _map
|
|
384
|
+
|
|
385
|
+
result = dict()
|
|
386
|
+
if self.transactional is not None:
|
|
387
|
+
result['transactional'] = self.transactional
|
|
388
|
+
if self.version is not None:
|
|
389
|
+
result['version'] = self.version
|
|
390
|
+
return result
|
|
391
|
+
|
|
392
|
+
def from_map(self, m: dict = None):
|
|
393
|
+
m = m or dict()
|
|
394
|
+
if m.get('transactional') is not None:
|
|
395
|
+
self.transactional = m.get('transactional')
|
|
396
|
+
if m.get('version') is not None:
|
|
397
|
+
self.version = m.get('version')
|
|
398
|
+
return self
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
class ExpirationOptions(TeaModel):
|
|
402
|
+
def __init__(
|
|
403
|
+
self,
|
|
404
|
+
expiration_days: int = None,
|
|
405
|
+
partition_expiration_days: int = None,
|
|
406
|
+
):
|
|
407
|
+
self.expiration_days = expiration_days
|
|
408
|
+
self.partition_expiration_days = partition_expiration_days
|
|
409
|
+
|
|
410
|
+
def validate(self):
|
|
411
|
+
pass
|
|
412
|
+
|
|
413
|
+
def to_map(self):
|
|
414
|
+
_map = super().to_map()
|
|
415
|
+
if _map is not None:
|
|
416
|
+
return _map
|
|
417
|
+
|
|
418
|
+
result = dict()
|
|
419
|
+
if self.expiration_days is not None:
|
|
420
|
+
result['expirationDays'] = self.expiration_days
|
|
421
|
+
if self.partition_expiration_days is not None:
|
|
422
|
+
result['partitionExpirationDays'] = self.partition_expiration_days
|
|
423
|
+
return result
|
|
424
|
+
|
|
425
|
+
def from_map(self, m: dict = None):
|
|
426
|
+
m = m or dict()
|
|
427
|
+
if m.get('expirationDays') is not None:
|
|
428
|
+
self.expiration_days = m.get('expirationDays')
|
|
429
|
+
if m.get('partitionExpirationDays') is not None:
|
|
430
|
+
self.partition_expiration_days = m.get('partitionExpirationDays')
|
|
431
|
+
return self
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
class Table(TeaModel):
|
|
435
|
+
def __init__(
|
|
436
|
+
self,
|
|
437
|
+
etag: str = None,
|
|
438
|
+
name: str = None,
|
|
439
|
+
project_id: str = None,
|
|
440
|
+
schema_name: str = None,
|
|
441
|
+
table_name: str = None,
|
|
442
|
+
type: str = None,
|
|
443
|
+
description: str = None,
|
|
444
|
+
table_schema: TableFieldSchema = None,
|
|
445
|
+
clustering: Clustering = None,
|
|
446
|
+
table_constraints: TableConstraints = None,
|
|
447
|
+
partition_definition: PartitionDefinition = None,
|
|
448
|
+
table_format_definition: TableFormatDefinition = None,
|
|
449
|
+
create_time: str = None,
|
|
450
|
+
last_modified_time: str = None,
|
|
451
|
+
expiration_options: ExpirationOptions = None,
|
|
452
|
+
labels: Dict[str, str] = None,
|
|
453
|
+
):
|
|
454
|
+
# 用于 read-modify-write 一致性校验。
|
|
455
|
+
self.etag = etag
|
|
456
|
+
# 表的完整路径。e.g., projects/{projectId}/schemas/{schemaName}/tables/{tableName}
|
|
457
|
+
self.name = name
|
|
458
|
+
# 表所属的 project ID。
|
|
459
|
+
self.project_id = project_id
|
|
460
|
+
# 表所属的 schema 名。
|
|
461
|
+
self.schema_name = schema_name
|
|
462
|
+
# 表名。
|
|
463
|
+
self.table_name = table_name
|
|
464
|
+
# 表的类型。
|
|
465
|
+
self.type = type
|
|
466
|
+
# 表的描述。等价于 SQL DDL 中表的 comment。
|
|
467
|
+
self.description = description
|
|
468
|
+
# 表列的 schema 定义。
|
|
469
|
+
self.table_schema = table_schema
|
|
470
|
+
# 表的 cluster 属性定义,只有 cluster 表才有。
|
|
471
|
+
self.clustering = clustering
|
|
472
|
+
# 表的主键约束定义,只有 delta 表才有。
|
|
473
|
+
self.table_constraints = table_constraints
|
|
474
|
+
# 表的分区列定义,只有分区表才有。
|
|
475
|
+
self.partition_definition = partition_definition
|
|
476
|
+
# 可选。仅内表有此字段。默认为普通表格式。
|
|
477
|
+
self.table_format_definition = table_format_definition
|
|
478
|
+
# 表的创建时间(毫秒)。仅输出。
|
|
479
|
+
self.create_time = create_time
|
|
480
|
+
# 表的修改时间(毫秒)。仅输出。
|
|
481
|
+
self.last_modified_time = last_modified_time
|
|
482
|
+
# 可选。表的过期时间配置。
|
|
483
|
+
self.expiration_options = expiration_options
|
|
484
|
+
# 可选。表上的标签。
|
|
485
|
+
self.labels = labels
|
|
486
|
+
|
|
487
|
+
def validate(self):
|
|
488
|
+
self.validate_required(self.project_id, 'project_id')
|
|
489
|
+
self.validate_required(self.table_name, 'table_name')
|
|
490
|
+
if self.table_schema:
|
|
491
|
+
self.table_schema.validate()
|
|
492
|
+
if self.clustering:
|
|
493
|
+
self.clustering.validate()
|
|
494
|
+
if self.table_constraints:
|
|
495
|
+
self.table_constraints.validate()
|
|
496
|
+
if self.partition_definition:
|
|
497
|
+
self.partition_definition.validate()
|
|
498
|
+
if self.table_format_definition:
|
|
499
|
+
self.table_format_definition.validate()
|
|
500
|
+
if self.expiration_options:
|
|
501
|
+
self.expiration_options.validate()
|
|
502
|
+
|
|
503
|
+
def to_map(self):
|
|
504
|
+
_map = super().to_map()
|
|
505
|
+
if _map is not None:
|
|
506
|
+
return _map
|
|
507
|
+
|
|
508
|
+
result = dict()
|
|
509
|
+
if self.etag is not None:
|
|
510
|
+
result['etag'] = self.etag
|
|
511
|
+
if self.name is not None:
|
|
512
|
+
result['name'] = self.name
|
|
513
|
+
if self.project_id is not None:
|
|
514
|
+
result['projectId'] = self.project_id
|
|
515
|
+
if self.schema_name is not None:
|
|
516
|
+
result['schemaName'] = self.schema_name
|
|
517
|
+
if self.table_name is not None:
|
|
518
|
+
result['tableName'] = self.table_name
|
|
519
|
+
if self.type is not None:
|
|
520
|
+
result['type'] = self.type
|
|
521
|
+
if self.description is not None:
|
|
522
|
+
result['description'] = self.description
|
|
523
|
+
if self.table_schema is not None:
|
|
524
|
+
result['tableSchema'] = self.table_schema.to_map()
|
|
525
|
+
if self.clustering is not None:
|
|
526
|
+
result['clustering'] = self.clustering.to_map()
|
|
527
|
+
if self.table_constraints is not None:
|
|
528
|
+
result['tableConstraints'] = self.table_constraints.to_map()
|
|
529
|
+
if self.partition_definition is not None:
|
|
530
|
+
result['partitionDefinition'] = self.partition_definition.to_map()
|
|
531
|
+
if self.table_format_definition is not None:
|
|
532
|
+
result['tableFormatDefinition'] = self.table_format_definition.to_map()
|
|
533
|
+
if self.create_time is not None:
|
|
534
|
+
result['createTime'] = self.create_time
|
|
535
|
+
if self.last_modified_time is not None:
|
|
536
|
+
result['lastModifiedTime'] = self.last_modified_time
|
|
537
|
+
if self.expiration_options is not None:
|
|
538
|
+
result['expirationOptions'] = self.expiration_options.to_map()
|
|
539
|
+
if self.labels is not None:
|
|
540
|
+
result['labels'] = self.labels
|
|
541
|
+
return result
|
|
542
|
+
|
|
543
|
+
def from_map(self, m: dict = None):
|
|
544
|
+
m = m or dict()
|
|
545
|
+
if m.get('etag') is not None:
|
|
546
|
+
self.etag = m.get('etag')
|
|
547
|
+
if m.get('name') is not None:
|
|
548
|
+
self.name = m.get('name')
|
|
549
|
+
if m.get('projectId') is not None:
|
|
550
|
+
self.project_id = m.get('projectId')
|
|
551
|
+
if m.get('schemaName') is not None:
|
|
552
|
+
self.schema_name = m.get('schemaName')
|
|
553
|
+
if m.get('tableName') is not None:
|
|
554
|
+
self.table_name = m.get('tableName')
|
|
555
|
+
if m.get('type') is not None:
|
|
556
|
+
self.type = m.get('type')
|
|
557
|
+
if m.get('description') is not None:
|
|
558
|
+
self.description = m.get('description')
|
|
559
|
+
if m.get('tableSchema') is not None:
|
|
560
|
+
temp_model = TableFieldSchema()
|
|
561
|
+
self.table_schema = temp_model.from_map(m['tableSchema'])
|
|
562
|
+
if m.get('clustering') is not None:
|
|
563
|
+
temp_model = Clustering()
|
|
564
|
+
self.clustering = temp_model.from_map(m['clustering'])
|
|
565
|
+
if m.get('tableConstraints') is not None:
|
|
566
|
+
temp_model = TableConstraints()
|
|
567
|
+
self.table_constraints = temp_model.from_map(m['tableConstraints'])
|
|
568
|
+
if m.get('partitionDefinition') is not None:
|
|
569
|
+
temp_model = PartitionDefinition()
|
|
570
|
+
self.partition_definition = temp_model.from_map(m['partitionDefinition'])
|
|
571
|
+
if m.get('tableFormatDefinition') is not None:
|
|
572
|
+
temp_model = TableFormatDefinition()
|
|
573
|
+
self.table_format_definition = temp_model.from_map(m['tableFormatDefinition'])
|
|
574
|
+
if m.get('createTime') is not None:
|
|
575
|
+
self.create_time = m.get('createTime')
|
|
576
|
+
if m.get('lastModifiedTime') is not None:
|
|
577
|
+
self.last_modified_time = m.get('lastModifiedTime')
|
|
578
|
+
if m.get('expirationOptions') is not None:
|
|
579
|
+
temp_model = ExpirationOptions()
|
|
580
|
+
self.expiration_options = temp_model.from_map(m['expirationOptions'])
|
|
581
|
+
if m.get('labels') is not None:
|
|
582
|
+
self.labels = m.get('labels')
|
|
583
|
+
return self
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
class HttpResponse(TeaModel):
|
|
587
|
+
def __init__(
|
|
588
|
+
self,
|
|
589
|
+
headers: Dict[str, str] = None,
|
|
590
|
+
status_code: int = None,
|
|
591
|
+
body: str = None,
|
|
592
|
+
):
|
|
593
|
+
self.headers = headers
|
|
594
|
+
self.status_code = status_code
|
|
595
|
+
self.body = body
|
|
596
|
+
|
|
597
|
+
def validate(self):
|
|
598
|
+
pass
|
|
599
|
+
|
|
600
|
+
def to_map(self):
|
|
601
|
+
_map = super().to_map()
|
|
602
|
+
if _map is not None:
|
|
603
|
+
return _map
|
|
604
|
+
|
|
605
|
+
result = dict()
|
|
606
|
+
if self.headers is not None:
|
|
607
|
+
result['headers'] = self.headers
|
|
608
|
+
if self.status_code is not None:
|
|
609
|
+
result['statusCode'] = self.status_code
|
|
610
|
+
if self.body is not None:
|
|
611
|
+
result['body'] = self.body
|
|
612
|
+
return result
|
|
613
|
+
|
|
614
|
+
def from_map(self, m: dict = None):
|
|
615
|
+
m = m or dict()
|
|
616
|
+
if m.get('headers') is not None:
|
|
617
|
+
self.headers = m.get('headers')
|
|
618
|
+
if m.get('statusCode') is not None:
|
|
619
|
+
self.status_code = m.get('statusCode')
|
|
620
|
+
if m.get('body') is not None:
|
|
621
|
+
self.body = m.get('body')
|
|
622
|
+
return self
|
|
623
|
+
|
|
624
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: pyodps_catalog
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Alibaba Cloud MaxCompute openapi SDK Library for Python
|
|
5
|
+
Home-page: https://github.com/aliyun/darabonba-openapi
|
|
6
|
+
Author: Alibaba Cloud SDK
|
|
7
|
+
Author-email: sdk-team@alibabacloud.com
|
|
8
|
+
License: Apache License 2.0
|
|
9
|
+
Keywords: pyodps,catalog
|
|
10
|
+
Platform: any
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
|
+
Classifier: Programming Language :: Python
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Topic :: Software Development
|
|
21
|
+
Requires-Python: >=3.6
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
Requires-Dist: maxcompute_tea_openapi<2.0.0,>=1.0.0
|
|
24
|
+
Requires-Dist: alibabacloud_tea_util<1.0.0,>=0.3.13
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description-content-type
|
|
29
|
+
Dynamic: home-page
|
|
30
|
+
Dynamic: keywords
|
|
31
|
+
Dynamic: license
|
|
32
|
+
Dynamic: platform
|
|
33
|
+
Dynamic: requires-dist
|
|
34
|
+
Dynamic: requires-python
|
|
35
|
+
Dynamic: summary
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
setup.py
|
|
2
|
+
pyodps_catalog/__init__.py
|
|
3
|
+
pyodps_catalog/client.py
|
|
4
|
+
pyodps_catalog/models.py
|
|
5
|
+
pyodps_catalog.egg-info/PKG-INFO
|
|
6
|
+
pyodps_catalog.egg-info/SOURCES.txt
|
|
7
|
+
pyodps_catalog.egg-info/dependency_links.txt
|
|
8
|
+
pyodps_catalog.egg-info/requires.txt
|
|
9
|
+
pyodps_catalog.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyodps_catalog
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
"""
|
|
3
|
+
Licensed to the Apache Software Foundation (ASF) under one
|
|
4
|
+
or more contributor license agreements. See the NOTICE file
|
|
5
|
+
distributed with this work for additional information
|
|
6
|
+
regarding copyright ownership. The ASF licenses this file
|
|
7
|
+
to you under the Apache License, Version 2.0 (the
|
|
8
|
+
"License"); you may not use this file except in compliance
|
|
9
|
+
with the License. You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing,
|
|
14
|
+
software distributed under the License is distributed on an
|
|
15
|
+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
KIND, either express or implied. See the License for the
|
|
17
|
+
specific language governing permissions and limitations
|
|
18
|
+
under the License.
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
import os
|
|
22
|
+
from setuptools import setup, find_packages
|
|
23
|
+
|
|
24
|
+
"""
|
|
25
|
+
setup module for pyodps_catalog.
|
|
26
|
+
|
|
27
|
+
Created on 09/04/2025
|
|
28
|
+
|
|
29
|
+
@author: Alibaba Cloud SDK
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
PACKAGE = "pyodps_catalog"
|
|
33
|
+
NAME = "pyodps_catalog" or "alibabacloud-package"
|
|
34
|
+
DESCRIPTION = "Alibaba Cloud MaxCompute openapi SDK Library for Python"
|
|
35
|
+
AUTHOR = "Alibaba Cloud SDK"
|
|
36
|
+
AUTHOR_EMAIL = "sdk-team@alibabacloud.com"
|
|
37
|
+
URL = "https://github.com/aliyun/darabonba-openapi"
|
|
38
|
+
VERSION = __import__(PACKAGE).__version__
|
|
39
|
+
REQUIRES = [
|
|
40
|
+
"maxcompute_tea_openapi>=1.0.0, <2.0.0",
|
|
41
|
+
"alibabacloud_tea_util>=0.3.13, <1.0.0"
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
LONG_DESCRIPTION = ''
|
|
45
|
+
if os.path.exists('./README.md'):
|
|
46
|
+
with open("README.md", encoding='utf-8') as fp:
|
|
47
|
+
LONG_DESCRIPTION = fp.read()
|
|
48
|
+
|
|
49
|
+
setup(
|
|
50
|
+
name=NAME,
|
|
51
|
+
version=VERSION,
|
|
52
|
+
description=DESCRIPTION,
|
|
53
|
+
long_description=LONG_DESCRIPTION,
|
|
54
|
+
long_description_content_type='text/markdown',
|
|
55
|
+
author=AUTHOR,
|
|
56
|
+
author_email=AUTHOR_EMAIL,
|
|
57
|
+
license="Apache License 2.0",
|
|
58
|
+
url=URL,
|
|
59
|
+
keywords=["pyodps","catalog"],
|
|
60
|
+
packages=find_packages(exclude=["tests*"]),
|
|
61
|
+
include_package_data=True,
|
|
62
|
+
platforms="any",
|
|
63
|
+
install_requires=REQUIRES,
|
|
64
|
+
python_requires=">=3.6",
|
|
65
|
+
classifiers=(
|
|
66
|
+
"Development Status :: 4 - Beta",
|
|
67
|
+
"Intended Audience :: Developers",
|
|
68
|
+
"License :: OSI Approved :: Apache Software License",
|
|
69
|
+
"Programming Language :: Python",
|
|
70
|
+
"Programming Language :: Python :: 3",
|
|
71
|
+
"Programming Language :: Python :: 3.6",
|
|
72
|
+
'Programming Language :: Python :: 3.7',
|
|
73
|
+
'Programming Language :: Python :: 3.8',
|
|
74
|
+
'Programming Language :: Python :: 3.9',
|
|
75
|
+
"Topic :: Software Development"
|
|
76
|
+
)
|
|
77
|
+
)
|