You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2023/05/09 11:02:42 UTC
[incubator-paimon] branch master updated: [doc] Update presto doc (#1104)
This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 12ef308b7 [doc] Update presto doc (#1104)
12ef308b7 is described below
commit 12ef308b73c25e9a7f37d39bea9eb9215cf7495b
Author: s7monk <34...@users.noreply.github.com>
AuthorDate: Tue May 9 19:02:38 2023 +0800
[doc] Update presto doc (#1104)
---
docs/content/engines/overview.md | 4 +--
docs/content/engines/presto.md | 50 ++++++++++++++++++++++++++++++++
docs/content/how-to/altering-tables.md | 32 +++++++++++++++++++++
docs/content/how-to/creating-tables.md | 52 ++++++++++++++++++++++++++++++++++
4 files changed, 136 insertions(+), 2 deletions(-)
diff --git a/docs/content/engines/overview.md b/docs/content/engines/overview.md
index f6c6da232..737d427cc 100644
--- a/docs/content/engines/overview.md
+++ b/docs/content/engines/overview.md
@@ -38,8 +38,8 @@ Apache Spark and Apache Hive.
| Spark | 3.1 - 3.4 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ |
| Hive | 2.1 - 3.1 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |
| Spark | 2.4 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
-| Trino | 358 - 400 | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
-| Presto | 0.236 - 0.279 | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ |
+| Trino | 358 - 416 | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
+| Presto | 0.236 - 0.280 | ✅ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ |
Ongoing engines:
- Doris: Under development, [Support Paimon catalog](https://github.com/apache/doris/issues/18433), [Doris Roadmap 2023](https://github.com/apache/doris/issues/16392).
diff --git a/docs/content/engines/presto.md b/docs/content/engines/presto.md
index 84d2c3694..5f96b6091 100644
--- a/docs/content/engines/presto.md
+++ b/docs/content/engines/presto.md
@@ -85,6 +85,8 @@ If you are using HDFS, choose one of the following ways to configure your HDFS:
- set environment variable HADOOP_CONF_DIR.
- configure fs.hdfs.hadoopconf in the properties.
+## Kerberos
+
You can configure kerberos keytag file when using KERBEROS authentication in the properties.
```
@@ -92,6 +94,54 @@ security.kerberos.login.principal=hadoop-user
security.kerberos.login.keytab=/etc/presto/hdfs.keytab
```
+Keytab files must be distributed to every node in the cluster that runs Presto.
+
+## Create Schema
+
+```
+CREATE SCHEMA paimon.test_db;
+```
+
+## Create Table
+
+```
+CREATE TABLE paimon.test_db.orders (
+ order_key bigint,
+ orders_tatus varchar,
+ total_price decimal(18,4),
+ order_date date
+)
+WITH (
+ file_format = 'ORC',
+ primary_key = ARRAY['order_key','order_date'],
+ partitioned_by = ARRAY['orderdate'],
+ bucket = '2',
+ bucket_key = 'order_key',
+ changelog_producer = 'input'
+)
+```
+
+## Add Column
+
+```
+CREATE TABLE paimon.test_db.orders (
+ order_key bigint,
+ orders_tatus varchar,
+ total_price decimal(18,4),
+ order_date date
+)
+WITH (
+ file_format = 'ORC',
+ primary_key = ARRAY['order_key','order_date'],
+ partitioned_by = ARRAY['orderdate'],
+ bucket = '2',
+ bucket_key = 'order_key',
+ changelog_producer = 'input'
+)
+
+ALTER TABLE paimon.test_db.orders ADD COLUMN "shipping_address varchar;
+```
+
## Query
```
diff --git a/docs/content/how-to/altering-tables.md b/docs/content/how-to/altering-tables.md
index a53a54906..55d3a2364 100644
--- a/docs/content/how-to/altering-tables.md
+++ b/docs/content/how-to/altering-tables.md
@@ -94,6 +94,14 @@ ALTER TABLE my_table RENAME TO my_table_new;
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+ALTER TABLE my_table RENAME TO my_table_new;
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
{{< hint info >}}
@@ -159,6 +167,14 @@ ALTER TABLE my_table ADD COLUMN c1 VARCHAR;
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+ALTER TABLE my_table ADD COLUMN c1 VARCHAR;
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
## Adding Column Position
@@ -220,6 +236,14 @@ ALTER TABLE my_table RENAME COLUMN c0 TO c1;
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+ALTER TABLE my_table RENAME COLUMN c0 TO c1;
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
## Dropping Columns
@@ -252,6 +276,14 @@ ALTER TABLE my_table DROP COLUMN c1;
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+ALTER TABLE my_table DROP COLUMN c1;
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
## Changing Column Nullability
diff --git a/docs/content/how-to/creating-tables.md b/docs/content/how-to/creating-tables.md
index eaeeb9b8c..a734312b5 100644
--- a/docs/content/how-to/creating-tables.md
+++ b/docs/content/how-to/creating-tables.md
@@ -101,6 +101,22 @@ CREATE TABLE MyTable (
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+CREATE TABLE MyTable (
+ user_id BIGINT,
+ item_id BIGINT,
+ behavior VARCHAR,
+ dt VARCHAR,
+ hh VARCHAR
+) WITH (
+ primary_key = ARRAY['dt', 'hh', 'user_id']
+);
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
{{< hint info >}}
@@ -182,6 +198,23 @@ CREATE TABLE MyTable (
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+CREATE TABLE MyTable (
+ user_id BIGINT,
+ item_id BIGINT,
+ behavior VARCHAR,
+ dt VARCHAR,
+ hh VARCHAR
+) WITH (
+ primary_key = ARRAY['dt', 'hh', 'user_id'],
+ partitioned_by = ARRAY['dt', 'hh']
+);
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
{{< hint info >}}
@@ -423,6 +456,25 @@ CREATE TABLE MyTable (
{{< /tab >}}
+{{< tab "Presto" >}}
+
+```sql
+CREATE TABLE MyTable (
+ user_id BIGINT,
+ item_id BIGINT,
+ behavior VARCHAR,
+ dt VARCHAR,
+ hh VARCHAR
+) WITH (
+ primary_key = ARRAY['dt', 'hh', 'user_id'],
+ partitioned_by = ARRAY['dt', 'hh'],
+ bucket = '2',
+ bucket_key = 'user_id'
+);
+```
+
+{{< /tab >}}
+
{{< /tabs >}}
## Creating External Tables