@clickzetta/cz-cli-darwin-arm64 0.5.15 → 0.5.17
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.
- package/bin/cz-cli +0 -0
- package/bin/skills/lakehouse-doc-en/SKILL.md +6 -11
- package/bin/skills/lakehouse-doc-en/references/AIGateway.md +58 -13
- package/bin/skills/lakehouse-doc-en/references/Computation.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/DataSource_Amazon_DocumentDB.md +3 -1
- package/bin/skills/lakehouse-doc-en/references/Foreach.md +14 -14
- package/bin/skills/lakehouse-doc-en/references/JDBC-Driver.md +0 -1
- package/bin/skills/lakehouse-doc-en/references/LakehouseAI-overview.md +21 -8
- package/bin/skills/lakehouse-doc-en/references/LakehouseDataGPT-tour.md +4 -9
- package/bin/skills/lakehouse-doc-en/references/LakehouseStudio-tour.md +14 -19
- package/bin/skills/lakehouse-doc-en/references/Lakehouse_Zilliz_MakeDataReadyforBIandAI.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/Logstash.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/Migrate_Spark_DataEngineeringBestPractices_Project_to_Lakehouse.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/Notebook.md +17 -17
- package/bin/skills/lakehouse-doc-en/references/RemoteFunction-as-udf.md +14 -14
- package/bin/skills/lakehouse-doc-en/references/SQL_External_Catalog_Guide.md +1 -9
- package/bin/skills/lakehouse-doc-en/references/SUMMARY.md +59 -29
- package/bin/skills/lakehouse-doc-en/references/WINDOWFUNCTION.md +99 -57
- package/bin/skills/lakehouse-doc-en/references/Zettapark_Data_Engineering_Demo.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/access-control-configuration.md +1 -8
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-2-5-1.0.md +16 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-3-29-1.0.2.md +14 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-3-8-1.0.1.md +16 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-4-28-1.1.md +29 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-12-1.1.1.md +18 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-15-1.2.md +9 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-21-1.3.md +9 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-28-1.4.md +10 -0
- package/bin/skills/lakehouse-doc-en/references/aigw-2026-6-3-1.5.md +9 -0
- package/bin/skills/lakehouse-doc-en/references/alicloud-arn-externalid.md +0 -5
- package/bin/skills/lakehouse-doc-en/references/answer-accuracy-improve.md +120 -103
- package/bin/skills/lakehouse-doc-en/references/application-list.md +1 -3
- package/bin/skills/lakehouse-doc-en/references/approval-list.md +16 -17
- package/bin/skills/lakehouse-doc-en/references/batch-load-parquet-file-into-lakehouse.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/batch_sync.md +9 -9
- package/bin/skills/lakehouse-doc-en/references/batch_sync_Sop.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/batchloadparquetfileintoLakehouse.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/bulkloadv1-python-sdk.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/chart-auto-refresh-guide.md +12 -6
- package/bin/skills/lakehouse-doc-en/references/clickzetta-sample-data.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/code_approval.md +1 -5
- package/bin/skills/lakehouse-doc-en/references/composite_task.md +31 -42
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_environment_and_data_generate.md +6 -9
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_javasdk_bulkload_realtime.md +4 -10
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_kafka_realtime_sync.md +1 -10
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_local_file_into_table_by_studio.md +0 -6
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_batchload_public_network.md +0 -5
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_python_node.md +2 -7
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_realtime_cdc_public_network.md +13 -18
- package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_sql_insert.md +0 -1
- package/bin/skills/lakehouse-doc-en/references/concepts.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/config-datasource.md +5 -7
- package/bin/skills/lakehouse-doc-en/references/connect-with-cli.md +116 -72
- package/bin/skills/lakehouse-doc-en/references/connect-with-cz-cli.md +151 -0
- package/bin/skills/lakehouse-doc-en/references/continue-job.md +9 -17
- package/bin/skills/lakehouse-doc-en/references/create-api-connection.md +315 -286
- package/bin/skills/lakehouse-doc-en/references/create-catalog-connection.md +1 -0
- package/bin/skills/lakehouse-doc-en/references/create-dynamic-table.md +4 -4
- package/bin/skills/lakehouse-doc-en/references/create-external-catalog.md +85 -22
- package/bin/skills/lakehouse-doc-en/references/create-table-ddl.md +45 -0
- package/bin/skills/lakehouse-doc-en/references/creating_alicloud_privatelinkendpoint.md +4 -6
- package/bin/skills/lakehouse-doc-en/references/creating_alicloud_privatelinkservice.md +4 -7
- package/bin/skills/lakehouse-doc-en/references/creating_tencentcloud_privatelinkendpoint.md +2 -7
- package/bin/skills/lakehouse-doc-en/references/creating_tencentcloud_privatelinkservice.md +1 -5
- package/bin/skills/lakehouse-doc-en/references/cz-cli-agent.md +15 -10
- package/bin/skills/lakehouse-doc-en/references/cz-cli-datasource.md +0 -8
- package/bin/skills/lakehouse-doc-en/references/cz-cli-sql.md +2 -45
- package/bin/skills/lakehouse-doc-en/references/cz-cli.md +53 -42
- package/bin/skills/lakehouse-doc-en/references/dashboard-version-management-guide.md +12 -4
- package/bin/skills/lakehouse-doc-en/references/data-integration-intro.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/data-integration.md +29 -27
- package/bin/skills/lakehouse-doc-en/references/data-load-summary.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/data-quality.md +25 -25
- package/bin/skills/lakehouse-doc-en/references/data-sharing.md +31 -54
- package/bin/skills/lakehouse-doc-en/references/data-sources.md +45 -45
- package/bin/skills/lakehouse-doc-en/references/data_catalog.md +23 -25
- package/bin/skills/lakehouse-doc-en/references/data_privacy.md +5 -2
- package/bin/skills/lakehouse-doc-en/references/data_sharing_between_accounts_guide.md +0 -4
- package/bin/skills/lakehouse-doc-en/references/data_visualization.md +4 -15
- package/bin/skills/lakehouse-doc-en/references/dataagent.md +39 -7
- package/bin/skills/lakehouse-doc-en/references/databricks-delta-to-lakehouse-migration.md +168 -0
- package/bin/skills/lakehouse-doc-en/references/databricks-dlt-to-lakehouse-migration.md +331 -0
- package/bin/skills/lakehouse-doc-en/references/databricks-external-catalog-practice.md +367 -0
- package/bin/skills/lakehouse-doc-en/references/databricks-jobs-to-studio-migration.md +199 -0
- package/bin/skills/lakehouse-doc-en/references/databricks-notebook-to-studio-migration.md +350 -0
- package/bin/skills/lakehouse-doc-en/references/databricks-uc-governance-to-lakehouse-migration.md +327 -0
- package/bin/skills/lakehouse-doc-en/references/datagpt-model-config.md +34 -0
- package/bin/skills/lakehouse-doc-en/references/datagpt_data_source.md +50 -37
- package/bin/skills/lakehouse-doc-en/references/datagpt_introduction.md +55 -79
- package/bin/skills/lakehouse-doc-en/references/datagpt_quickstart.md +50 -64
- package/bin/skills/lakehouse-doc-en/references/datalake-acceleration.md +75 -2
- package/bin/skills/lakehouse-doc-en/references/dbt-databricks-to-clickzetta-migration.md +242 -0
- package/bin/skills/lakehouse-doc-en/references/dynamic-mask.md +30 -30
- package/bin/skills/lakehouse-doc-en/references/dynamic-table-bestpractice.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/dynamic-table-introduce.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/dynamic_table_summary.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/eco_integration/streamlit.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/eco_integration/superset.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/ecosystem-all.md +1 -3
- package/bin/skills/lakehouse-doc-en/references/ecosystem.md +145 -0
- package/bin/skills/lakehouse-doc-en/references/external-catalog-summary.md +33 -38
- package/bin/skills/lakehouse-doc-en/references/external-function-combo-practice.md +466 -0
- package/bin/skills/lakehouse-doc-en/references/f6fc6447ee.md +7 -9
- package/bin/skills/lakehouse-doc-en/references/federation-query.md +56 -6
- package/bin/skills/lakehouse-doc-en/references/finebi-mysql.md +2 -0
- package/bin/skills/lakehouse-doc-en/references/get-started-with-sample-data.md +10 -11
- package/bin/skills/lakehouse-doc-en/references/gitfolder.md +2 -3
- package/bin/skills/lakehouse-doc-en/references/grant-privileges.md +2 -0
- package/bin/skills/lakehouse-doc-en/references/iceberg-rest-catalog-databricks.md +166 -0
- package/bin/skills/lakehouse-doc-en/references/ide.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/if_else_task.md +59 -57
- package/bin/skills/lakehouse-doc-en/references/input_output.md +10 -7
- package/bin/skills/lakehouse-doc-en/references/jobprofile-bestpractices.md +60 -64
- package/bin/skills/lakehouse-doc-en/references/kafka-connection.md +0 -1
- package/bin/skills/lakehouse-doc-en/references/key-concepts.md +146 -117
- package/bin/skills/lakehouse-doc-en/references/lakehouse-ai-gateway-cz-cli.md +317 -0
- package/bin/skills/lakehouse-doc-en/references/lakehouse-ai-sql-analysis.md +345 -0
- package/bin/skills/lakehouse-doc-en/references/lakehouse-dqc-guide.md +300 -0
- package/bin/skills/lakehouse-doc-en/references/lakehouse-medallion-sql-dt-guide.md +543 -0
- package/bin/skills/lakehouse-doc-en/references/lakehouse-multi-cloud-acceleration.md +274 -0
- package/bin/skills/lakehouse-doc-en/references/lakehouse-multimodal-ai-pipeline.md +198 -0
- package/bin/skills/lakehouse-doc-en/references/lakehouse-quick-experience_guide.md +49 -52
- package/bin/skills/lakehouse-doc-en/references/lakehouse-volume-pipe-acceleration-guide.md +380 -0
- package/bin/skills/lakehouse-doc-en/references/langchain-plug-installation.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/management.md +4 -9
- package/bin/skills/lakehouse-doc-en/references/medallion-lakehouse-from-scratch.md +2 -1
- package/bin/skills/lakehouse-doc-en/references/metrics_answer_build.md +58 -21
- package/bin/skills/lakehouse-doc-en/references/migrate-spark-data-engineering-best-practices-to-lakehouse.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/mindsdb.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/monitoring_and_alerting.md +65 -60
- package/bin/skills/lakehouse-doc-en/references/monitoring_item_specification.md +33 -33
- package/bin/skills/lakehouse-doc-en/references/multitable_batch_sync.md +16 -16
- package/bin/skills/lakehouse-doc-en/references/multitable_realtime_sync.md +65 -72
- package/bin/skills/lakehouse-doc-en/references/multitable_realtime_sync_sop.md +54 -52
- package/bin/skills/lakehouse-doc-en/references/navicat-mysql.md +2 -0
- package/bin/skills/lakehouse-doc-en/references/om-dynamic-table.md +71 -66
- package/bin/skills/lakehouse-doc-en/references/om-vcluster.md +2 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-create-session.md +79 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-generate-auth-token.md +63 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-overview.md +96 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-quick-start.md +286 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-response-guide.md +264 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-safe-question-poll.md +201 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-text2insight-query.md +99 -0
- package/bin/skills/lakehouse-doc-en/references/open-api-text2insight-stop.md +74 -0
- package/bin/skills/lakehouse-doc-en/references/overview.md +6 -7
- package/bin/skills/lakehouse-doc-en/references/permission-application.md +5 -5
- package/bin/skills/lakehouse-doc-en/references/pipe-introduction.md +1 -0
- package/bin/skills/lakehouse-doc-en/references/pipe-kafka-table-stream.md +72 -70
- package/bin/skills/lakehouse-doc-en/references/pipe-kafka.md +105 -110
- package/bin/skills/lakehouse-doc-en/references/pipe-overview.md +40 -40
- package/bin/skills/lakehouse-doc-en/references/pipe-storage-object.md +43 -48
- package/bin/skills/lakehouse-doc-en/references/pipe-summary.md +14 -4
- package/bin/skills/lakehouse-doc-en/references/pipe-syntax.md +58 -151
- package/bin/skills/lakehouse-doc-en/references/practice_python_task.md +4 -4
- package/bin/skills/lakehouse-doc-en/references/pricing-ai-gateway.md +181 -0
- package/bin/skills/lakehouse-doc-en/references/pricing-lakehouse.md +316 -0
- package/bin/skills/lakehouse-doc-en/references/pricing.md +44 -288
- package/bin/skills/lakehouse-doc-en/references/private-link-general.md +0 -2
- package/bin/skills/lakehouse-doc-en/references/pyspark-to-zettapark-migration-f1.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/python-igs.md +7 -3
- package/bin/skills/lakehouse-doc-en/references/python-sample-put-github-rt-events.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/python-task.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/python_reference/connector.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/python_reference/connector_advanced.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/python_reference/connector_examples.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/python_sdk_guide.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/python_shell_datasource.md +11 -9
- package/bin/skills/lakehouse-doc-en/references/quick_start_batch_sync_data.md +9 -18
- package/bin/skills/lakehouse-doc-en/references/quick_start_bi_analysis.md +8 -25
- package/bin/skills/lakehouse-doc-en/references/quick_start_create_workspace.md +4 -6
- package/bin/skills/lakehouse-doc-en/references/quick_start_data_quality.md +8 -8
- package/bin/skills/lakehouse-doc-en/references/quick_start_etl.md +16 -20
- package/bin/skills/lakehouse-doc-en/references/quick_start_monitoring_and_alerting.md +10 -18
- package/bin/skills/lakehouse-doc-en/references/quick_start_sql_query.md +7 -10
- package/bin/skills/lakehouse-doc-en/references/quick_start_upload_data.md +5 -7
- package/bin/skills/lakehouse-doc-en/references/quick_start_user_management.md +8 -8
- package/bin/skills/lakehouse-doc-en/references/quick_start_workspace.md +0 -5
- package/bin/skills/lakehouse-doc-en/references/quick_start_workspace_user.md +8 -8
- package/bin/skills/lakehouse-doc-en/references/quickstart.md +69 -56
- package/bin/skills/lakehouse-doc-en/references/quickstart_datashare_between_companies.md +0 -5
- package/bin/skills/lakehouse-doc-en/references/quickstart_envirment_for_team.md +0 -24
- package/bin/skills/lakehouse-doc-en/references/realtime-pipeline-selection-guide.md +1 -2
- package/bin/skills/lakehouse-doc-en/references/realtime-sales-dashboard-with-dynamic-table.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/realtime_sync.md +0 -1
- package/bin/skills/lakehouse-doc-en/references/release-note-2026-05-19.md +5 -3
- package/bin/skills/lakehouse-doc-en/references/revoke-privileges.md +3 -1
- package/bin/skills/lakehouse-doc-en/references/roles.md +2 -3
- package/bin/skills/lakehouse-doc-en/references/row-filter.md +165 -0
- package/bin/skills/lakehouse-doc-en/references/row_level_permission.md +30 -19
- package/bin/skills/lakehouse-doc-en/references/scheduled_task.md +28 -21
- package/bin/skills/lakehouse-doc-en/references/security_overview.md +99 -21
- package/bin/skills/lakehouse-doc-en/references/set-command.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/setup.md +13 -15
- package/bin/skills/lakehouse-doc-en/references/show-grants.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/snowflake-dynamic-tables-to-lakehouse.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/spark-connector-summary.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/sql_functions/context_functions/current_vcluster.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/sso-configuration.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/streaming_pipeline_with_dynamic_table.md +0 -1
- package/bin/skills/lakehouse-doc-en/references/studio-incremental-sync-practice.md +27 -23
- package/bin/skills/lakehouse-doc-en/references/studio-shell-task.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/supported-cloud-platforms.md +32 -0
- package/bin/skills/lakehouse-doc-en/references/table_rendering.md +18 -12
- package/bin/skills/lakehouse-doc-en/references/task-develop.md +89 -91
- package/bin/skills/lakehouse-doc-en/references/task_development.md +19 -17
- package/bin/skills/lakehouse-doc-en/references/task_group.md +16 -14
- package/bin/skills/lakehouse-doc-en/references/task_instance.md +21 -21
- package/bin/skills/lakehouse-doc-en/references/task_param.md +38 -35
- package/bin/skills/lakehouse-doc-en/references/task_param_reference.md +81 -79
- package/bin/skills/lakehouse-doc-en/references/task_scheduling_dependency.md +20 -21
- package/bin/skills/lakehouse-doc-en/references/tencentcloud_arn_and_externalid.md +1 -5
- package/bin/skills/lakehouse-doc-en/references/trial-account-quotas-and-limits.md +1 -3
- package/bin/skills/lakehouse-doc-en/references/tutorial_connect_to_lakehouse.md +69 -0
- package/bin/skills/lakehouse-doc-en/references/tutorials.md +4 -1
- package/bin/skills/lakehouse-doc-en/references/unique-key.md +167 -0
- package/bin/skills/lakehouse-doc-en/references/usageandbillingview.md +138 -0
- package/bin/skills/lakehouse-doc-en/references/use-dbt-dev.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/use-java-sdk-realtime-uploaddata.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/use-java-sdk-upload-data-local.md +3 -3
- package/bin/skills/lakehouse-doc-en/references/use-models.md +128 -0
- package/bin/skills/lakehouse-doc-en/references/use-mysql-client.md +81 -81
- package/bin/skills/lakehouse-doc-en/references/use-python-sdk-upload-data.md +10 -12
- package/bin/skills/lakehouse-doc-en/references/user-identification.md +2 -3
- package/bin/skills/lakehouse-doc-en/references/user_permission_grand_guide.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/using-udf-in-dynamic-table.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/vc_cache.md +18 -22
- package/bin/skills/lakehouse-doc-en/references/vcluster_size_description.md +33 -31
- package/bin/skills/lakehouse-doc-en/references/virtual-cluster.md +43 -45
- package/bin/skills/lakehouse-doc-en/references/web-job-history.md +94 -108
- package/bin/skills/lakehouse-doc-en/references/web_search.md +16 -7
- package/bin/skills/lakehouse-doc-en/references/zettapark-data-engineering-demo.md +1 -1
- package/bin/skills/lakehouse-doc-en/references/zettapark-dataframe-guide.md +144 -70
- package/bin/skills/lakehouse-doc-en/references/zettapark-dynamic-table-guide.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/zettapark-etl-guide.md +73 -33
- package/bin/skills/lakehouse-doc-en/references/zettapark-feature-engineering.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/zettapark-functions-guide.md +75 -46
- package/bin/skills/lakehouse-doc-en/references/zettapark-quick-start.md +2 -2
- package/bin/skills/lakehouse-doc-en/references/zettapark-stream-guide.md +4 -4
- package/bin/skills/lakehouse-doc-en/references/zettapark-volume-guide.md +93 -29
- package/package.json +1 -1
- package/bin/skills/lakehouse-doc-en/references/CLAUDE.md +0 -606
- package/bin/skills/lakehouse-doc-en/references/modelprice.md +0 -155
|
@@ -1,104 +1,90 @@
|
|
|
1
1
|
# Create API CONNECTION
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
API CONNECTION is primarily used to store and protect authentication information for third-party application services. Through API CONNECTION, Singdata Lakehouse's EXTERNAL FUNCTIONs can securely interact with these services via API calls. Currently, the external services supported by API CONNECTION include **Alibaba Cloud Function Compute (FC)**, **Tencent Cloud Functions (SCF)**, and **AWS Lambda**.
|
|
4
4
|
|
|
5
5
|
## Syntax
|
|
6
6
|
|
|
7
|
-
Syntax 1
|
|
8
7
|
```
|
|
9
|
-
CREATE API CONNECTION [ IF NOT EXISTS ] connection_name
|
|
10
|
-
TYPE
|
|
11
|
-
PROVIDER=''
|
|
12
|
-
REGION=''
|
|
13
|
-
ROLE_ARN=''
|
|
14
|
-
|
|
15
|
-
CODE_BUCKET=''
|
|
8
|
+
CREATE API CONNECTION [ IF NOT EXISTS ] <connection_name>
|
|
9
|
+
TYPE CLOUD_FUNCTION
|
|
10
|
+
PROVIDER = '<provider>'
|
|
11
|
+
REGION = '<region>'
|
|
12
|
+
ROLE_ARN = '<role_arn>'
|
|
13
|
+
NAMESPACE = '<namespace>'
|
|
14
|
+
CODE_BUCKET = '<code_bucket>'
|
|
16
15
|
```
|
|
17
|
-
* PROVIDER: Cloud function provider, such as TENCENT, ALIYUN, and AWS
|
|
18
|
-
* REGION: The region where the corresponding cloud function is located, such as 'cn-shanghai'. For Alibaba Cloud, refer to the link [region](https://help.aliyun.com/zh/oss/user-guide/regions-and-endpoints?scm=20140722.S_help%40%40%E6%96%87%E6%A1%A3%40%4031837.S_BB2%40bl%2BRQW%40ag0%2BBB1%40ag0%2Bhot%2Bos0.ID_31837-RL_%E5%9F%9F%E5%90%8D-LOC_doc%7EUND%7Eab-OR_ser-V_4-P0_2\&spm=a2c4g.11186623.d_help_search.i3), for Tencent Cloud refer to the link [region](https://cloud.tencent.com/document/product/583/17299#.E6.94.AF.E6.8C.81.E5.9C.B0.E5.9F.9F) such as: ap-beijing, for AWS refer to: [China region endpoints](https://docs.amazonaws.cn/aws/latest/userguide/endpoints-arns.html), international endpoints [region](https://docs.aws.amazon.com/general/latest/gr/lambda-service.html)
|
|
19
|
-
* ROLE\_ARN: The role assumed when creating the cloud function, such as acs:ram::12228000000000000:role/czudfrole
|
|
20
|
-
* CODE\_BUCKET: The name of the object storage bucket where the cloud function program files are located.
|
|
21
|
-
* NAMESPCE: Required when using Tencent Cloud. For other cloud services, you can leave it blank or directly fill in 'default'. This value can be obtained as shown in the figure below
|
|
22
|
-

|
|
23
|
-
Syntax two
|
|
24
|
-
```SQL
|
|
25
|
-
CREATE API CONNECTION [ IF NOT EXISTS ] connection_name
|
|
26
|
-
TYPE CLOUD_FUNCTION
|
|
27
|
-
WITH PROPERTIES('parameter_key'='parameter_value')
|
|
28
|
-
[COMMENT 'comment'];
|
|
29
|
-
```
|
|
30
|
-
**Parameter Description**
|
|
31
16
|
|
|
32
|
-
|
|
33
|
-
* `TYPE`: Specifies the type of data source for the connection, such as `CLOUD_FUNCTION`.
|
|
34
|
-
* `WITH PROPERTIES`: Specifies the authentication and connection information required for the external data source.
|
|
35
|
-
* `parameter_key`: Property key.
|
|
36
|
-
* `parameter_value`: Property value.
|
|
37
|
-
* `IF NOT EXISTS`: Optional parameter. If the specified connection already exists, no changes are made, and a message indicating the connection exists is returned; if not specified and the connection exists, an error message is returned.
|
|
38
|
-
* `COMMENT`: Optional parameter for adding comment information.
|
|
17
|
+
### Parameter Descriptions
|
|
39
18
|
|
|
40
|
-
|
|
19
|
+
| Parameter | Description |
|
|
20
|
+
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `connection_name` | Name of the API connection to create. |
|
|
22
|
+
| `PROVIDER` | Cloud function service provider. Supported values: `'tencent'`, `'aliyun'`, and `'aws'`. |
|
|
23
|
+
| `REGION` | Region where the cloud function is deployed. **Examples**: Alibaba Cloud: `'cn-shanghai'` ([region codes](https://help.aliyun.com/document_detail/40654.html)); Tencent Cloud: `'ap-beijing'` ([region codes](https://intl.cloud.tencent.com/document/product/213/6091)); AWS: `'ap-southeast-1'` (international) or `'cn-north-1'` (China) |
|
|
24
|
+
| `ROLE_ARN` | Role ARN used to execute cloud functions. **Example (Alibaba Cloud)**: `acs:ram::1222800000000000:role/czudfrole`. **Example (Tencent Cloud)**: `qcs::cam::uin/1000*******:roleName/LakehouseRole`. **Example (AWS)**: `arn:aws:iam::928925945197:role/Lambda-S3-Role` |
|
|
25
|
+
| `NAMESPACE` | Namespace for the cloud function. **Required for Tencent Cloud**. For other cloud services, fill in `'default'` or leave blank as appropriate. |
|
|
26
|
+
| `CODE_BUCKET` | Name of the object storage bucket containing the cloud function code package. **Tencent Cloud format is `BucketName-APP_ID`**, e.g., `myfunction-131xxxxx`. |
|
|
41
27
|
|
|
42
|
-
|
|
28
|
+
For NAMESPACE: required when using Tencent Cloud. For other cloud services it can be omitted or set to `'default'`. The value is obtained as shown in the image below:
|
|
29
|
+

|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
| ---------------------------- | --------------------- | ----------------------------------------- | ------ |
|
|
46
|
-
| `cloud_function.provider` | Cloud function service provider | `aliyun` | Yes |
|
|
47
|
-
| `cloud_function.region` | Region where the cloud function service is located | `cn-beijing` / `cn-hangzhou` | Yes |
|
|
48
|
-
| `cloud_function.role_arn` | User's ARN authorization information | `acs:ram::123456789012:role/YourRoleName` | Yes |
|
|
49
|
-
| `cloud_function.namespace` | Specifies the namespace of the external function, required for Tencent Cloud | `your_namespace` | Yes |
|
|
50
|
-
| `cloud_function.code_bucket` | Object storage Bucket information where the user's code is stored | `your_bucket_name` | Yes |
|
|
31
|
+
^
|
|
51
32
|
|
|
52
33
|
## Case Description
|
|
53
34
|
|
|
54
|
-
API CONNECTION is
|
|
35
|
+
API CONNECTION is primarily used for creating EXTERNAL FUNCTIONs. The EXTERNAL FUNCTION usage flow is:
|
|
36
|
+
|
|
37
|
+
* User activates cloud function compute services (e.g., Alibaba Cloud Function Compute FC) and object storage services
|
|
38
|
+
* Upload function execution code & executables, dependent libraries, models, and data files to object storage
|
|
39
|
+
* Grant Singdata Lakehouse permission to operate the above services and access function files
|
|
40
|
+
* User calls EXTERNAL FUNCTION in Singdata Lakehouse SQL statements
|
|
41
|
+
* Singdata Lakehouse sends an HTTP request to the provided service address using the authentication information to invoke the function
|
|
42
|
+
* Singdata Lakehouse retrieves the response and returns the result
|
|
55
43
|
|
|
56
|
-
|
|
57
|
-
* Upload the function execution code & executable files, dependent libraries, models, and data files to object storage.
|
|
58
|
-
* Grant Singdata Lakehouse permission to operate the above services and access function files.
|
|
59
|
-
* Users call Remote function in Singdata Lakehouse SQL statements.
|
|
60
|
-
* Singdata Lakehouse sends an HTTP request to call the running function based on the provided service address and authentication information.
|
|
61
|
-
* Singdata Lakehouse retrieves the response information and returns the result.
|
|
62
|
-
Therefore, you must activate function computing services and object storage services and grant Lakehouse permissions.
|
|
44
|
+
Therefore, you must activate function compute and object storage services and grant Singdata Lakehouse the necessary permissions.
|
|
63
45
|
|
|
64
|
-
###
|
|
46
|
+
### Creating API CONNECTION on Alibaba Cloud
|
|
65
47
|
|
|
66
48
|
* **Environment Preparation**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
49
|
+
EXTERNAL FUNCTION depends on Alibaba Cloud's "[Object Storage](https://oss.console.aliyun.com/overview)" and "[Function Compute](https://fcnext.console.aliyun.com/overview)" services. Ensure these services are activated.
|
|
50
|
+
|
|
51
|
+
* Step 1: Activate Function Compute FC and Object Storage OSS services. Keep them in the same region as the Singdata Lakehouse instance (e.g., `cn-shanghai`).
|
|
52
|
+
|
|
53
|
+
* Step 2: Get OSS Bucket + AccessKey.
|
|
54
|
+
* Go to [OSS Console](https://oss.console.aliyun.com) → Create Bucket (same region as FC).
|
|
55
|
+
* Go to [RAM User Management](https://ram.console.aliyun.com/users) → Create AccessKey, record the **AccessKey ID** and **AccessKey Secret**.
|
|
56
|
+
|
|
57
|
+
* Step 3: Edit the AliyunFCFullAccess permission policy (add ram:PassRole permission).
|
|
58
|
+
* Go to [RAM Policy Console](https://ram.console.aliyun.com/policies) → search for **AliyunFCFullAccess** → Edit, add the `ram:PassRole` section:
|
|
59
|
+
|
|
60
|
+
```json
|
|
61
|
+
{
|
|
62
|
+
"Version": "1",
|
|
63
|
+
"Statement": [
|
|
64
|
+
{
|
|
65
|
+
"Action": "fc:*",
|
|
66
|
+
"Resource": "*",
|
|
67
|
+
"Effect": "Allow"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"Action": "ram:PassRole",
|
|
71
|
+
"Resource": "*",
|
|
72
|
+
"Effect": "Allow",
|
|
73
|
+
"Condition": {
|
|
74
|
+
"StringEquals": {
|
|
75
|
+
"acs:Service": "fc.aliyuncs.com"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
* Step 4: Create custom permission policy CzUdfOssAccess.
|
|
84
|
+
* Go to [RAM Policy Console](https://ram.console.aliyun.com/policies) → **Create Permission Policy** → **Script Editor**.
|
|
85
|
+
* Replace `bucket_name_1` etc. with actual OSS bucket names. Note: the same bucket needs both `bucket_name` and `bucket_name/*` Resource entries:
|
|
86
|
+
|
|
87
|
+
```json
|
|
102
88
|
{
|
|
103
89
|
"Version": "1",
|
|
104
90
|
"Statement": [
|
|
@@ -112,48 +98,54 @@ API CONNECTION is mainly used for creating EXTERNAL FUNCTION. The usage process
|
|
|
112
98
|
],
|
|
113
99
|
"Resource": [
|
|
114
100
|
"acs:oss:*:*:bucket_name_1",
|
|
115
|
-
"acs:oss:*:*:bucket_name_1/*"
|
|
116
|
-
"acs:oss:*:*:bucket_name_2",
|
|
117
|
-
"acs:oss:*:*:bucket_name_2/*",
|
|
118
|
-
"acs:oss:*:*:bucket_name_3",
|
|
119
|
-
"acs:oss:*:*:bucket_name_3/*"
|
|
101
|
+
"acs:oss:*:*:bucket_name_1/*"
|
|
120
102
|
]
|
|
121
103
|
}
|
|
122
104
|
]
|
|
123
105
|
}
|
|
124
106
|
```
|
|
125
|
-
|
|
126
|
-
*
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
|
|
132
|
-
*
|
|
133
|
-
|
|
134
|
-
*
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
107
|
+
|
|
108
|
+
* Click **Next**, enter the policy name **CzUdfOssAccess**, click **Done**.
|
|
109
|
+
|
|
110
|
+
* Step 5: Create a RAM Role and authorize it.
|
|
111
|
+
* Go to [RAM Role Console](https://ram.console.aliyun.com/roles) → **Create Role**:
|
|
112
|
+
* Role type: **Alibaba Cloud Account** → **Other Cloud Account**
|
|
113
|
+
* Enter Account ID `1384322691904283` (Singdata Lakehouse's main account), click **Next**
|
|
114
|
+
* Under **Select Permissions**, check both the system policy **AliyunFCFullAccess** and the custom policy **CzUdfOssAccess**
|
|
115
|
+
* Click **Next**, enter the role name (e.g., `CzUDFRole`), click **OK**
|
|
116
|
+
* After successful creation, go to the role detail page to get the **Role ARN**: `acs:ram::<your_account_id>:role/CzUDFRole`
|
|
117
|
+
|
|
118
|
+
* Step 6: Execute SQL to create API CONNECTION.
|
|
119
|
+
|
|
120
|
+
```sql
|
|
121
|
+
CREATE API CONNECTION my_funciton_connection
|
|
122
|
+
TYPE CLOUD_FUNCTION
|
|
123
|
+
PROVIDER = 'aliyun'
|
|
124
|
+
REGION = 'cn-shanghai'
|
|
125
|
+
ROLE_ARN = 'acs:ram::1757168149572678:role/CzUDFRole'
|
|
126
|
+
CODE_BUCKET = 'function-compute-my1';
|
|
144
127
|
```
|
|
128
|
+
|
|
129
|
+
* Step 7 (optional): Configure External ID.
|
|
130
|
+
|
|
131
|
+
After successful creation, run the following to get the External ID:
|
|
132
|
+
|
|
133
|
+
```sql
|
|
145
134
|
DESC CONNECTION my_funciton_connection;
|
|
146
135
|
```
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
136
|
+
|
|
137
|
+

|
|
138
|
+
|
|
139
|
+
Go back to Alibaba Cloud [RAM Roles](https://ram.console.aliyun.com/roles) → `CzUDFRole` → **Trust Policy** → **Edit**, replace the `sts:ExternalId` value with the value from the DESC result:
|
|
140
|
+
|
|
141
|
+
```json
|
|
150
142
|
{
|
|
151
143
|
"Statement": [
|
|
152
144
|
{
|
|
153
145
|
"Action": "sts:AssumeRole",
|
|
154
146
|
"Condition": {
|
|
155
147
|
"StringEquals": {
|
|
156
|
-
"sts:ExternalId": "
|
|
148
|
+
"sts:ExternalId": "Replace with the ExternalId from DESC result"
|
|
157
149
|
}
|
|
158
150
|
},
|
|
159
151
|
"Effect": "Allow",
|
|
@@ -167,186 +159,223 @@ CODE_BUCKET='function-compute-my1';
|
|
|
167
159
|
"Version": "1"
|
|
168
160
|
}
|
|
169
161
|
```
|
|
170
|
-
|
|
162
|
+
|
|
163
|
+
> The `1384322691904283` in the trust policy is the Singdata main account and must not be changed.
|
|
164
|
+
|
|
165
|
+
### Creating API CONNECTION on Tencent Cloud
|
|
171
166
|
|
|
172
167
|
**Environment Preparation**
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
* Object Storage: Required in the Lakehouse deployment region (e.g., ap-shanghai)
|
|
176
|
-
* Cloud Functions: After activating
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
*
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
*
|
|
190
|
-
* In the
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
168
|
+
EXTERNAL FUNCTION depends on Tencent Cloud's "[Object Storage](https://console.cloud.tencent.com/cos)" and "[Cloud Functions](https://console.cloud.tencent.com/scf/list?rid=1\&ns=default)" services. Ensure these services are activated.
|
|
169
|
+
|
|
170
|
+
* Object Storage: Required in the Singdata Lakehouse deployment region (e.g., ap-shanghai) for storing function base code.
|
|
171
|
+
* Cloud Functions: After activating **Cloud Functions**, it is recommended to manually create a function using the template creation feature, preferably Flask framework templates or other templates with a WebFunc tag. During this process, the Tencent Cloud console will guide users through initial configurations such as activating log services (CLS) and other dependencies, creating necessary Access Control (CAM) roles, and granting necessary CAM permissions.
|
|
172
|
+
|
|
173
|
+
* Step 1: Activate Tencent Cloud's Cloud Functions (SCF) service. Keep the cloud function region consistent with the Singdata Lakehouse service region.
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+
* Step 2: Activate COS and create a storage bucket.
|
|
177
|
+
* Go to [COS Console](https://console.cloud.tencent.com/cos) → Create bucket (same region as SCF, e.g., `ap-shanghai`).
|
|
178
|
+
* After creation, the full name in the bucket list is `BucketName-APP_ID` (e.g., `myfunction-1310000503`). **Record the Bucket name and APP_ID**—both are needed for configuration.
|
|
179
|
+
|
|
180
|
+
* Step 3: Obtain API credentials.
|
|
181
|
+
* Go to [Access Management](https://console.cloud.tencent.com/cam/capi) → Create credentials, record **SecretId** and **SecretKey**.
|
|
182
|
+
|
|
183
|
+
* Step 4: Create CAM custom policy (LakehouseAccess).
|
|
184
|
+
* Log in to Tencent Cloud, go to the **Access Management** [product console](https://console.cloud.tencent.com/cam/policy)
|
|
185
|
+
* In the left navigation bar go to **Policies**, select **Create Custom Policy** → **Create by Policy Syntax** → select **Blank Template**, paste the following JSON (replace `<region>`, `<APP_ID>`, `<bucket>` with actual values):
|
|
186
|
+
|
|
187
|
+
```json
|
|
188
|
+
{
|
|
189
|
+
"statement": [
|
|
190
|
+
{
|
|
191
|
+
"action": ["scf:*"],
|
|
192
|
+
"effect": "allow",
|
|
193
|
+
"resource": ["*"]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"action": ["cos:*"],
|
|
197
|
+
"effect": "allow",
|
|
198
|
+
"resource": [
|
|
199
|
+
"qcs::cos:<region>:uid/<APP_ID>:<bucket>-<APP_ID>/*"
|
|
200
|
+
]
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"version": "2.0"
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
> Example: `qcs::cos:ap-shanghai:uid/1253896122:qiliang-external-function-1253896122/*`
|
|
208
|
+
|
|
209
|
+
* Click **Next**, set the policy name to **`LakehouseAccess`** (must use this name exactly), click **Done**.
|
|
210
|
+
|
|
211
|
+
> ⚠️ The policy must include both `scf:*` and `cos:*` rules. Missing the COS permission will cause `AccessDenied (Status Code: 403)` during `CREATE FUNCTION`. The COS Resource format is `qcs::cos:<region>:uid/<APP_ID>:<bucket>-<APP_ID>/*`; the trailing `/*` is required.
|
|
212
|
+
|
|
213
|
+
* Step 5: Create CAM Role (LakehouseRole).
|
|
214
|
+
* Go to [Access Management](https://console.cloud.tencent.com/cam/role) → Create role:
|
|
215
|
+
* Role entity: **Tencent Cloud Account** → **Other Main Account**
|
|
216
|
+
* Enter Account ID `100029595716` (Singdata's Tencent Cloud main account), click **Next**
|
|
217
|
+
* Check the newly created `LakehouseAccess` policy, click **Next**
|
|
218
|
+
* Set the role name to **`LakehouseRole`** (must use this name exactly), click **Done**
|
|
219
|
+
* After successful creation, go to the role detail page to get the Role ARN: `qcs::cam::uin/<your_account_id>:roleName/LakehouseRole`
|
|
220
|
+
|
|
221
|
+
> ⚠️ The role name must be `LakehouseRole`. The role entity must be set to "Other Main Account" and trust Singdata account `100029595716`—**not** "Tencent Cloud Product Services".
|
|
222
|
+
|
|
223
|
+
* Step 6: Execute SQL to create API CONNECTION.
|
|
224
|
+
|
|
225
|
+
```sql
|
|
226
|
+
CREATE API CONNECTION my_funciton_connection
|
|
203
227
|
TYPE CLOUD_FUNCTION
|
|
204
|
-
PROVIDER='tencent'
|
|
205
|
-
REGION='ap-shanghai'
|
|
206
|
-
ROLE_ARN='qcs::cam::uin
|
|
207
|
-
|
|
208
|
-
CODE_BUCKET='myfunction-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
228
|
+
PROVIDER = 'tencent'
|
|
229
|
+
REGION = 'ap-shanghai'
|
|
230
|
+
ROLE_ARN = 'qcs::cam::uin/<your_account_id>:roleName/LakehouseRole'
|
|
231
|
+
NAMESPACE = 'default'
|
|
232
|
+
CODE_BUCKET = 'myfunction-1310000503';
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
> ⚠️ `CODE_BUCKET` format is `BucketName-APP_ID` (cannot be just the Bucket name). `NAMESPACE` is required for Tencent Cloud and is typically `default`.
|
|
236
|
+
|
|
237
|
+
* Step 7 (optional): Configure External ID.
|
|
238
|
+
> ⚠️ **Note**: To prevent the ROLE_ARN from being obtained by third parties for unauthorized data access, you can use `EXTERNAL ID` as an additional verification layer, ensuring that access is only allowed when the request includes the preset `EXTERNAL ID`. This means that even if a third party knows other access information (such as the role ARN), they cannot access the resource without the correct `EXTERNAL ID`.
|
|
239
|
+
|
|
240
|
+
After the API CONNECTION is successfully created, run the following to get the External ID:
|
|
241
|
+
|
|
242
|
+
```sql
|
|
243
|
+
DESC CONNECTION my_funciton_connection;
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+

|
|
218
247
|
|
|
219
|
-
*
|
|
248
|
+
* On the client side: Go to the Tencent Cloud **Access Management** console, **Role** → **LakehouseRole** → **Role Entity** → **Manage Entities**, select **Add Account** → select **Current Main Account**, enter the main account ID `100029595716` (Singdata's Tencent Cloud main account), check **Enable Verification**, enter the EXTERNAL_ID from the DESC result, click **Confirm** → **Update**.
|
|
220
249
|
|
|
221
|
-
###
|
|
250
|
+
### Creating API CONNECTION on AWS
|
|
222
251
|
|
|
223
252
|
* **Environment Preparation**
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
*
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
253
|
+
EXTERNAL FUNCTION depends on AWS's "[Object Storage](https://s3.console.aws.amazon.com)" and "[Lambda Functions](https://console.aws.amazon.com/lambda/home)" services. Ensure these services are activated.
|
|
254
|
+
* For China region, use the [Beijing console](https://cn-north-1.console.amazonaws.cn); for international regions, use the appropriate regional console.
|
|
255
|
+
|
|
256
|
+
* Step 1: Activate Lambda and S3 services.
|
|
257
|
+
* Go to the [Lambda Console](https://console.aws.amazon.com/lambda) and [S3 Console](https://s3.console.aws.amazon.com) and confirm the services are activated.
|
|
258
|
+
|
|
259
|
+
* Step 2: Create an S3 storage bucket.
|
|
260
|
+
* Go to [S3 Console](https://s3.console.aws.amazon.com) → Create bucket (same region as Lambda, e.g., `ap-southeast-1`).
|
|
261
|
+
* Record the Bucket name—it will be needed in the SQL later.
|
|
262
|
+
|
|
263
|
+
* Step 3: Create an IAM user and get an AccessKey.
|
|
264
|
+
* Go to [IAM Users](https://console.aws.amazon.com/iam) → Create user:
|
|
265
|
+
* Any username (e.g., `qiliang-udf`); do not check "Provide user access to the AWS Management Console"
|
|
266
|
+
* Attach policy directly: search and select `AmazonS3FullAccess`
|
|
267
|
+
* After creation, go to the user → **Security credentials** → **Create access key**
|
|
268
|
+
* Select **Command Line Interface (CLI)** → Create → Save the **Access Key ID** and **Secret Access Key**
|
|
269
|
+
|
|
270
|
+
* Step 4: Create IAM permission policy.
|
|
271
|
+
* Log in to the AWS platform, go to the **Identity and Access Management (IAM)** product console.
|
|
272
|
+
* In the left navigation bar go to **Policies**, select **Create policy** → **JSON**, paste the following policy (replace `<bucket>` with the Bucket name from Step 2):
|
|
273
|
+
|
|
274
|
+
```json
|
|
275
|
+
{
|
|
276
|
+
"Version": "2012-10-17",
|
|
277
|
+
"Statement": [
|
|
278
|
+
{
|
|
279
|
+
"Effect": "Allow",
|
|
280
|
+
"Action": [
|
|
281
|
+
"s3:GetObject",
|
|
282
|
+
"s3:GetObjectVersion",
|
|
283
|
+
"s3:PutObject",
|
|
284
|
+
"s3:ListBucket"
|
|
285
|
+
],
|
|
286
|
+
"Resource": [
|
|
287
|
+
"arn:aws:s3:::<bucket>",
|
|
288
|
+
"arn:aws:s3:::<bucket>/*"
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"Effect": "Allow",
|
|
293
|
+
"Action": "lambda:*",
|
|
294
|
+
"Resource": "*"
|
|
295
|
+
}
|
|
296
|
+
]
|
|
297
|
+
}
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
> ⚠️ S3 must include `PutObject` (the platform needs to write code packages to S3). Lambda uses `lambda:*` to avoid missing operations by listing them individually.
|
|
301
|
+
|
|
302
|
+
* Click **Next**, set the policy name to `LakehouseAccess`, click **Create policy**.
|
|
303
|
+
|
|
304
|
+
* Step 5: Create IAM Role.
|
|
305
|
+
* Go to [IAM Roles](https://console.aws.amazon.com/iam/home#/roles) → Create role:
|
|
306
|
+
* Trusted entity type: **AWS service** → Use case: **Lambda**
|
|
307
|
+
* Permission policies: check the newly created `LakehouseAccess` and the AWS built-in `AWSLambdaBasicExecutionRole`
|
|
308
|
+
* Click **Next**, set the role name to `Lambda-S3-Role`, click **Create role**
|
|
309
|
+
* After successful creation, go to the role detail page and copy the **Role ARN**: `arn:aws:iam::<your_AWS_account_id>:role/Lambda-S3-Role`
|
|
310
|
+
|
|
311
|
+
* Step 6: Edit the trust policy (add Singdata account's AssumeRole permission).
|
|
312
|
+
* Role detail page → **Trust relationships** → **Edit trust policy**, add both the Lambda service and the Singdata account:
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"Version": "2012-10-17",
|
|
317
|
+
"Statement": [
|
|
318
|
+
{
|
|
319
|
+
"Effect": "Allow",
|
|
320
|
+
"Principal": {
|
|
321
|
+
"Service": "lambda.amazonaws.com"
|
|
322
|
+
},
|
|
323
|
+
"Action": "sts:AssumeRole"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
"Effect": "Allow",
|
|
327
|
+
"Principal": {
|
|
328
|
+
"AWS": "arn:aws:iam::014617434350:root"
|
|
329
|
+
},
|
|
330
|
+
"Action": "sts:AssumeRole"
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
> ⚠️ `014617434350` is Singdata's international AWS account; China site uses `028022243208`. Missing Singdata account's trust relationship will result in `AccessDenied: sts:AssumeRole`.
|
|
337
|
+
|
|
338
|
+
> ⚠️ This is the **trust policy** (Trust relationships), not the permissions policy (Permissions). Do not paste the permissions policy JSON here—they are on different pages.
|
|
339
|
+
|
|
340
|
+
* Step 7: Execute SQL to create API CONNECTION.
|
|
341
|
+
|
|
342
|
+
```sql
|
|
343
|
+
CREATE API CONNECTION udf_noah
|
|
344
|
+
TYPE CLOUD_FUNCTION
|
|
345
|
+
PROVIDER = 'aws'
|
|
346
|
+
REGION = 'ap-southeast-1'
|
|
347
|
+
ROLE_ARN = 'arn:aws:iam::928925945197:role/Lambda-S3-Role'
|
|
348
|
+
CODE_BUCKET = 'qiliang-udf-code';
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
> International region endpoint format is `s3.<region>.amazonaws.com`; China region is `s3.<region>.amazonaws.com.cn`.
|
|
352
|
+
|
|
353
|
+
* Step 8 (optional): Configure External ID.
|
|
354
|
+
After the API CONNECTION is successfully created, run the following to get the External ID:
|
|
355
|
+
|
|
356
|
+
```sql
|
|
357
|
+
DESC CONNECTION udf_noah;
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+

|
|
361
|
+
|
|
362
|
+
Go back to **IAM Roles** → `Lambda-S3-Role` → **Trust relationships** → **Edit trust policy**, add a `Condition` to the Singdata account's `Statement`:
|
|
363
|
+
|
|
364
|
+
```json
|
|
365
|
+
{
|
|
366
|
+
"Effect": "Allow",
|
|
367
|
+
"Principal": {
|
|
368
|
+
"AWS": "arn:aws:iam::014617434350:root"
|
|
369
|
+
},
|
|
370
|
+
"Action": "sts:AssumeRole",
|
|
371
|
+
"Condition": {
|
|
372
|
+
"StringEquals": {
|
|
373
|
+
"sts:ExternalId": "ExternalId value from DESC result"
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
### Next Steps:
|
|
351
380
|
|
|
352
|
-
|
|
381
|
+
After completing the API CONNECTION creation, you can proceed to create external functions, supporting Python and Java scripts to process data in Singdata Lakehouse. See: [Create External Function](create_external_function.md)
|