diff --git a/docs/content/engines/starrocks.md b/docs/content/engines/starrocks.md new file mode 100644 index 000000000000..d646dc5d9743 --- /dev/null +++ b/docs/content/engines/starrocks.md @@ -0,0 +1,186 @@ +--- +title: "StarRocks" +weight: 5 +type: docs +aliases: +- /engines/starrocks.html +--- + + +# StarRocks + +This documentation is a guide for using Paimon in StarRocks. + +## Version + +Paimon currently supports StarRocks 3.1 and above. Recommended version is StarRocks 3.2.6 or above. + +## Create Paimon Catalog + +Paimon catalogs are registered by executing a `CREATE EXTERNAL CATALOG` SQL in StarRocks. +For example, you can use the following SQL to create a Paimon catalog named paimon_catalog. + +```sql +CREATE EXTERNAL CATALOG paimon_catalog +PROPERTIES +( +"type" = "paimon", +"paimon.catalog.type" = "filesystem", +"paimon.catalog.warehouse" = "oss:///user/warehouse/" +); +``` + +More catalog types and configures can be seen in [Paimon catalog](https://docs.starrocks.io/docs/data_source/catalog/paimon_catalog/). + +## Query +Suppose there already exists a database named `test_db` and a table named `test_tbl` in `paimon_catalog`, +you can query this table using the following SQL: +```sql +SELECT * FROM paimon_catalog.test_db.test_tbl; +``` + +## Query System Tables + +You can access all kinds of Paimon system tables by StarRocks. For example, you can read the `ro` +(read-optimized) system table to improve reading performance of primary-key tables. + +```sql +SELECT * FROM paimon_catalog.test_db.test_tbl$ro; +``` + +For another example, you can query partition files of the table using the following SQL: + +```sql +SELECT * FROM paimon_catalog.test_db.partition_tbl$partitions; +/* ++-----------+--------------+--------------------+------------+----------------------------+ +| partition | record_count | file_size_in_bytes | file_count | last_update_time | ++-----------+--------------+--------------------+------------+----------------------------+ +| [1] | 1 | 645 | 1 | 2024-01-01 00:00:00.000000 | ++-----------+--------------+--------------------+------------+----------------------------+ +*/ +``` + +## StarRocks to Paimon type mapping + +This section lists all supported type conversion between StarRocks and Paimon. +All StarRocks’s data types can be found in this doc [StarRocks Data type overview](https://docs.starrocks.io/docs/sql-reference/data-types/data-type-list/). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StarRocks Data TypePaimon Data TypeAtomic Type
STRUCTRowTypefalse
MAPMapTypefalse
ARRAYArrayTypefalse
BOOLEANBooleanTypetrue
TINYINTTinyIntTypetrue
SMALLINTSmallIntTypetrue
INTIntTypetrue
BIGINTBigIntTypetrue
FLOATFloatTypetrue
DOUBLEDoubleTypetrue
CHAR(length)CharType(length)true
VARCHAR(MAX_VARCHAR_LENGTH)VarCharType(VarCharType.MAX_LENGTH)true
VARCHAR(length)VarCharType(length), length is less than VarCharType.MAX_LENGTHtrue
DATEDateTypetrue
DATETIMETimestampTypetrue
DECIMAL(precision, scale)DecimalType(precision, scale)true
VARBINARY(length)VarBinaryType(length)true
DATETIMELocalZonedTimestampTypetrue
diff --git a/docs/content/maintenance/system-tables.md b/docs/content/maintenance/system-tables.md index ffef040e92f4..b4f0168a3dbd 100644 --- a/docs/content/maintenance/system-tables.md +++ b/docs/content/maintenance/system-tables.md @@ -30,7 +30,7 @@ under the License. Table specified system tables contain metadata and information about each table, such as the snapshots created and the options in use. Users can access system tables with batch queries. -Currently, Flink, Spark and Trino supports querying system tables. +Currently, Flink, Spark, Trino and StarRocks support querying system tables. In some cases, the table name needs to be enclosed with back quotes to avoid syntax parsing conflicts, for example triple access mode: ```sql