GitHub user voonhous edited a comment on the discussion: Native SQL DDL support 
for Hudi table creation across engines (Trino, Presto etc.)

For question 3, no preference for managed or external, the goal is parity with 
Hudi’s Spark SQL behavior. There are five cases:

```sql
-- 1. Create an external table by specifying a location.
CREATE TABLE external_table (id BIGINT, name STRING)
USING hudi
LOCATION 's3://my-bucket/external_table';

-- 2. Drop the external table's catalog entry; preserve filesystem data.
DROP TABLE external_table;

-- 3. Alternatively, drop both the catalog entry and filesystem data.
DROP TABLE external_table PURGE;

-- 4. Create an internal (managed) table by omitting the location.
CREATE TABLE managed_table (id BIGINT, name STRING)
USING hudi;

-- 5. Drop the managed table's catalog entry and filesystem data.
DROP TABLE managed_table;
```

An explicit location makes the table external, even if the connector creates 
the `.hoodie` directory. `register_table` should also register an external 
table.

Trino’s [`DROP TABLE` 
syntax](https://trino.io/docs/current/sql/drop-table.html) doesn’t support 
`PURGE`, so we can match the creation and ordinary-drop behavior first and 
address explicit purging separately.

GitHub link: 
https://github.com/apache/hudi/discussions/19484#discussioncomment-18315399

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to