@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.
- 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,11 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# External Function Overview
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Singdata Lakehouse supports user-defined functions (UDF/UDAF/UDTF) via the **External Function** mechanism. Unlike built-in SQL functions, External Function execution logic runs in a cloud function compute service (Alibaba Cloud FC, Tencent Cloud SCF, or AWS Lambda); Lakehouse calls them via HTTP and retrieves the result — **you write the function call in SQL, and the function body runs in Python or Java code on the cloud**.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
- **Online services**: Large language model APIs, cloud platform AI services (image recognition, OCR, translation, etc.)
|
|
8
|
-
- **Offline capabilities**: Custom algorithms packaged for deployment, Hugging Face models, etc.
|
|
5
|
+
The advantage of this mechanism is that you can introduce any third-party library (scikit-learn, jieba, PyTorch, etc.) to implement logic that native SQL functions cannot handle, while still calling them from SQL.
|
|
9
6
|
|
|
10
7
|
---
|
|
11
8
|
|
|
@@ -14,10 +11,11 @@ This lets you call capabilities not natively supported by Lakehouse from SQL:
|
|
|
14
11
|
A user calls an External Function in SQL → Lakehouse sends an HTTP request to the external function compute service → retrieves the result and returns it.
|
|
15
12
|
|
|
16
13
|
The creation process has four steps:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
|
|
15
|
+
1. Enable a cloud function compute service (Alibaba Cloud FC / Tencent Cloud SCF / AWS Lambda) and object storage (OSS / COS / S3)
|
|
16
|
+
2. Create a Storage Connection and External Volume, then package and upload function code and dependencies
|
|
17
|
+
3. Create an API Connection to grant Lakehouse permission to call the function compute service
|
|
18
|
+
4. Execute `CREATE EXTERNAL FUNCTION` to register the function and call it in SQL
|
|
21
19
|
|
|
22
20
|
---
|
|
23
21
|
|
|
@@ -29,7 +27,7 @@ The creation process has four steps:
|
|
|
29
27
|
| UDAF (multiple rows in, single row out) | ❌ | ✅ |
|
|
30
28
|
| UDTF (single row in, multiple rows out) | ❌ | ✅ |
|
|
31
29
|
|
|
32
|
-
Runtime environments: Java 8 / Python 3.10. When compressed dependencies exceed 500 MB, use container image deployment instead — see [Using Hugging Face Image Recognition Model to Process Image Data](
|
|
30
|
+
Runtime environments: Java 8 / Python 3.10. When compressed dependencies exceed 500 MB, use container image deployment instead — see [Using Hugging Face Image Recognition Model to Process Image Data](RemoteFunction-on-acr.md).
|
|
33
31
|
|
|
34
32
|
---
|
|
35
33
|
|
|
@@ -37,7 +35,9 @@ Runtime environments: Java 8 / Python 3.10. When compressed dependencies exceed
|
|
|
37
35
|
|
|
38
36
|
| Page | Description |
|
|
39
37
|
|------|------|
|
|
40
|
-
| [Introduction: External Function](
|
|
41
|
-
| [Development Guide: Python3](
|
|
38
|
+
| [Introduction: External Function](RemoteFunction-intro.md) | Concepts, architecture, advantages, usage limits, and billing |
|
|
39
|
+
| [Development Guide: Python3](RemoteFunction-dev-guide-python3.md) | Environment setup, code structure, dependency packaging, deployment to Alibaba Cloud FC |
|
|
42
40
|
| [Development Guide: Java](external-function-dev-guide-java.md) | Java 8 function development, packaging, UDF/UDAF/UDTF implementation |
|
|
43
|
-
| [Usage Guide: External Function](
|
|
41
|
+
| [Usage Guide: External Function](RemoteFunction-best-practice.md) | Complete workflow: authorization, creating connections, registering functions, calling in SQL |
|
|
42
|
+
| [CREATE EXTERNAL FUNCTION](create_external_function.md) | Complete DDL syntax and parameter reference |
|
|
43
|
+
| [Storage Connection + API Connection + External Function Combo Practice](external-function-combo-practice.md) | End-to-end examples for three cloud environments (Alibaba Cloud / Tencent Cloud / AWS), including Python ML functions, 30 AI functions, and Java UDF/UDAF/UDTF |
|
|
@@ -4,15 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
Federated Queries allow Lakehouse to directly query data in external data catalogs (such as Hive Metastore, Databricks Unity Catalog) without migrating or copying data. Using `CREATE EXTERNAL CATALOG`, you can map external data sources as Catalogs within Lakehouse and use standard SQL for cross-system queries. This guide is organized by business scenario to help you quickly master federated query configuration methods.
|
|
6
6
|
|
|
7
|
-
### Quick Navigation
|
|
8
|
-
|
|
9
|
-
* [Create Hive External Catalog](#create-hive-external-catalog) -- Mount a Hive Metastore
|
|
10
|
-
* [Query External Catalog Data](#query-external-catalog-data) -- Use three-level namespace queries
|
|
11
|
-
* [View External Schemas and Tables](#view-external-schemas-and-tables) -- Explore external catalog structure
|
|
12
|
-
* [Drop External Catalog](#drop-external-catalog) -- Clean up the federation connection
|
|
13
|
-
|
|
14
|
-
***
|
|
15
|
-
|
|
16
7
|
## SQL Commands Covered
|
|
17
8
|
|
|
18
9
|
| Command | Purpose | Use Case |
|
|
@@ -145,3 +136,4 @@ DROP CATALOG IF EXISTS hive_prod;
|
|
|
145
136
|
* [External Catalog Introduction](external-catalog-summary.md)
|
|
146
137
|
* [Create External Catalog](create-external-catalog.md)
|
|
147
138
|
* [Create Hive Catalog](create-hive-catalog.md)
|
|
139
|
+
* [Databricks Unity Catalog Federated Query Practice](databricks-external-catalog-practice.md) — Complete configuration steps, tested SQL, and error troubleshooting
|
|
@@ -3,12 +3,15 @@
|
|
|
3
3
|
* [Before You Begin](setup.md)
|
|
4
4
|
* [Account Signup and Setup](logging-in.md)
|
|
5
5
|
* [Supported Cloud Platforms](supported-cloud-platforms.md)
|
|
6
|
-
* [Pricing and Billing](pricing.md)
|
|
7
6
|
* [Trial Account Quotas and Limits](trial-account-quotas-and-limits.md)
|
|
8
7
|
* [Concept Index](concepts.md)
|
|
9
8
|
* [Key Concepts](key-concepts.md)
|
|
10
9
|
* [Lakehouse Studio Concept](lakehouse-studio-concept.md)
|
|
11
10
|
* [Incremental Computing](incremental-computing.md)
|
|
11
|
+
* [Ecosystem](ecosystem.md)
|
|
12
|
+
* [Pricing and Billing](pricing.md)
|
|
13
|
+
* [Lakehouse Pricing](pricing-lakehouse.md)
|
|
14
|
+
* [AI Gateway Pricing](pricing-ai-gateway.md)
|
|
12
15
|
* [Tutorials](tutorials.md)
|
|
13
16
|
* [Lakehouse Quick Start Experience Guide](lakehouse-quick-experience_guide.md)
|
|
14
17
|
* [Lakehouse Studio Tour](lakehousestudio-tour.md)
|
|
@@ -29,11 +32,8 @@
|
|
|
29
32
|
* [Connect Using Command Line Client](connect-with-cli.md)
|
|
30
33
|
* [Connect Using MySQL Protocol](use-mysql-client.md)
|
|
31
34
|
* [Connect Using SQLAlchemy](sqlalchemy.md)
|
|
35
|
+
* [Connect Using cz-cli](connect-with-cz-cli.md)
|
|
32
36
|
* [Related Downloads](lakehouse-client-repository.md)
|
|
33
|
-
* [Quick Start with Copy Command](quickstart-with-copy-command.md)
|
|
34
|
-
* [Capture Change Data (CDC) and Data Processing through Singdata Lakehouse's Multi-table Real-time Sync and Dynamic Tables](czguide-intro-to-cdc-using-clickzetta-rtsync-dynamic-tables.md)
|
|
35
|
-
* [Ingesting Data from Alibaba Cloud Data Lake](ingesting-data-from-alibaba-cloud-datalake.md)
|
|
36
|
-
* [Real-time Data Sync from Oracle via Bluepipe](bluepipe-oracle-lakehouse-datasync.md)
|
|
37
37
|
* [A Comprehensive Guide to Ingesting Data into Singdata Lakehouse](a_comprehensive_guide_to_ingesting_data_into_clickzetta_lakehouse.md)
|
|
38
38
|
* [Overview](comprehensive_guide_to_ingesting_overview.md)
|
|
39
39
|
* [Environment Setup and Test Data Generation](comprehensive_guide_to_ingesting_environment_and_data_generate.md)
|
|
@@ -305,9 +305,8 @@
|
|
|
305
305
|
* [Full-Text Search and Text Analysis in Practice](sql_fulltext_search_guide.md)
|
|
306
306
|
* [Vector Search and RAG Applications in Practice](sql_vector_search_guide.md)
|
|
307
307
|
* [Federation Query](federation-query.md)
|
|
308
|
-
* [
|
|
309
|
-
* [
|
|
310
|
-
* [Databricks-Singdata Cross-Platform Data Federation](databricks_yunqi_integration_guide_v2.md)
|
|
308
|
+
* [Databricks Unity Catalog Federation Query Practice](databricks-external-catalog-practice.md)
|
|
309
|
+
* [Accessing Databricks Iceberg Tables via Iceberg REST Catalog](iceberg-rest-catalog-databricks.md)
|
|
311
310
|
* [Data Lake Management and Analytics](datalake_volume_analytics.md)
|
|
312
311
|
* [Data Lake Overview](datalake_overview.md)
|
|
313
312
|
* [Data Lake Storage Connection](datalake-storage-connection.md)
|
|
@@ -335,12 +334,10 @@
|
|
|
335
334
|
* [Unstructured Data Analysis](unstructure_data_analysis.md)
|
|
336
335
|
* [Invoke AI Capabilities to Process Unstructured Data](datalake_unstructure_data.md)
|
|
337
336
|
* [Data Lake Permissions](datalake_privilege.md)
|
|
338
|
-
* [
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
* [Development Guide: External Function (Java)](external-function-dev-guide-java.md)
|
|
343
|
-
* [Usage Guide: External Function](remotefunction-best-practice.md)
|
|
337
|
+
* [Private Storage BYOS](bring_your_own_storage.md)
|
|
338
|
+
* [BYOS Overview](byos_general.md)
|
|
339
|
+
* [Alibaba Cloud BYOS Configuration](alicloud_byos_configuration.md)
|
|
340
|
+
* [Tencent Cloud BYOS Configuration](byos_tencentcloud_configuration.md)
|
|
344
341
|
* [Data Sharing](data_sharing_guide.md)
|
|
345
342
|
* [Data Sharing Overview](data-sharing.md)
|
|
346
343
|
* [Cross-Account Data Sharing Guide](data_sharing_between_accounts_guide.md)
|
|
@@ -372,11 +369,8 @@
|
|
|
372
369
|
* [Creating Tencent Cloud Privatelink Service](creating_tencentcloud_privatelinkservice.md)
|
|
373
370
|
* [Obtaining Tencent Cloud ARN and ExternalID](tencentcloud_arn_and_externalid.md)
|
|
374
371
|
* [Dynamic Data Masking](dynamic-mask.md)
|
|
372
|
+
* [Row-Level Security (Row Filter)](row-filter.md)
|
|
375
373
|
* [Backup and Recovery](data-recover.md)
|
|
376
|
-
* [Private Storage](bring_your_own_storage.md)
|
|
377
|
-
* [BYOS Overview](byos_general.md)
|
|
378
|
-
* [Alibaba Cloud BYOS Configuration](alicloud_byos_configuration.md)
|
|
379
|
-
* [Tencent Cloud BYOS Configuration](byos_tencentcloud_configuration.md)
|
|
380
374
|
* [Storage Encryption](storage_encryption.md)
|
|
381
375
|
* [INFORMATION SCHEMA](information_schema_guide.md)
|
|
382
376
|
* [Instance-Level INFORMATION SCHEMA](instance-information_schema.md)
|
|
@@ -393,6 +387,7 @@
|
|
|
393
387
|
* [Real-Name Authentication](authentication.md)
|
|
394
388
|
* [Account Funds](account-funds.md)
|
|
395
389
|
* [Billing](billing.md)
|
|
390
|
+
* [Usage and Billing View](usageandbillingview.md)
|
|
396
391
|
* [Connect Using Ecosystem Tools](ecosystem-all.md)
|
|
397
392
|
* [Airbyte](airbyte.md)
|
|
398
393
|
* [Datax](eco_integration/datax.md)
|
|
@@ -419,7 +414,6 @@
|
|
|
419
414
|
* [MindsDB](mindsdb.md)
|
|
420
415
|
* [Streamlit](eco_integration/streamlit.md)
|
|
421
416
|
* [Logstash Connector](logstash.md)
|
|
422
|
-
* [Trino Connector](eco_integration/trino.md)
|
|
423
417
|
* [Introduction to Spark Connector](spark-connector-summary.md)
|
|
424
418
|
* [Using Spark Connector](spark-connector-use.md)
|
|
425
419
|
* [Flink Write Connector](flink-write-connector.md)
|
|
@@ -468,37 +462,51 @@
|
|
|
468
462
|
* [AI_TRANSCRIBE](ai_transcribe.md)
|
|
469
463
|
* [Best practices](ai_function_best_practice.md)
|
|
470
464
|
* [RRF Full-Text + Vector Hybrid Search Best Practices](rrf-fulltext-vector-hybrid-search-best-practices.md)
|
|
471
|
-
* [Create LLM Function](create-llm-function.md)
|
|
472
|
-
* [Create Embedding Function](create-embedding-function.md)
|
|
473
|
-
* [AI + BI Unified Workflow](unified-workflow.md)
|
|
465
|
+
* [External AI Function Example 2: Create an LLM Function to Analyze Company Industry](create-llm-function.md)
|
|
466
|
+
* [External AI Function Example 1: Create an Embedding Function](create-embedding-function.md)
|
|
467
|
+
* [AI + BI Unified Workflow](unified-workflow.md)
|
|
468
|
+
* [AI + BI Unified Workflow Introduction](unified-workflow-intro.md)
|
|
469
|
+
* [Example: Incremental Processing of Vehicle Images in Object Storage](unified-workflow-demo.md)
|
|
474
470
|
* [Lakehouse MCP Server](lakehousemcpserver.md)
|
|
475
|
-
* [Lakehouse MCP Server Introduction](lakehousemcpserver-intro.md)
|
|
471
|
+
* [Lakehouse MCP Server Introduction and Quick Deployment](lakehousemcpserver-intro.md)
|
|
476
472
|
* [Dify Integrated with Lakehouse MCP Server](dify_integrated_with_lakehousemcpserver.md)
|
|
477
473
|
* [N8N Integrated with Lakehouse MCP Server](n8n_integrated_with_lakehousemcpserver.md)
|
|
478
474
|
* [Quick Analysis of Public Internet Data](analysis_internet_data_nyc_green_data.md)
|
|
479
|
-
* [NYC Green Taxi Data
|
|
480
|
-
* [Multi-Cloud Instance Management with
|
|
481
|
-
* [
|
|
482
|
-
* [
|
|
475
|
+
* [NYC Green Taxi Data Cleaning and Transformation](nyc_green_taxi_data_clean_transform_with_mcp_server.md)
|
|
476
|
+
* [Multi-Cloud Instance Management with Lakehouse](multi_cloud_instance_manage_with_mcp_server.md)
|
|
477
|
+
* [Cost Anomaly Analysis and Root Cause Identification](charge_analysis_with_lakehouse_mcp_server.md)
|
|
478
|
+
* [Data Operations Troubleshooting](using_mcp_solute_data_pipeline_issue.md)
|
|
483
479
|
* [AI Gateway](aigateway.md)
|
|
484
480
|
* [Product Introduction](introduction.md)
|
|
485
|
-
* [Model
|
|
481
|
+
* [Model Price](pricing-ai-gateway.md)
|
|
486
482
|
* [Quick Start](quickstart.md)
|
|
483
|
+
* [Using Models](use-models.md)
|
|
484
|
+
* [Calling LLMs via SQL](lakehouse-ai-sql-analysis.md)
|
|
485
|
+
* [Analyzing Images in SQL](lakehouse-multimodal-ai-pipeline.md)
|
|
486
|
+
* [Model Management via cz-cli](lakehouse-ai-gateway-cz-cli.md)
|
|
487
487
|
* [Conversational Analytics (Analytics Agent)](datagpt_introduction.md)
|
|
488
488
|
* [Quick Start](datagpt_quickstart.md)
|
|
489
489
|
* [User Guide](datagpt_tutorial.md)
|
|
490
490
|
* [Data Source Management](datagpt_data_source.md)
|
|
491
|
+
* [Model Selection and Configuration](datagpt-model-config.md)
|
|
491
492
|
* [Metrics and Answer Builder](metrics_answer_build.md)
|
|
492
493
|
* [Scheduled Task](scheduled_task.md)
|
|
493
494
|
* [Table Rendering](table_rendering.md)
|
|
494
495
|
* [Web Search](web_search.md)
|
|
495
496
|
* [Dashboard Version Management](dashboard-version-management-guide.md)
|
|
496
|
-
* [Data Governance, Answer Builder & Analysis Domains](analytics-agent-core-concepts.md)
|
|
497
497
|
* [Chart Auto-Refresh Configuration](chart-auto-refresh-guide.md)
|
|
498
498
|
* [Row-Level Permissions](row_level_permission.md)
|
|
499
499
|
* [Best Practices](datagpt_bestpractice.md)
|
|
500
500
|
* [Web Data Retrieval and Conversational Data Analysis](simpletosimple_bazhuayu_datagpt.md)
|
|
501
501
|
* [Improve Answer Accuracy](answer-accuracy-improve.md)
|
|
502
|
+
* [API](open-api-overview.md)
|
|
503
|
+
* [Quick Start](open-api-quick-start.md)
|
|
504
|
+
* [GenerateAuthToken - Obtain Authentication Token](open-api-generate-auth-token.md)
|
|
505
|
+
* [CreateSession - Create a Conversation Session](open-api-create-session.md)
|
|
506
|
+
* [Text2InsightQuery - Submit a Data Analysis Request](open-api-text2insight-query.md)
|
|
507
|
+
* [SafeQuestionPoll - Poll for Question Results](open-api-safe-question-poll.md)
|
|
508
|
+
* [Text2InsightStop - Stop a Question](open-api-text2insight-stop.md)
|
|
509
|
+
* [Understanding Response Results](open-api-response-guide.md)
|
|
502
510
|
* [Data Privacy](data_privacy.md)
|
|
503
511
|
* [Singdata CLI (cz-cli)](cz-cli.md)
|
|
504
512
|
* [Installation and Configuration Guide](setup_cz_cli.md)
|
|
@@ -578,6 +586,7 @@
|
|
|
578
586
|
* [Partition](partition_table.md)
|
|
579
587
|
* [Cluster](cluster-table.md)
|
|
580
588
|
* [Primary Key](primary-key.md)
|
|
589
|
+
* [Unique Key](unique-key.md)
|
|
581
590
|
* [Identity Column](identity-column.md)
|
|
582
591
|
* [Generated Column](generated-column.md)
|
|
583
592
|
* [Default Value](default-value.md)
|
|
@@ -1343,6 +1352,10 @@
|
|
|
1343
1352
|
* [Import Feishu Data into Lakehouse](import-feishu-data.md)
|
|
1344
1353
|
* [Data Lake Acceleration](datalake-acceleration.md)
|
|
1345
1354
|
* [In-Place Data Lake Acceleration Implementation Guide](lakehouse-acceleration-guide.md)
|
|
1355
|
+
* [Multi-Cloud Unified Data Lake Acceleration](lakehouse-multi-cloud-acceleration.md)
|
|
1356
|
+
* [Volume + Pipe + Dynamic Table End-to-End Practice](lakehouse-volume-pipe-acceleration-guide.md)
|
|
1357
|
+
* [Medallion Architecture Practice: Pure SQL Dynamic Table Approach](lakehouse-medallion-sql-dt-guide.md)
|
|
1358
|
+
* [Storage Connection + API Connection + External Function Combo Practice](external-function-combo-practice.md)
|
|
1346
1359
|
* [Migration Guide](tutorial_migration.md)
|
|
1347
1360
|
* [Data Type Compatibility Reference](migration-sql-compatibility.md)
|
|
1348
1361
|
* [Migrating Spark Data Engineering Best Practices Project to Singdata Lakehouse](migrate-spark-data-engineering-best-practices-to-lakehouse.md)
|
|
@@ -1350,6 +1363,11 @@
|
|
|
1350
1363
|
* [Spark SQL Migration Guide](migration-spark-sql.md)
|
|
1351
1364
|
* [PySpark → ZettaPark Migration: F1 Racing Data Engineering Project](pyspark-to-zettapark-migration-f1.md)
|
|
1352
1365
|
* [Databricks → Lakehouse Migration: Medallion Three-Layer Data Warehouse](medallion-lakehouse-from-scratch.md)
|
|
1366
|
+
* [Databricks Notebook → Lakehouse Migration: Retail Data Medallion Pipeline](databricks-notebook-to-studio-migration.md)
|
|
1367
|
+
* [Databricks DLT → Lakehouse Migration: Apparel Retail Streaming Pipeline](databricks-dlt-to-lakehouse-migration.md)
|
|
1368
|
+
* [Databricks Unity Catalog → Lakehouse Migration: Permissions and Governance](databricks-uc-governance-to-lakehouse-migration.md)
|
|
1369
|
+
* [Databricks Jobs → Lakehouse Studio Migration: E-commerce ETL Pipeline](databricks-jobs-to-studio-migration.md)
|
|
1370
|
+
* [Databricks Delta Tables → Lakehouse Migration](databricks-delta-to-lakehouse-migration.md)
|
|
1353
1371
|
* [PySpark RDD → ZettaPark Migration: Web Log Analysis](rdd-to-zettapark-migration-weblog.md)
|
|
1354
1372
|
* [Migrating Snowflake Real-Time ETL Pipeline to Singdata Lakehouse](migrate-snowflake-realtime-etl-to-lakehouse.md)
|
|
1355
1373
|
* [Snowflake Dynamic Tables Migration: Bronze–Silver–Gold Three-Layer Pipeline](snowflake-dynamic-tables-to-lakehouse.md)
|
|
@@ -1358,6 +1376,7 @@
|
|
|
1358
1376
|
* [Hive → Lakehouse Migration: E-commerce User Behavior Data Warehouse](hive-to-lakehouse-ecommerce.md)
|
|
1359
1377
|
* [pandas → ZettaPark Migration: Retail Data Analysis](pandas-to-zettapark-migration-retail.md)
|
|
1360
1378
|
* [DBT Snowflake Migration: TPC-H Data Warehouse Pipeline](dbt-snowflake-to-clickzetta-migration.md)
|
|
1379
|
+
* [DBT Databricks → DBT-ClickZetta Migration: Financial Payment Data Pipeline](dbt-databricks-to-clickzetta-migration.md)
|
|
1361
1380
|
* [DBT BigQuery Migration: Retail Data Warehouse Pipeline](dbt-bigquery-to-clickzetta-migration.md)
|
|
1362
1381
|
* [Studio Task Development and Operations Practice](studio-task-practice.md)
|
|
1363
1382
|
* [Studio Python Task Development Guide (ZettaPark)](studio-python-task-zettapark.md)
|
|
@@ -1408,6 +1427,7 @@
|
|
|
1408
1427
|
* [Data Recovery from Mistakes: Using Time Travel to Restore Deleted and Modified Data](data-recovery-with-time-travel.md)
|
|
1409
1428
|
* [New ELT method with Lakehouse](refactor-elt-practice.md)
|
|
1410
1429
|
* [DataOps data security and stable production practice](dataops_practice.md)
|
|
1430
|
+
* [Data Quality Check (DQC): SQL-Driven Automated Validation](lakehouse-dqc-guide.md)
|
|
1411
1431
|
* [Optimize Computing Resources](optimizing-computing-resources.md)
|
|
1412
1432
|
* [Analytical cluster planning, configuration, and practical use](analytics_cluster_best_practices.md)
|
|
1413
1433
|
* [Performance Experience](performence_test.md)
|
|
@@ -1477,6 +1497,16 @@
|
|
|
1477
1497
|
* [Analytics Agent Release Notes](datagpt-release.md)
|
|
1478
1498
|
* [April 14, 2026 - v1.1](release-note-0414-1.1.md)
|
|
1479
1499
|
* [May 19, 2026 - v1.2](release-note-2026-05-19.md)
|
|
1500
|
+
* [AI Gateway Release Notes](aigatewayupdate.md)
|
|
1501
|
+
* [February 5, 2026 - 1.0](aigw-2026-2-5-1.0.md)
|
|
1502
|
+
* [March 8, 2026 - 1.0.1](aigw-2026-3-8-1.0.1.md)
|
|
1503
|
+
* [March 29, 2026 - 1.0.2](aigw-2026-3-29-1.0.2.md)
|
|
1504
|
+
* [April 28, 2026 - 1.1](aigw-2026-4-28-1.1.md)
|
|
1505
|
+
* [May 12, 2026 - 1.1.1](aigw-2026-5-12-1.1.1.md)
|
|
1506
|
+
* [May 15, 2026 - 1.2](aigw-2026-5-15-1.2.md)
|
|
1507
|
+
* [May 21, 2026 - 1.3](aigw-2026-5-21-1.3.md)
|
|
1508
|
+
* [May 28, 2026 - 1.4](aigw-2026-5-28-1.4.md)
|
|
1509
|
+
* [June 3, 2026 - 1.5](aigw-2026-6-3-1.5.md)
|
|
1480
1510
|
|
|
1481
1511
|
## Other
|
|
1482
1512
|
* [User Agreement](service-aggrement.md)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# Window
|
|
1
|
+
# Window Functions
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
Window Functions are a powerful analytical feature in Singdata Lakehouse SQL that allow
|
|
5
|
+
Window Functions are a powerful analytical feature in Singdata Lakehouse SQL that allow calculations to be performed across a set of related rows, rather than just on individual rows. By using the WINDOW clause, you can define one or more named windows and then reference those windows in window functions, avoiding repetitive window specifications and making queries more concise and maintainable.
|
|
6
6
|
|
|
7
7
|
## Syntax
|
|
8
8
|
|
|
@@ -23,33 +23,29 @@ WINDOW <window_name> AS (<window_specification>, ...)
|
|
|
23
23
|
1. **ROWS Frame**: Window frame based on row count
|
|
24
24
|
2. **RANGE Frame**: Window frame based on value range
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## Test Data Setup
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
The following examples use a custom `sales` table (monthly sales data) to demonstrate various window function features. The PARTITION BY example in the Best Practices section uses the `doc_test.employees` table.
|
|
29
29
|
|
|
30
30
|
```sql
|
|
31
|
-
CREATE TABLE IF NOT EXISTS sales(
|
|
32
|
-
month
|
|
33
|
-
sales
|
|
31
|
+
CREATE TABLE IF NOT EXISTS sales (
|
|
32
|
+
month INT,
|
|
33
|
+
sales INT,
|
|
34
34
|
profit DOUBLE
|
|
35
35
|
);
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Insert Test Data
|
|
39
36
|
|
|
40
|
-
```sql
|
|
41
37
|
INSERT INTO sales (month, sales, profit) VALUES
|
|
42
38
|
(1, 100, 0.1),
|
|
43
39
|
(2, 120, 0.15),
|
|
44
|
-
(3,
|
|
40
|
+
(3, 80, 0.05),
|
|
45
41
|
(4, 150, 0.2),
|
|
46
|
-
(5,
|
|
42
|
+
(5, 90, 0.1),
|
|
47
43
|
(6, 110, 0.12);
|
|
48
44
|
```
|
|
49
45
|
|
|
50
46
|
## Usage Examples
|
|
51
47
|
|
|
52
|
-
### Example 1: Moving Window Aggregation
|
|
48
|
+
### Example 1: Moving Window Aggregation — Moving Sum and Moving Average
|
|
53
49
|
|
|
54
50
|
**Business Scenario**: Calculate the sum and average of sales for the current month and the two preceding months
|
|
55
51
|
|
|
@@ -80,7 +76,7 @@ WINDOW w AS (ORDER BY month ROWS BETWEEN 2 PRECEDING AND CURRENT ROW);
|
|
|
80
76
|
|
|
81
77
|
***
|
|
82
78
|
|
|
83
|
-
### Example 2: Multi-Window Ranking
|
|
79
|
+
### Example 2: Multi-Window Ranking — Quarterly and Annual Ranking
|
|
84
80
|
|
|
85
81
|
**Business Scenario**: Simultaneously compute ranking within each quarter and across the full year
|
|
86
82
|
|
|
@@ -112,13 +108,13 @@ WINDOW w1 AS (PARTITION BY CEIL(month / 3) ORDER BY sales DESC),
|
|
|
112
108
|
|
|
113
109
|
* The w1 window partitions by quarter (every 3 months), computing sales ranking within each quarter
|
|
114
110
|
* The w2 window has no partition, computing sales ranking across the full year
|
|
115
|
-
* CEIL(month/3) divides months into Q1 (months 1
|
|
111
|
+
* `CEIL(month/3)` divides months into Q1 (months 1–3), Q2 (months 4–6), etc.
|
|
116
112
|
|
|
117
113
|
***
|
|
118
114
|
|
|
119
|
-
### Example 3: Cumulative Aggregation
|
|
115
|
+
### Example 3: Cumulative Aggregation — Year-to-Date Statistics
|
|
120
116
|
|
|
121
|
-
**Business Scenario**: Calculate cumulative sales
|
|
117
|
+
**Business Scenario**: Calculate cumulative sales, average profit margin, etc. from the beginning of the year to the current month
|
|
122
118
|
|
|
123
119
|
```sql
|
|
124
120
|
SELECT month, sales, profit,
|
|
@@ -149,7 +145,7 @@ WINDOW w AS (ORDER BY month ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW);
|
|
|
149
145
|
|
|
150
146
|
***
|
|
151
147
|
|
|
152
|
-
### Example 4: Time Series Analysis
|
|
148
|
+
### Example 4: Time Series Analysis — Period-over-Period Comparison
|
|
153
149
|
|
|
154
150
|
**Business Scenario**: View each month's sales compared to the previous and next month, and the period-over-period change
|
|
155
151
|
|
|
@@ -179,9 +175,9 @@ WINDOW w AS (ORDER BY month);
|
|
|
179
175
|
|
|
180
176
|
**Explanation**:
|
|
181
177
|
|
|
182
|
-
* `LAG(sales, 1)`: Gets the sales from the previous row
|
|
183
|
-
* `LEAD(sales, 1)`: Gets the sales from the next row
|
|
184
|
-
*
|
|
178
|
+
* `LAG(sales, 1)`: Gets the sales value from the previous row
|
|
179
|
+
* `LEAD(sales, 1)`: Gets the sales value from the next row
|
|
180
|
+
* `prev_sales` and `next_sales` are NULL for the first and last rows respectively
|
|
185
181
|
|
|
186
182
|
***
|
|
187
183
|
|
|
@@ -223,7 +219,7 @@ WINDOW w AS (ORDER BY sales DESC);
|
|
|
223
219
|
|
|
224
220
|
***
|
|
225
221
|
|
|
226
|
-
### Example 6: Position Functions
|
|
222
|
+
### Example 6: Position Functions — Accessing Values at Specific Positions
|
|
227
223
|
|
|
228
224
|
**Business Scenario**: Get the first, last, and nth values within the window
|
|
229
225
|
|
|
@@ -254,14 +250,53 @@ WINDOW w AS (ORDER BY month ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLO
|
|
|
254
250
|
**Explanation**:
|
|
255
251
|
|
|
256
252
|
* `FIRST_VALUE()`: Returns the value of the first row in the window
|
|
257
|
-
* `LAST_VALUE()`: Returns the value of the last row in the window (requires UNBOUNDED FOLLOWING to see the actual last row)
|
|
253
|
+
* `LAST_VALUE()`: Returns the value of the last row in the window (requires `UNBOUNDED FOLLOWING` to see the actual last row)
|
|
258
254
|
* `NTH_VALUE(expr, n)`: Returns the value of the nth row in the window
|
|
259
255
|
|
|
260
256
|
***
|
|
261
257
|
|
|
262
|
-
### Example
|
|
258
|
+
### Example 6.1: IGNORE NULLS — Skip NULL Values When Accessing
|
|
259
|
+
|
|
260
|
+
**Business Scenario**: Skip NULLs when accessing values, for example to forward-fill gaps with the most recent non-null value
|
|
261
|
+
|
|
262
|
+
The value access functions `FIRST_VALUE`, `LAST_VALUE`, and `NTH_VALUE` support appending `IGNORE NULLS` after the function call, which skips NULL values during computation. The default behavior is `RESPECT NULLS` (NULLs participate in computation).
|
|
263
|
+
|
|
264
|
+
```sql
|
|
265
|
+
-- Prepare data containing NULLs
|
|
266
|
+
CREATE TABLE w_nulls (id INT, v INT);
|
|
267
|
+
INSERT INTO w_nulls VALUES (1, 10), (2, NULL), (3, 30), (4, NULL), (5, 50);
|
|
268
|
+
|
|
269
|
+
SELECT id, v,
|
|
270
|
+
LAST_VALUE(v) IGNORE NULLS OVER (ORDER BY id) AS fill_down,
|
|
271
|
+
LAST_VALUE(v) OVER (ORDER BY id) AS keep_null
|
|
272
|
+
FROM w_nulls
|
|
273
|
+
ORDER BY id;
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Execution Result**:
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
+----+------+-----------+-----------+
|
|
280
|
+
| id | v | fill_down | keep_null |
|
|
281
|
+
+----+------+-----------+-----------+
|
|
282
|
+
| 1 | 10 | 10 | 10 |
|
|
283
|
+
| 2 | NULL | 10 | NULL |
|
|
284
|
+
| 3 | 30 | 30 | 30 |
|
|
285
|
+
| 4 | NULL | 30 | NULL |
|
|
286
|
+
| 5 | 50 | 50 | 50 |
|
|
287
|
+
+----+------+-----------+-----------+
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**Explanation**:
|
|
263
291
|
|
|
264
|
-
|
|
292
|
+
* `IGNORE NULLS`: Skips NULLs; the `fill_down` column fills gaps with the most recent non-null value
|
|
293
|
+
* `RESPECT NULLS` (default): NULLs pass through as-is
|
|
294
|
+
* Functions that support `IGNORE NULLS` / `RESPECT NULLS`: `FIRST_VALUE`, `LAST_VALUE`, `NTH_VALUE`
|
|
295
|
+
* `LAG` and `LEAD` do not currently support `IGNORE NULLS`; using it will raise an error
|
|
296
|
+
|
|
297
|
+
***
|
|
298
|
+
|
|
299
|
+
**Business Scenario**: Find all records within a sales value range of ±10 and compute statistics
|
|
265
300
|
|
|
266
301
|
```sql
|
|
267
302
|
SELECT month, sales,
|
|
@@ -294,7 +329,7 @@ WINDOW w AS (ORDER BY sales RANGE BETWEEN 10 PRECEDING AND 10 FOLLOWING);
|
|
|
294
329
|
|
|
295
330
|
***
|
|
296
331
|
|
|
297
|
-
### Example 8: Comprehensive Analysis
|
|
332
|
+
### Example 8: Comprehensive Analysis — Multi-Dimensional Business Report (Advanced)
|
|
298
333
|
|
|
299
334
|
**Business Scenario**: Generate a comprehensive analytical report including ranking, cumulative values, period-over-period comparison, and proportions
|
|
300
335
|
|
|
@@ -340,14 +375,14 @@ WINDOW
|
|
|
340
375
|
* This example uses 3 different window definitions simultaneously
|
|
341
376
|
* w1: Ordered by month, used for ranking and period-over-period comparison
|
|
342
377
|
* w2: Cumulative window, used for YTD (Year-To-Date) calculations
|
|
343
|
-
* w3: Full window, used for computing total sum and calculating proportions
|
|
344
|
-
* Demonstrates how to
|
|
378
|
+
* w3: Full window, used for computing the total sum and calculating proportions
|
|
379
|
+
* Demonstrates how to implement complex multi-dimensional analysis in a single query
|
|
345
380
|
|
|
346
381
|
***
|
|
347
382
|
|
|
348
|
-
### Example 9: Data Bucketing
|
|
383
|
+
### Example 9: Data Bucketing — NTILE Function Application
|
|
349
384
|
|
|
350
|
-
**Business Scenario**: Divide sales data into high, medium, and low tiers
|
|
385
|
+
**Business Scenario**: Divide sales data into high, medium, and low performance tiers
|
|
351
386
|
|
|
352
387
|
```sql
|
|
353
388
|
SELECT
|
|
@@ -382,7 +417,7 @@ WINDOW w AS (ORDER BY sales DESC);
|
|
|
382
417
|
|
|
383
418
|
***
|
|
384
419
|
|
|
385
|
-
### Example 10: Cumulative Distribution
|
|
420
|
+
### Example 10: Cumulative Distribution — CUME\_DIST Function Application
|
|
386
421
|
|
|
387
422
|
**Business Scenario**: Calculate the cumulative distribution percentile of each sales value within the dataset
|
|
388
423
|
|
|
@@ -419,18 +454,18 @@ WINDOW w AS (ORDER BY sales);
|
|
|
419
454
|
|
|
420
455
|
### ROWS vs RANGE
|
|
421
456
|
|
|
422
|
-
| Frame Type | Description
|
|
423
|
-
| ---------- |
|
|
424
|
-
| ROWS
|
|
425
|
-
| RANGE
|
|
457
|
+
| Frame Type | Description | Example |
|
|
458
|
+
| ---------- | ----------- | ------- |
|
|
459
|
+
| ROWS | Based on physical row count | `ROWS BETWEEN 2 PRECEDING AND CURRENT ROW` |
|
|
460
|
+
| RANGE | Based on logical value range | `RANGE BETWEEN 10 PRECEDING AND 10 FOLLOWING` |
|
|
426
461
|
|
|
427
462
|
### Boundary Keywords
|
|
428
463
|
|
|
429
464
|
* `UNBOUNDED PRECEDING`: The first row of the partition
|
|
430
465
|
* `UNBOUNDED FOLLOWING`: The last row of the partition
|
|
431
466
|
* `CURRENT ROW`: The current row
|
|
432
|
-
* `n PRECEDING`: The nth row before the current row (
|
|
433
|
-
* `n FOLLOWING`: The nth row after the current row (
|
|
467
|
+
* `n PRECEDING`: The nth row before the current row (ROWS) or rows with value − n (RANGE)
|
|
468
|
+
* `n FOLLOWING`: The nth row after the current row (ROWS) or rows with value + n (RANGE)
|
|
434
469
|
|
|
435
470
|
***
|
|
436
471
|
|
|
@@ -453,9 +488,11 @@ WINDOW w AS (ORDER BY sales);
|
|
|
453
488
|
|
|
454
489
|
* `LAG()`: Access preceding rows
|
|
455
490
|
* `LEAD()`: Access following rows
|
|
456
|
-
* `FIRST_VALUE()`: First value in the window
|
|
457
|
-
* `LAST_VALUE()`: Last value in the window
|
|
458
|
-
* `NTH_VALUE()`: The nth value in the window
|
|
491
|
+
* `FIRST_VALUE()`: First value in the window (supports `IGNORE NULLS`)
|
|
492
|
+
* `LAST_VALUE()`: Last value in the window (supports `IGNORE NULLS`)
|
|
493
|
+
* `NTH_VALUE()`: The nth value in the window (supports `IGNORE NULLS`)
|
|
494
|
+
|
|
495
|
+
> `IGNORE NULLS` skips NULLs when accessing values; the default is `RESPECT NULLS`. Only `FIRST_VALUE`/`LAST_VALUE`/`NTH_VALUE` support this; `LAG`/`LEAD` do not.
|
|
459
496
|
|
|
460
497
|
***
|
|
461
498
|
|
|
@@ -487,29 +524,28 @@ WINDOW w AS (ORDER BY month ROWS BETWEEN 2 PRECEDING AND CURRENT ROW);
|
|
|
487
524
|
For grouped analysis, use PARTITION BY to perform intra-group calculations without breaking the data structure:
|
|
488
525
|
|
|
489
526
|
```sql
|
|
490
|
-
-- Example: Calculate ranking
|
|
491
|
-
SELECT
|
|
492
|
-
RANK() OVER w AS
|
|
493
|
-
FROM
|
|
494
|
-
WINDOW w AS (PARTITION BY
|
|
527
|
+
-- Example: Calculate salary ranking by department
|
|
528
|
+
SELECT dept, name, salary,
|
|
529
|
+
RANK() OVER w AS rank_in_dept
|
|
530
|
+
FROM doc_test.employees
|
|
531
|
+
WINDOW w AS (PARTITION BY dept ORDER BY salary DESC);
|
|
495
532
|
```
|
|
496
533
|
|
|
497
534
|
**Execution Result**:
|
|
498
535
|
|
|
499
536
|
```
|
|
500
|
-
|
|
501
|
-
|
|
|
502
|
-
|
|
503
|
-
|
|
|
504
|
-
|
|
|
505
|
-
|
|
|
506
|
-
|
|
|
507
|
-
|
|
|
508
|
-
|
|
509
|
-
+-------------+-------+-------+------------------+
|
|
537
|
+
+-------------+-------+----------+--------------+
|
|
538
|
+
| dept | name | salary | rank_in_dept |
|
|
539
|
+
+-------------+-------+----------+--------------+
|
|
540
|
+
| Engineering | Alice | 12000.00 | 1 |
|
|
541
|
+
| Engineering | Bob | 9500.00 | 2 |
|
|
542
|
+
| HR | Eve | 6000.00 | 1 |
|
|
543
|
+
| Marketing | Carol | 8500.00 | 1 |
|
|
544
|
+
| Marketing | Dave | 6500.00 | 2 |
|
|
545
|
+
+-------------+-------+----------+--------------+
|
|
510
546
|
```
|
|
511
547
|
|
|
512
|
-
Explanation:
|
|
548
|
+
Explanation: Salary rankings are computed independently within each department without affecting each other.
|
|
513
549
|
|
|
514
550
|
### 3. Pay Attention to LAST\_VALUE Window Scope
|
|
515
551
|
|
|
@@ -559,3 +595,9 @@ A: You need to explicitly specify `ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDE
|
|
|
559
595
|
***
|
|
560
596
|
|
|
561
597
|
^
|
|
598
|
+
|
|
599
|
+
## Related Guides
|
|
600
|
+
|
|
601
|
+
- [Ranking and Percentile Analysis](SQL_Ranking_Guide.md): Complete usage scenarios for ROW_NUMBER, RANK, DENSE_RANK, NTILE, and PERCENTILE
|
|
602
|
+
- [Cumulative Calculation and Running Total](SQL_Running_Total_Guide.md): Usage patterns for SUM/AVG OVER, moving averages, YTD cumulative values, FIRST_VALUE/LAST_VALUE
|
|
603
|
+
- [Time Series Analysis](SQL_TimeSeries_Guide.md): Implementing rolling windows and period-over-period comparisons using window functions
|
|
@@ -16,11 +16,9 @@ Service instance-level roles can only be granted via the Web UI. Only users with
|
|
|
16
16
|
|
|
17
17
|
In the service instance, navigate to **Admin** -> **Security**, and switch to the **Roles** tab.
|
|
18
18
|
|
|
19
|
-
:-: 
|
|
20
19
|
|
|
21
20
|
Click on the instance role you want to grant to enter its detail page, then click **Grant to User**:
|
|
22
21
|
|
|
23
|
-
:-: 
|
|
24
22
|
|
|
25
23
|
In the dialog, select the users to grant, then click the **Grant** button to complete the instance role assignment.
|
|
26
24
|
|
|
@@ -44,13 +42,11 @@ For a user to use compute clusters (VClusters) and execute SQL within a workspac
|
|
|
44
42
|
|
|
45
43
|
After entering the service instance, click **Admin** -> **Workspaces** in the menu to go to the workspace list. Click on a workspace name to enter its detail page.
|
|
46
44
|
|
|
47
|
-
:-: 
|
|
48
45
|
|
|
49
46
|
On the workspace detail page, click the **+ Add User** button, and select users in the dialog. Only users who exist in the service instance and are not currently members of this workspace will be displayed. Select one or more users and click **Add User** or **Add User and Grant Role** to add the selected users to the workspace. After successful addition, you can find the new users in the workspace's **Users** list.
|
|
50
47
|
|
|
51
48
|
In the workspace's **Users** list, click the **...** menu next to a user and select **Remove User** to remove that user from the workspace. The removed user will immediately lose all granted workspace roles and lose the ability to use compute clusters (VClusters) or execute SQL in that workspace.
|
|
52
49
|
|
|
53
|
-
:-: 
|
|
54
50
|
|
|
55
51
|
Note that users removed from a workspace will retain any data permissions directly granted to them, meaning they can exercise those data permissions in other workspaces to query or modify data. Therefore, it is recommended to manage permissions through role grants to reduce the complexity of permission management in such scenarios.
|
|
56
52
|
|
|
@@ -116,7 +112,6 @@ To grant permissions to a user, replace `TO ROLE <CUSTOM_ROLE_NAME>` with `TO US
|
|
|
116
112
|
|
|
117
113
|
Submitting scheduled tasks in a workspace can only be done through the **Development** feature in the Web UI. The `workspace_admin` and `workspace_dev` roles have the permission to submit job scripts as scheduled tasks.
|
|
118
114
|
|
|
119
|
-
:-: 
|
|
120
115
|
|
|
121
116
|
^
|
|
122
117
|
|
|
@@ -146,20 +141,18 @@ You can grant or revoke roles from users via the Web UI or SQL. Only users with
|
|
|
146
141
|
|
|
147
142
|
On the **Security** -> **Roles** page, you can view instance-level and workspace-level roles in the current instance.
|
|
148
143
|
|
|
149
|
-
:-: 
|
|
150
144
|
|
|
151
145
|
The `instance_admin` role can view all instance-level roles and all workspace-level roles, and manage grants for all instance-level roles.
|
|
152
146
|
|
|
153
147
|
The `workspace_admin` role can view all roles within their workspace and manage grants for those roles. If a user holds the `workspace_admin` role in multiple workspaces, they can manage role grants across all those workspaces.
|
|
154
148
|
|
|
155
149
|
To grant a role, click the role name to enter its detail page, where you can view all users currently granted the role. Click **+ Grant to User**, select users in the dialog, and click **Grant** to assign the role to users.
|
|
156
|
-
|
|
150
|
+
|
|
157
151
|
|
|
158
152
|
To revoke a role, click the **...** menu next to a user and select **Remove User** to remove the user's association with that role.
|
|
159
153
|
|
|
160
154
|
In the **Admin** -> **Workspaces** list, enter a workspace detail page, and on the **Roles** tab you can also view the role list within the workspace and grant or revoke roles using the same process.
|
|
161
155
|
|
|
162
|
-
:-: 
|
|
163
156
|
|
|
164
157
|
***
|
|
165
158
|
|