-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
202 changed files
with
9,839 additions
and
3,630 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,53 @@ | ||
.. _schema: | ||
|
||
Schema | ||
======= | ||
|
||
.. note:: | ||
|
||
Schema 属于 MaxCompute 的公测功能,需要通过 `新功能测试申请 <https://help.aliyun.com/document_detail/128366.htm>`_ 开通。 | ||
|
||
`Schema <https://help.aliyun.com/document_detail/437084.html>`_ 是 MaxCompute | ||
介于项目和表 / 资源 / 函数之间的概念,对表 / 资源 / 函数进行进一步归类。 | ||
|
||
你可以使用 ``create_schema`` 创建一个 Schema 对象: | ||
|
||
.. code-block:: python | ||
schema = o.create_schema("test_schema") | ||
print(schema) | ||
使用 ``delete_schema`` 删除一个 Schema 对象: | ||
|
||
.. code-block:: python | ||
schema = o.delete_schema("test_schema") | ||
使用 ``list_schema`` 列举所有 Schema 对象: | ||
|
||
.. code-block:: python | ||
for schema in o.list_schema(): | ||
print(schema) | ||
在开启 Schema 后,MaxCompute 入口对象默认操作的 MaxCompute 对象都位于名为 ``DEFAULT`` | ||
的 Schema 下。为操作其他 Schema 下的对象,需要在创建入口对象时指定 Schema,例如: | ||
|
||
.. code-block:: python | ||
o = ODPS('**your-access-id**', '**your-secret-access-key**', '**your-default-project**', | ||
endpoint='**your-end-point**', schema='**your-schema-name**') | ||
也可以为不同对象的操作方法指定 ``schema`` 参数。例如,下面的方法列举了 ``test_schema`` | ||
下所有的表: | ||
|
||
.. code-block:: python | ||
for table in o.list_tables(schema='test_schema'): | ||
print(table) | ||
在执行 SQL 时,可以指定默认 Schema: | ||
|
||
.. code-block:: python | ||
o.execute_sql("SELECT * FROM dual", default_schema="test_schema") |
This file contains 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
This file contains 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.