@clickzetta/cz-cli-darwin-x64 0.5.16 → 0.5.18

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.
Files changed (243) hide show
  1. package/bin/cz-cli +0 -0
  2. package/bin/skills/lakehouse-doc-en/SKILL.md +6 -11
  3. package/bin/skills/lakehouse-doc-en/references/AIGateway.md +58 -13
  4. package/bin/skills/lakehouse-doc-en/references/Computation.md +1 -1
  5. package/bin/skills/lakehouse-doc-en/references/DataSource_Amazon_DocumentDB.md +3 -1
  6. package/bin/skills/lakehouse-doc-en/references/Foreach.md +14 -14
  7. package/bin/skills/lakehouse-doc-en/references/JDBC-Driver.md +0 -1
  8. package/bin/skills/lakehouse-doc-en/references/LakehouseAI-overview.md +21 -8
  9. package/bin/skills/lakehouse-doc-en/references/LakehouseDataGPT-tour.md +4 -9
  10. package/bin/skills/lakehouse-doc-en/references/LakehouseStudio-tour.md +14 -19
  11. package/bin/skills/lakehouse-doc-en/references/Lakehouse_Zilliz_MakeDataReadyforBIandAI.md +1 -1
  12. package/bin/skills/lakehouse-doc-en/references/Logstash.md +3 -3
  13. package/bin/skills/lakehouse-doc-en/references/Migrate_Spark_DataEngineeringBestPractices_Project_to_Lakehouse.md +1 -1
  14. package/bin/skills/lakehouse-doc-en/references/Notebook.md +17 -17
  15. package/bin/skills/lakehouse-doc-en/references/RemoteFunction-as-udf.md +14 -14
  16. package/bin/skills/lakehouse-doc-en/references/SQL_External_Catalog_Guide.md +1 -9
  17. package/bin/skills/lakehouse-doc-en/references/SUMMARY.md +59 -29
  18. package/bin/skills/lakehouse-doc-en/references/WINDOWFUNCTION.md +99 -57
  19. package/bin/skills/lakehouse-doc-en/references/Zettapark_Data_Engineering_Demo.md +1 -1
  20. package/bin/skills/lakehouse-doc-en/references/access-control-configuration.md +1 -8
  21. package/bin/skills/lakehouse-doc-en/references/aigw-2026-2-5-1.0.md +16 -0
  22. package/bin/skills/lakehouse-doc-en/references/aigw-2026-3-29-1.0.2.md +14 -0
  23. package/bin/skills/lakehouse-doc-en/references/aigw-2026-3-8-1.0.1.md +16 -0
  24. package/bin/skills/lakehouse-doc-en/references/aigw-2026-4-28-1.1.md +29 -0
  25. package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-12-1.1.1.md +18 -0
  26. package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-15-1.2.md +9 -0
  27. package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-21-1.3.md +9 -0
  28. package/bin/skills/lakehouse-doc-en/references/aigw-2026-5-28-1.4.md +10 -0
  29. package/bin/skills/lakehouse-doc-en/references/aigw-2026-6-3-1.5.md +9 -0
  30. package/bin/skills/lakehouse-doc-en/references/alicloud-arn-externalid.md +0 -5
  31. package/bin/skills/lakehouse-doc-en/references/answer-accuracy-improve.md +120 -103
  32. package/bin/skills/lakehouse-doc-en/references/application-list.md +1 -3
  33. package/bin/skills/lakehouse-doc-en/references/approval-list.md +16 -17
  34. package/bin/skills/lakehouse-doc-en/references/batch-load-parquet-file-into-lakehouse.md +1 -1
  35. package/bin/skills/lakehouse-doc-en/references/batch_sync.md +9 -9
  36. package/bin/skills/lakehouse-doc-en/references/batch_sync_Sop.md +2 -2
  37. package/bin/skills/lakehouse-doc-en/references/batchloadparquetfileintoLakehouse.md +1 -1
  38. package/bin/skills/lakehouse-doc-en/references/bulkloadv1-python-sdk.md +3 -3
  39. package/bin/skills/lakehouse-doc-en/references/chart-auto-refresh-guide.md +12 -6
  40. package/bin/skills/lakehouse-doc-en/references/clickzetta-sample-data.md +3 -3
  41. package/bin/skills/lakehouse-doc-en/references/code_approval.md +1 -5
  42. package/bin/skills/lakehouse-doc-en/references/composite_task.md +31 -42
  43. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_environment_and_data_generate.md +6 -9
  44. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_javasdk_bulkload_realtime.md +4 -10
  45. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_kafka_realtime_sync.md +1 -10
  46. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_local_file_into_table_by_studio.md +0 -6
  47. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_batchload_public_network.md +0 -5
  48. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_python_node.md +2 -7
  49. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_realtime_cdc_public_network.md +13 -18
  50. package/bin/skills/lakehouse-doc-en/references/comprehensive_guide_to_ingesting_studio_sql_insert.md +0 -1
  51. package/bin/skills/lakehouse-doc-en/references/concepts.md +1 -1
  52. package/bin/skills/lakehouse-doc-en/references/config-datasource.md +5 -7
  53. package/bin/skills/lakehouse-doc-en/references/connect-with-cli.md +116 -72
  54. package/bin/skills/lakehouse-doc-en/references/connect-with-cz-cli.md +151 -0
  55. package/bin/skills/lakehouse-doc-en/references/continue-job.md +9 -17
  56. package/bin/skills/lakehouse-doc-en/references/create-api-connection.md +315 -286
  57. package/bin/skills/lakehouse-doc-en/references/create-catalog-connection.md +1 -0
  58. package/bin/skills/lakehouse-doc-en/references/create-dynamic-table.md +4 -4
  59. package/bin/skills/lakehouse-doc-en/references/create-external-catalog.md +85 -22
  60. package/bin/skills/lakehouse-doc-en/references/create-table-ddl.md +45 -0
  61. package/bin/skills/lakehouse-doc-en/references/creating_alicloud_privatelinkendpoint.md +4 -6
  62. package/bin/skills/lakehouse-doc-en/references/creating_alicloud_privatelinkservice.md +4 -7
  63. package/bin/skills/lakehouse-doc-en/references/creating_tencentcloud_privatelinkendpoint.md +2 -7
  64. package/bin/skills/lakehouse-doc-en/references/creating_tencentcloud_privatelinkservice.md +1 -5
  65. package/bin/skills/lakehouse-doc-en/references/cz-cli-agent.md +15 -10
  66. package/bin/skills/lakehouse-doc-en/references/cz-cli-datasource.md +0 -8
  67. package/bin/skills/lakehouse-doc-en/references/cz-cli-sql.md +2 -45
  68. package/bin/skills/lakehouse-doc-en/references/cz-cli.md +53 -42
  69. package/bin/skills/lakehouse-doc-en/references/dashboard-version-management-guide.md +12 -4
  70. package/bin/skills/lakehouse-doc-en/references/data-integration-intro.md +1 -1
  71. package/bin/skills/lakehouse-doc-en/references/data-integration.md +29 -27
  72. package/bin/skills/lakehouse-doc-en/references/data-load-summary.md +3 -3
  73. package/bin/skills/lakehouse-doc-en/references/data-quality.md +25 -25
  74. package/bin/skills/lakehouse-doc-en/references/data-sharing.md +31 -54
  75. package/bin/skills/lakehouse-doc-en/references/data-sources.md +45 -45
  76. package/bin/skills/lakehouse-doc-en/references/data_catalog.md +23 -25
  77. package/bin/skills/lakehouse-doc-en/references/data_privacy.md +5 -2
  78. package/bin/skills/lakehouse-doc-en/references/data_sharing_between_accounts_guide.md +0 -4
  79. package/bin/skills/lakehouse-doc-en/references/data_visualization.md +4 -15
  80. package/bin/skills/lakehouse-doc-en/references/dataagent.md +39 -7
  81. package/bin/skills/lakehouse-doc-en/references/databricks-delta-to-lakehouse-migration.md +168 -0
  82. package/bin/skills/lakehouse-doc-en/references/databricks-dlt-to-lakehouse-migration.md +331 -0
  83. package/bin/skills/lakehouse-doc-en/references/databricks-external-catalog-practice.md +367 -0
  84. package/bin/skills/lakehouse-doc-en/references/databricks-jobs-to-studio-migration.md +199 -0
  85. package/bin/skills/lakehouse-doc-en/references/databricks-notebook-to-studio-migration.md +350 -0
  86. package/bin/skills/lakehouse-doc-en/references/databricks-uc-governance-to-lakehouse-migration.md +327 -0
  87. package/bin/skills/lakehouse-doc-en/references/datagpt-model-config.md +34 -0
  88. package/bin/skills/lakehouse-doc-en/references/datagpt_data_source.md +50 -37
  89. package/bin/skills/lakehouse-doc-en/references/datagpt_introduction.md +55 -79
  90. package/bin/skills/lakehouse-doc-en/references/datagpt_quickstart.md +50 -64
  91. package/bin/skills/lakehouse-doc-en/references/datalake-acceleration.md +75 -2
  92. package/bin/skills/lakehouse-doc-en/references/dbt-databricks-to-clickzetta-migration.md +242 -0
  93. package/bin/skills/lakehouse-doc-en/references/dynamic-mask.md +30 -30
  94. package/bin/skills/lakehouse-doc-en/references/dynamic-table-bestpractice.md +1 -1
  95. package/bin/skills/lakehouse-doc-en/references/dynamic-table-introduce.md +1 -1
  96. package/bin/skills/lakehouse-doc-en/references/dynamic_table_summary.md +1 -1
  97. package/bin/skills/lakehouse-doc-en/references/eco_integration/streamlit.md +1 -1
  98. package/bin/skills/lakehouse-doc-en/references/eco_integration/superset.md +1 -1
  99. package/bin/skills/lakehouse-doc-en/references/ecosystem-all.md +1 -3
  100. package/bin/skills/lakehouse-doc-en/references/ecosystem.md +145 -0
  101. package/bin/skills/lakehouse-doc-en/references/external-catalog-summary.md +33 -38
  102. package/bin/skills/lakehouse-doc-en/references/external-function-combo-practice.md +466 -0
  103. package/bin/skills/lakehouse-doc-en/references/f6fc6447ee.md +7 -9
  104. package/bin/skills/lakehouse-doc-en/references/federation-query.md +56 -6
  105. package/bin/skills/lakehouse-doc-en/references/finebi-mysql.md +2 -0
  106. package/bin/skills/lakehouse-doc-en/references/get-started-with-sample-data.md +10 -11
  107. package/bin/skills/lakehouse-doc-en/references/gitfolder.md +2 -3
  108. package/bin/skills/lakehouse-doc-en/references/grant-privileges.md +2 -0
  109. package/bin/skills/lakehouse-doc-en/references/iceberg-rest-catalog-databricks.md +166 -0
  110. package/bin/skills/lakehouse-doc-en/references/ide.md +1 -1
  111. package/bin/skills/lakehouse-doc-en/references/if_else_task.md +59 -57
  112. package/bin/skills/lakehouse-doc-en/references/input_output.md +10 -7
  113. package/bin/skills/lakehouse-doc-en/references/jobprofile-bestpractices.md +60 -64
  114. package/bin/skills/lakehouse-doc-en/references/kafka-connection.md +0 -1
  115. package/bin/skills/lakehouse-doc-en/references/key-concepts.md +146 -117
  116. package/bin/skills/lakehouse-doc-en/references/lakehouse-ai-gateway-cz-cli.md +317 -0
  117. package/bin/skills/lakehouse-doc-en/references/lakehouse-ai-sql-analysis.md +345 -0
  118. package/bin/skills/lakehouse-doc-en/references/lakehouse-dqc-guide.md +300 -0
  119. package/bin/skills/lakehouse-doc-en/references/lakehouse-medallion-sql-dt-guide.md +543 -0
  120. package/bin/skills/lakehouse-doc-en/references/lakehouse-multi-cloud-acceleration.md +274 -0
  121. package/bin/skills/lakehouse-doc-en/references/lakehouse-multimodal-ai-pipeline.md +198 -0
  122. package/bin/skills/lakehouse-doc-en/references/lakehouse-quick-experience_guide.md +49 -52
  123. package/bin/skills/lakehouse-doc-en/references/lakehouse-volume-pipe-acceleration-guide.md +380 -0
  124. package/bin/skills/lakehouse-doc-en/references/langchain-plug-installation.md +1 -1
  125. package/bin/skills/lakehouse-doc-en/references/management.md +4 -9
  126. package/bin/skills/lakehouse-doc-en/references/medallion-lakehouse-from-scratch.md +2 -1
  127. package/bin/skills/lakehouse-doc-en/references/metrics_answer_build.md +58 -21
  128. package/bin/skills/lakehouse-doc-en/references/migrate-spark-data-engineering-best-practices-to-lakehouse.md +1 -1
  129. package/bin/skills/lakehouse-doc-en/references/mindsdb.md +1 -1
  130. package/bin/skills/lakehouse-doc-en/references/monitoring_and_alerting.md +65 -60
  131. package/bin/skills/lakehouse-doc-en/references/monitoring_item_specification.md +33 -33
  132. package/bin/skills/lakehouse-doc-en/references/multitable_batch_sync.md +16 -16
  133. package/bin/skills/lakehouse-doc-en/references/multitable_realtime_sync.md +65 -72
  134. package/bin/skills/lakehouse-doc-en/references/multitable_realtime_sync_sop.md +54 -52
  135. package/bin/skills/lakehouse-doc-en/references/navicat-mysql.md +2 -0
  136. package/bin/skills/lakehouse-doc-en/references/om-dynamic-table.md +71 -66
  137. package/bin/skills/lakehouse-doc-en/references/om-vcluster.md +2 -0
  138. package/bin/skills/lakehouse-doc-en/references/open-api-create-session.md +79 -0
  139. package/bin/skills/lakehouse-doc-en/references/open-api-generate-auth-token.md +63 -0
  140. package/bin/skills/lakehouse-doc-en/references/open-api-overview.md +96 -0
  141. package/bin/skills/lakehouse-doc-en/references/open-api-quick-start.md +286 -0
  142. package/bin/skills/lakehouse-doc-en/references/open-api-response-guide.md +264 -0
  143. package/bin/skills/lakehouse-doc-en/references/open-api-safe-question-poll.md +201 -0
  144. package/bin/skills/lakehouse-doc-en/references/open-api-text2insight-query.md +99 -0
  145. package/bin/skills/lakehouse-doc-en/references/open-api-text2insight-stop.md +74 -0
  146. package/bin/skills/lakehouse-doc-en/references/overview.md +6 -7
  147. package/bin/skills/lakehouse-doc-en/references/permission-application.md +5 -5
  148. package/bin/skills/lakehouse-doc-en/references/pipe-introduction.md +1 -0
  149. package/bin/skills/lakehouse-doc-en/references/pipe-kafka-table-stream.md +72 -70
  150. package/bin/skills/lakehouse-doc-en/references/pipe-kafka.md +105 -110
  151. package/bin/skills/lakehouse-doc-en/references/pipe-overview.md +40 -40
  152. package/bin/skills/lakehouse-doc-en/references/pipe-storage-object.md +43 -48
  153. package/bin/skills/lakehouse-doc-en/references/pipe-summary.md +14 -4
  154. package/bin/skills/lakehouse-doc-en/references/pipe-syntax.md +58 -151
  155. package/bin/skills/lakehouse-doc-en/references/practice_python_task.md +4 -4
  156. package/bin/skills/lakehouse-doc-en/references/pricing-ai-gateway.md +181 -0
  157. package/bin/skills/lakehouse-doc-en/references/pricing-lakehouse.md +316 -0
  158. package/bin/skills/lakehouse-doc-en/references/pricing.md +44 -288
  159. package/bin/skills/lakehouse-doc-en/references/private-link-general.md +0 -2
  160. package/bin/skills/lakehouse-doc-en/references/pyspark-to-zettapark-migration-f1.md +1 -1
  161. package/bin/skills/lakehouse-doc-en/references/python-igs.md +7 -3
  162. package/bin/skills/lakehouse-doc-en/references/python-sample-put-github-rt-events.md +1 -1
  163. package/bin/skills/lakehouse-doc-en/references/python-task.md +1 -1
  164. package/bin/skills/lakehouse-doc-en/references/python_reference/connector.md +3 -3
  165. package/bin/skills/lakehouse-doc-en/references/python_reference/connector_advanced.md +2 -2
  166. package/bin/skills/lakehouse-doc-en/references/python_reference/connector_examples.md +2 -2
  167. package/bin/skills/lakehouse-doc-en/references/python_sdk_guide.md +1 -1
  168. package/bin/skills/lakehouse-doc-en/references/python_shell_datasource.md +11 -9
  169. package/bin/skills/lakehouse-doc-en/references/quick_start_batch_sync_data.md +9 -18
  170. package/bin/skills/lakehouse-doc-en/references/quick_start_bi_analysis.md +8 -25
  171. package/bin/skills/lakehouse-doc-en/references/quick_start_create_workspace.md +4 -6
  172. package/bin/skills/lakehouse-doc-en/references/quick_start_data_quality.md +8 -8
  173. package/bin/skills/lakehouse-doc-en/references/quick_start_etl.md +16 -20
  174. package/bin/skills/lakehouse-doc-en/references/quick_start_monitoring_and_alerting.md +10 -18
  175. package/bin/skills/lakehouse-doc-en/references/quick_start_sql_query.md +7 -10
  176. package/bin/skills/lakehouse-doc-en/references/quick_start_upload_data.md +5 -7
  177. package/bin/skills/lakehouse-doc-en/references/quick_start_user_management.md +8 -8
  178. package/bin/skills/lakehouse-doc-en/references/quick_start_workspace.md +0 -5
  179. package/bin/skills/lakehouse-doc-en/references/quick_start_workspace_user.md +8 -8
  180. package/bin/skills/lakehouse-doc-en/references/quickstart.md +69 -56
  181. package/bin/skills/lakehouse-doc-en/references/quickstart_datashare_between_companies.md +0 -5
  182. package/bin/skills/lakehouse-doc-en/references/quickstart_envirment_for_team.md +0 -24
  183. package/bin/skills/lakehouse-doc-en/references/realtime-pipeline-selection-guide.md +1 -2
  184. package/bin/skills/lakehouse-doc-en/references/realtime-sales-dashboard-with-dynamic-table.md +3 -3
  185. package/bin/skills/lakehouse-doc-en/references/realtime_sync.md +0 -1
  186. package/bin/skills/lakehouse-doc-en/references/release-note-2026-05-19.md +5 -3
  187. package/bin/skills/lakehouse-doc-en/references/revoke-privileges.md +3 -1
  188. package/bin/skills/lakehouse-doc-en/references/roles.md +2 -3
  189. package/bin/skills/lakehouse-doc-en/references/row-filter.md +165 -0
  190. package/bin/skills/lakehouse-doc-en/references/row_level_permission.md +30 -19
  191. package/bin/skills/lakehouse-doc-en/references/scheduled_task.md +28 -21
  192. package/bin/skills/lakehouse-doc-en/references/security_overview.md +99 -21
  193. package/bin/skills/lakehouse-doc-en/references/set-command.md +1 -1
  194. package/bin/skills/lakehouse-doc-en/references/setup.md +13 -15
  195. package/bin/skills/lakehouse-doc-en/references/show-grants.md +1 -1
  196. package/bin/skills/lakehouse-doc-en/references/snowflake-dynamic-tables-to-lakehouse.md +2 -2
  197. package/bin/skills/lakehouse-doc-en/references/spark-connector-summary.md +1 -1
  198. package/bin/skills/lakehouse-doc-en/references/sql_functions/context_functions/current_vcluster.md +1 -1
  199. package/bin/skills/lakehouse-doc-en/references/sso-configuration.md +2 -2
  200. package/bin/skills/lakehouse-doc-en/references/streaming_pipeline_with_dynamic_table.md +0 -1
  201. package/bin/skills/lakehouse-doc-en/references/studio-incremental-sync-practice.md +27 -23
  202. package/bin/skills/lakehouse-doc-en/references/studio-shell-task.md +1 -1
  203. package/bin/skills/lakehouse-doc-en/references/supported-cloud-platforms.md +32 -0
  204. package/bin/skills/lakehouse-doc-en/references/table_rendering.md +18 -12
  205. package/bin/skills/lakehouse-doc-en/references/task-develop.md +89 -91
  206. package/bin/skills/lakehouse-doc-en/references/task_development.md +19 -17
  207. package/bin/skills/lakehouse-doc-en/references/task_group.md +16 -14
  208. package/bin/skills/lakehouse-doc-en/references/task_instance.md +21 -21
  209. package/bin/skills/lakehouse-doc-en/references/task_param.md +38 -35
  210. package/bin/skills/lakehouse-doc-en/references/task_param_reference.md +81 -79
  211. package/bin/skills/lakehouse-doc-en/references/task_scheduling_dependency.md +20 -21
  212. package/bin/skills/lakehouse-doc-en/references/tencentcloud_arn_and_externalid.md +1 -5
  213. package/bin/skills/lakehouse-doc-en/references/trial-account-quotas-and-limits.md +1 -3
  214. package/bin/skills/lakehouse-doc-en/references/tutorial_connect_to_lakehouse.md +69 -0
  215. package/bin/skills/lakehouse-doc-en/references/tutorials.md +4 -1
  216. package/bin/skills/lakehouse-doc-en/references/unique-key.md +167 -0
  217. package/bin/skills/lakehouse-doc-en/references/usageandbillingview.md +138 -0
  218. package/bin/skills/lakehouse-doc-en/references/use-dbt-dev.md +3 -3
  219. package/bin/skills/lakehouse-doc-en/references/use-java-sdk-realtime-uploaddata.md +1 -1
  220. package/bin/skills/lakehouse-doc-en/references/use-java-sdk-upload-data-local.md +3 -3
  221. package/bin/skills/lakehouse-doc-en/references/use-models.md +128 -0
  222. package/bin/skills/lakehouse-doc-en/references/use-mysql-client.md +81 -81
  223. package/bin/skills/lakehouse-doc-en/references/use-python-sdk-upload-data.md +10 -12
  224. package/bin/skills/lakehouse-doc-en/references/user-identification.md +2 -3
  225. package/bin/skills/lakehouse-doc-en/references/user_permission_grand_guide.md +1 -1
  226. package/bin/skills/lakehouse-doc-en/references/using-udf-in-dynamic-table.md +1 -1
  227. package/bin/skills/lakehouse-doc-en/references/vc_cache.md +18 -22
  228. package/bin/skills/lakehouse-doc-en/references/vcluster_size_description.md +33 -31
  229. package/bin/skills/lakehouse-doc-en/references/virtual-cluster.md +43 -45
  230. package/bin/skills/lakehouse-doc-en/references/web-job-history.md +94 -108
  231. package/bin/skills/lakehouse-doc-en/references/web_search.md +16 -7
  232. package/bin/skills/lakehouse-doc-en/references/zettapark-data-engineering-demo.md +1 -1
  233. package/bin/skills/lakehouse-doc-en/references/zettapark-dataframe-guide.md +144 -70
  234. package/bin/skills/lakehouse-doc-en/references/zettapark-dynamic-table-guide.md +2 -2
  235. package/bin/skills/lakehouse-doc-en/references/zettapark-etl-guide.md +73 -33
  236. package/bin/skills/lakehouse-doc-en/references/zettapark-feature-engineering.md +2 -2
  237. package/bin/skills/lakehouse-doc-en/references/zettapark-functions-guide.md +75 -46
  238. package/bin/skills/lakehouse-doc-en/references/zettapark-quick-start.md +2 -2
  239. package/bin/skills/lakehouse-doc-en/references/zettapark-stream-guide.md +4 -4
  240. package/bin/skills/lakehouse-doc-en/references/zettapark-volume-guide.md +93 -29
  241. package/package.json +1 -1
  242. package/bin/skills/lakehouse-doc-en/references/CLAUDE.md +0 -606
  243. package/bin/skills/lakehouse-doc-en/references/modelprice.md +0 -155
@@ -1,104 +1,90 @@
1
1
  # Create API CONNECTION
2
2
 
3
- This type of CONNECTION is mainly used to store and protect the authentication information of third-party application services. Through API Connection, Lakehouse can securely interact with these services via API calls. Currently, the external services supported by API Connection include Alibaba Cloud Function Compute (FC) and Tencent Cloud Function Service.
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 CLOUD_FUNCTION
11
- PROVIDER=''
12
- REGION=''
13
- ROLE_ARN=''
14
- NAMESPCE=''
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
- ![](.topwrite/assets/image_1740368445142.png)
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
- * `connection_name`: The name of the connection to be created.
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
- ### Supported Data Source Types and Parameters
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
- The following are the parameters required for the `CLOUD_FUNCTION` type data source:
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
+ ![](.topwrite/assets/image_1735616872087.png)
43
30
 
44
- | Parameter Name | Description | Example Value | Required |
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 mainly used for creating EXTERNAL FUNCTION. The usage process of EXTERNAL FUNCTION is as follows:
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
- * Users activate cloud function computing services (such as Alibaba Cloud Function Compute FC) and object storage services.
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
- ### Example 1: Creating API CONNECTION on Alibaba Cloud
46
+ ### Creating API CONNECTION on Alibaba Cloud
65
47
 
66
48
  * **Environment Preparation**
67
- UDF relies on Alibaba Cloud's "[Object Storage](https://oss.console.aliyun.com/overview)" and "[Function Compute](https://fcnext.console.aliyun.com/overview)" services. Please ensure that the relevant services are activated.
68
-
69
- * step1: Users activate cloud function computing services (such as Alibaba Cloud Function Compute FC) and object storage services.
70
-
71
- * step2. Alibaba Cloud operations: Create a permission policy (CzUdfOssAccess) in the Alibaba Cloud RAM console: Note: Users need to have RAM permissions.
72
- * Access the Alibaba Cloud Resource Access Management (RAM) [product console](https://ram.console.aliyun.com/policies).
73
- * In the left navigation bar, **Permission Management** -> **Permission Policies**, search for **AliyunFCFullAccess** in the permission control interface -> Edit the **AliyunFCFullAccess** permission policy to add the following "acs\*\*:**Service**": "**fc.aliyuncs.com**"\*\* part.
74
- ```JSON
75
- {
76
- "Version": "1",
77
- "Statement": [
78
- {
79
- "Action": "fc:*",
80
- "Resource": "*",
81
- "Effect": "Allow"
82
- },
83
- {
84
- "Action": "ram:PassRole",
85
- "Resource": "*",
86
- "Effect": "Allow",
87
- "Condition": {
88
- "StringEquals": {
89
- "acs:Service": "fc.aliyuncs.com"
90
- }
91
- }
92
- }
93
- ]
94
- }
95
- ```
96
- * step3: Create a permission policy (CzUdfOssAccess) in the Alibaba Cloud RAM console: Note: The user needs to have RAM permissions
97
-
98
- * Access the Alibaba Cloud Resource Access Management (RAM) product console
99
- * In the left navigation bar, go to **Permission Management** -> **Permission Policies**, and select **Create Permission Policy** in the permission control interface
100
- * On the **Create Permission Policy** page, select the **Script Editor** tab, and replace `[bucket_name_1|2|3]` below with the actual OSS bucket names. Note: According to Alibaba Cloud OSS conventions, the same bucket needs to have two Resource entries: `"acs:oss:*:*:bucket_name_1"` and `"acs:oss:*:*:bucket_name_1/*"` must both exist to achieve the authorization effect:
101
- ```JSON
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
- * step4 Alibaba Cloud Console: Create a role in Alibaba Cloud RAM (e.g., CzUDFRole):
126
- * In the RAM console, navigate to **Identity Management** -> **Roles** on the left sidebar, and click **Create Role**
127
- * On the **Create Role** page, select the type as **Alibaba Cloud Account**, fill in the custom **Role Name** (e.g., CzUDFRole), select **Other Cloud Account** in **Select Trusted Cloud Account**, and enter: 1384322691904283 (Singdata Lakehouse Shanghai's cloud main account), then click **Complete**
128
- * After creation, click **Authorize Role**:
129
- * In **System Policies**, grant the **AliyunFCFullAccess** policy to the role CzUDFRole
130
- * In **Custom Policies**, grant the newly created policy (**CzUdfOssAccess**) to the role
131
-
132
- * step5: After creation, click **Authorize Role**: In **Custom Policies**, grant the newly created policy (CzUdfOssAccess) to the role. In the role CzUDFRole details page, obtain the RoleARN information of the role: `'acs:ram::1222808864xxxxxxx:role/czudfrole'`![](.topwrite/assets/image_1740368644886.png)
133
-
134
- * step6: Fill the above role\_arn into the syntax parameter, and create an Alibaba Cloud Function Compute connection
135
- ```SQL
136
- CREATE API CONNECTION my_funciton_connection
137
- TYPE CLOUD_FUNCTION
138
- PROVIDER='aliyun'
139
- REGION='cn-hangzhou'
140
- ROLE_ARN='acs:ram::1757168149572678:role/czudfrole'
141
- CODE_BUCKET='function-compute-my1';
142
- ```
143
- * step7: desc connection to obtain external ID information: In this example, the external ID is: `VW9UaGwYENBQ7cFp`
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
- ![](.topwrite/assets/image_1735638011131.png)
148
- * In Alibaba Cloud RAM -> Roles -> Trust Policy, modify the **trust policy** of CzUDFRole:
149
- ```Python
136
+
137
+ ![](.topwrite/assets/image_1735638011131.png)
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": "O0lQUogDJajHqnAQ"
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
- ### Example 2: Create API CONNECTION on Tencent Cloud
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
- UDF relies 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. Please ensure that the relevant services are activated.
174
-
175
- * Object Storage: Required in the Lakehouse deployment region (e.g., ap-shanghai) to store UDF base code;
176
- * Cloud Functions: After activating the **Cloud Functions** service, it is recommended to manually create a function using the template creation feature, preferably using templates with the WebFunc tag such as the Flask framework template. During this process, the Tencent Cloud console will guide users through some initial configurations, such as activating the log service (CLS) and other dependent services, creating necessary Access Control (CAM) roles, and granting necessary Access Control (CAM) permissions.
177
- * **step1**: Users activate Tencent Cloud's cloud function computing service. The cloud function region should be consistent with the Lakehouse service region.
178
- ![](.topwrite/assets/image_1740368721078.png)
179
- * **step2**: Data creation permission policy (LakehouseAccess):
180
-
181
- * Log in to Tencent Cloud and go to the **Access Management** [product console](https://console.cloud.tencent.com/cam/policy)
182
- * In the **Access Management** page, navigate to **Policies** on the left sidebar, and in the permission control interface, select **Create Custom Policy** -> **Create by Policy Generator** -> **Visual Policy Generator**.
183
- * In the **Visual Policy Generator** tab, **Service**: Select **Cloud Functions**; **Action**: Select **All Actions** (you can make more granular selections based on actual needs); **Resource**: Select **All Resources** or **Specific Resources** as needed. In this case, select specific resources, use namespace authorization as shown below, click the edit button, select the region activated in step1, the resource can be * or a specified namespace, in this case, the namespace from step1: default. As shown in the red-marked area of the cloud function in Figure 2![](.topwrite/assets/image_1740369082106.png)
184
- ![](.topwrite/assets/image_1740368445142.png)
185
- Click to create the policy
186
- * step3: [Create Role](https://console.cloud.tencent.com/cam/role) CzUdfRole
187
- * Create a new role
188
- * Select Tencent Cloud Account
189
- * Select **Other Main Account 100029595716 (Singdata Main Account)**, keep other options as default, and click **Next**
190
- * In the **Configure Role Policy** configuration, authorize the newly created LakehouseAccess custom policy to the current role. Click **Next**, and in **Role Naming**, fill in `LakehouseRole` to complete the creation.
191
- * After successful creation, go to the details page of the role `LakehouseRole` in the role list to get the RoleARN information of the role: `qcs::cam::uin/1000*******:roleName/LakehouseRole`
192
- * Remember the RoleArn, for example: `qcs::cam::uin/1000*******:roleName/LakehouseRole`
193
- * step4: Activate COS and create a new BUCKET
194
- * Create a new bucket to store udf code, the region should be consistent with the Lakehouse service region. The newly created bucket is myfunction as shown below![](.topwrite/assets/image_1740378042671.png)
195
- * Authorize Lakehouse to access the bucket (myfunction)
196
- * Go to the **Access Management** [product console](https://console.cloud.tencent.com/cam/policy). Find the newly created "LakehouseAccess" policy. Select Edit![](.topwrite/assets/image_1740378228008.png)
197
- * Select the Visual Policy Generator. Add permissions![](.topwrite/assets/image_1740378259906.png)
198
- * **Service**: Select **Object Storage (cos)**; **Action**: Select **All Actions** (you can make more granular selections based on actual needs); **Resource**: Select **All Resources** or **Specific Resources** as needed. In this example, select specific resources, which is `myfunction-131xxxxx` in Shanghai.![](.topwrite/assets/image_1740378387729.png)
199
- * step5: Create Connection on the Lakehouse side
200
- \* Execute the following command in Studio or the Lakehouse JDBC client:
201
- `SQL
202
- CREATE API CONNECTION my_funciton_connection
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
+ ![](.topwrite/assets/image_1735616566747.png)
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/xxxx:roleName/CzUDFRole'
207
- NAMESPCE='default'
208
- CODE_BUCKET='myfunction-131xxxx';
209
- `
210
-
211
- * Note: To prevent the ROLE_ARN from being obtained by third parties for unauthorized data access, you can use `EXTERNAL ID` as an additional layer of verification to ensure that access is only allowed when the request contains the preset `EXTERNAL ID`. This means that even if a third party knows some other access information (such as the role ARN), they cannot access the resource without the correct `EXTERNAL ID`.
212
- * During the API Connection process, Lakehouse will generate this EXTERNAL ID, which can be configured into the role verification of the COS account to achieve access control:
213
- ```
214
- -- View EXTERNAL ID
215
- DESC CONNECITON my_funciton_connection ;
216
- ```
217
- ![](.topwrite/assets/image_1740378621626.png)
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
+ ![](.topwrite/assets/image_1735630257317.png)
218
247
 
219
- * Client side: Enter the Tencent Cloud **Access Management** console, **Role** -> **CzUDFRole** -> **Role Carrier** -> **Manage Carrier**, select **Add Account** -> select **Current Main Account**, and fill in the main account ID: `100029595716` (Singdata's Tencent Cloud main account), and check **Enable Verification**, enter the EXTERNAL\_ID from the previous DESC result, click **Confirm** -> **Update**
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
- ### Example 3: Create API CONNECTION on AWS
250
+ ### Creating API CONNECTION on AWS
222
251
 
223
252
  * **Environment Preparation**
224
- UDF relies on Alibaba Cloud's "[Object Storage](https://cn-north-1.console.amazonaws.cn/s3/get-started?region=cn-north-1\&bucketType=general)" and "[Lambda Function](https://cn-north-1.console.amazonaws.cn/lambda/home)" services. Please ensure that the relevant services are activated.
225
-
226
- * step1: User activates Lambda and Object Storage services on the cloud
227
-
228
- * step2: Create permission policy on AWS side (LakehouseAccess):
229
- * Log in to the AWS cloud platform and enter the **Identity and Access Management (IAM)** product console
230
- * In the IAM page's left navigation bar, go to **Account Settings**, in the **Security Token Service (STS)** section, find the **Endpoint** list, locate the region corresponding to the Singdata Lakehouse for the current instance, and if the **STS Status** is not enabled, please enable it.
231
- * In the IAM page's left navigation bar, go to **Policies**, in the **Policies** interface, select **Create Policy**, and choose Json in the policy editor.
232
- * Add the policy to allow Singdata Lakehouse to access the S3 bucket and directory. Below is a sample policy, please replace `<bucket>` with the actual bucket and path prefix name.
233
- ```JSON
234
- {
235
- "Version": "2012-10-17",
236
- "Statement": [
237
- {
238
- "Sid": "VisualEditor0",
239
- "Effect": "Allow",
240
- "Action": [
241
- "lambda:CreateFunction",
242
- "lambda:DeleteProvisionedConcurrencyConfig",
243
- "lambda:GetFunctionConfiguration",
244
- "lambda:ListProvisionedConcurrencyConfigs",
245
- "lambda:GetProvisionedConcurrencyConfig",
246
- "lambda:ListLayers",
247
- "lambda:ListLayerVersions",
248
- "lambda:DeleteFunction",
249
- "lambda:GetAlias",
250
- "lambda:ListCodeSigningConfigs",
251
- "lambda:UpdateFunctionEventInvokeConfig",
252
- "lambda:DeleteFunctionCodeSigningConfig",
253
- "lambda:ListFunctions",
254
- "lambda:GetEventSourceMapping",
255
- "lambda:InvokeFunction",
256
- "lambda:ListAliases",
257
- "lambda:GetFunctionCodeSigningConfig",
258
- "lambda:UpdateAlias",
259
- "lambda:UpdateFunctionCode",
260
- "lambda:ListFunctionEventInvokeConfigs",
261
- "lambda:ListFunctionsByCodeSigningConfig",
262
- "lambda:GetFunctionConcurrency",
263
- "lambda:PutProvisionedConcurrencyConfig",
264
- "lambda:ListEventSourceMappings",
265
- "lambda:PublishVersion",
266
- "lambda:DeleteEventSourceMapping",
267
- "lambda:CreateAlias",
268
- "lambda:ListVersionsByFunction",
269
- "lambda:GetLayerVersion",
270
- "lambda:PublishLayerVersion",
271
- "lambda:InvokeAsync",
272
- "lambda:GetAccountSettings",
273
- "lambda:CreateEventSourceMapping",
274
- "lambda:GetLayerVersionPolicy",
275
- "lambda:PutFunctionConcurrency",
276
- "lambda:DeleteCodeSigningConfig",
277
- "lambda:ListTags",
278
- "lambda:DeleteLayerVersion",
279
- "lambda:PutFunctionEventInvokeConfig",
280
- "lambda:DeleteFunctionEventInvokeConfig",
281
- "lambda:CreateCodeSigningConfig",
282
- "lambda:PutFunctionCodeSigningConfig",
283
- "lambda:UpdateEventSourceMapping",
284
- "lambda:UpdateFunctionCodeSigningConfig",
285
- "lambda:GetFunction",
286
- "lambda:UpdateFunctionConfiguration",
287
- "lambda:UpdateCodeSigningConfig",
288
- "lambda:GetFunctionEventInvokeConfig",
289
- "lambda:DeleteAlias",
290
- "lambda:DeleteFunctionConcurrency",
291
- "lambda:GetCodeSigningConfig",
292
- "lambda:GetPolicy"
293
- ],
294
- "Resource": "*"
295
- },
296
- {
297
- "Sid": "VisualEditor1",
298
- "Effect": "Allow",
299
- "Action": [
300
- "s3:PutObject",
301
- "s3:GetObject",
302
- "s3:DeleteObjectVersion",
303
- "s3:ListBucket",
304
- "s3:DeleteObject",
305
- "s3:GetBucketLocation",
306
- "s3:GetObjectVersion"
307
- ],
308
- "Resource": "arn:aws-cn:s3:::cz-udf-code"
309
- }
310
- ]
311
- }
312
- ```
313
- * Select Next, enter the policy name (e.g., LakehouseAccess) and description (optional)
314
- * Click Create Policy to complete the policy creation
315
-
316
- step3: Create a role on the AWS side (LakehouseVolumeRole):
317
-
318
- * Log in to the AWS cloud platform and go to the **Identity and Access Management (IAM)** product console
319
- * In the IAM page's left navigation bar, go to **Roles** -> **Create role** -> **AWS account**, select **Another AWS account**, and enter `028022243208` in the Account ID
320
-
321
- > Note: To prevent the ROLE\_ARN from being obtained by third parties for unauthorized data access, you can check **Options** and select **Require external ID (best time for third party to assume this role)**. After checking, you can fill in `000000` as a placeholder in the **EXTERNAL ID** field to be filled in later. `EXTERNAL ID` serves 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 some other access information (such as the role ARN), they cannot access the resources without the correct `EXTERNAL ID`.
322
-
323
- ![](.topwrite/assets/image_1740379714725.png)
324
-
325
- * Select Next, on the Add permissions page, choose the policy created in step2 `LakehouseAccess`, then select Next
326
- * Fill in the Role name (e.g., `LakehouseVolumeRole`) and description, click **Create role** to complete the role creation
327
- * On the role details page, obtain the value of **Role ARN** to create the STORAGE CONNECTION
328
-
329
- ![](.topwrite/assets/image_1740379729037.png)
330
-
331
-
332
-
333
- step4: Create an API CONNECTION on the Singdata Lakehouse side:
334
-
335
- * Execute the following commands in Studio or the Lakehouse JDBC client:
336
- ```
337
- CREATE API CONNECTION udf_noah
338
- TYPE cloud_function
339
- PROVIDER = 'aws'
340
- REGION = 'cn-north-1'
341
- ROLE_ARN = 'arn:aws-cn:iam::028022243208:role/CzUdfRole'
342
- CODE_BUCKET = 'cz-udf-code'
343
- NAMESPACE = 'default';
344
- ```
345
- * During the process of creating a storage connection, Lakehouse will generate this EXTERNAL ID. You can configure this EXTERNAL ID into the Trust Policy of the AWS IAM role (`LakehouseVolumeRole`) created in step 3 to achieve additional access control:
346
- ```
347
- -- View EXTERNAL ID
348
- DESC CONNECTION udf_noah ;
349
- ```
350
- ![](.topwrite/assets/image_1740379856735.png)
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
+ ![](.topwrite/assets/image_1735802829076.png)
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
- * In the AWS IAM console, navigate to **Roles** in the left sidebar, find the role created in step 3 and enter the role details page. In **Trust relationships**, replace the value of `sts:ExternalId` `000000` with the `EXTERNAL_ID` from the DESC result. Click **Update** to complete the role policy update.
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)