Help & Documentation>Data Lake Compute

SQL Syntax Overview

Last updated: 2024-01-10 16:46:00

DLC can seamlessly run on both DLC Serverless Spark and DLC Serverless Presto engines using a set of standard SQL syntax. The metadata, analysis syntax, and functions are largely compatible with Hive and Spark syntax, and support custom functions. For the range of support for built-in system functions, refer to Unified Functions. If you need to use Presto built-in functions, the usage and range of support can be found in Presto Built-in Functions. If you need to perform data query analysis on external Iceberg tables in Data Lake Compute, some syntax may differ from native tables. For specifics, refer to Differences in Syntax between Iceberg External Tables and Native Tables.
The syntax supported by DLC is as follows:

DDL Syntax

Database-related Syntax

Use
Syntax
Create a database
Display all databases defined in this metadata
View Database Properties
Database Attribute Modification
Database Storage Location Modification
Deleting database

Data Table-related Syntax

Use
Syntax
New data table
Update Table Snapshot
Query Table Creation Information
Describe Table Properties
Query all tables in the database
Viewing Column Information and Metadata of Data Tables
Query Table Column Information
Adding columns to a data table
Add a column to a data table
Change Field Name
Deleting a specific field from a data table
Adding partition information to a data table
List Table Partitions
Deleting Partition Information of a Data Table
Adding a partition field to an Iceberg table
Delete Iceberg Table Partition Field
Data Table Attribute Modification
Data Table Storage Location Change
Modifying the Sorting Method of Table Data
Modify the Allocation Policy of a Partitioned Table
Adding identifier fields attribute
Delete identifier fields attribute
Update Partition Information
Statistical Analysis of Data Tables
Deleting Metadata Table
Display the logical or physical plan of the executed SQL
Invoke Table Stored Procedure

View-related Syntax

Use
Syntax
Create a view from SELECT results
Querying views in the database
Viewing Column Information of a View
Display View Creation Statement
Viewing View Column Information
Renaming a View
Modify View Properties
Delete View

Function-related Syntax

Use
Creating function version alias
Viewing Function Creation Syntax
DeleteAlias

DML syntax

Use
Insert a Row of Data
Replace a row of data
Row-level data update operation, can be used to replace INSERT OVERWRITE operation
Iceberg Table Metadata Query
Insert query results into a data table
Deleting data from an Iceberg table
Update Specified Rows

DQL syntax

Use
Data Query
For related query reserved words, see Reserved Words.