qidaye opened a new pull request #7391:
URL: https://github.com/apache/incubator-doris/pull/7391


   ## Proposed changes
   
   Close related #7389
   
   Support create Iceberg external table in Doris. 
   
   This is the first step to support Iceberg external table.
   
   ### Create Iceberg external table
   This pr describes two ways to create Iceberg external tables. Both ways do 
not require explicitly specifying column definitions, Doris automatically 
converts them based on Iceberg's column definitions.
   
   1. Create an Iceberg external table directly
   
   ```sql
       CREATE [EXTERNAL] TABLE table_name 
       ENGINE = ICEBERG
       [COMMENT "comment"]
       PROPERTIES (
       "database" = "iceberg_db_name",
       "table" = "icberg_table_name",
       "hive.metastore.uris"  =  "thrift://192.168.0.1:9083",
       "catalog.type"  =  "HIVE_CATALOG"
       );
   ```
   
   2. Create an Iceberg database and automatically create all the tables under 
that db.
   
   ```sql
       CREATE DATABASE db_name 
       ENGINE = ICEBERG
       [COMMENT "comment"]
       PROPERTIES (
       "database" = "iceberg_db_name",
       "hive.metastore.uris" = "thrift://192.168.0.1:9083",
       "catalog.type" = "HIVE_CATALOG"
       );
   ```
   
   ### Show table creation
   
   1. For individual tables you can view them with `help show create table`.
   
   ```sql 
   mysql> show create table iceberg_db.logs_1;
   
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | Table  | Create Table                                                      
                                                                                
                                                                                
                                                                                
                                           |
   
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   | logs_1 | CREATE TABLE `logs_1` (
     `level` varchar(-1) NOT NULL COMMENT "null",
     `event_time` datetime NOT NULL COMMENT "null",
     `message` varchar(-1) NOT NULL COMMENT "null"
   ) ENGINE=ICEBERG
   COMMENT "ICEBERG"
   PROPERTIES (
   "database" = "doris",
   "table" = "logs_1",
   "hive.metastore.uris"  =  "thrift://10.10.10.10:9087",
   "catalog.type"  =  "HIVE_CATALOG"
   ) |
   
+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
   ```
   
   2. For Iceberg database, you can view it with `help show table creation`.
   
   ```sql
   mysql> show table creation from iceberg_db;
   
+--------+---------+---------------------+---------------------------------------------------------+
   | Table  | Status  | Create Time         | Error Msg                         
                      |
   
+--------+---------+---------------------+---------------------------------------------------------+
   | logs   | fail    | 2021-12-14 13:50:10 | Cannot convert unknown type to 
Doris type: list<string> |
   | logs_1 | success | 2021-12-14 13:50:10 |                                   
                      |
   
+--------+---------+---------------------+---------------------------------------------------------+
   2 rows in set (0.00 sec)
   ```
   
     This is a new syntax.
     
     Show table creation records in Iceberg database:
     
     Syntax:
     ```sql
         SHOW TABLE CREATION [FROM db] [LIKE mask]
     ```
   ## Types of changes
   
   What types of changes does your code introduce to Doris?
   _Put an `x` in the boxes that apply_
   
   - [ ] Bugfix (non-breaking change which fixes an issue)
   - [x] New feature (non-breaking change which adds functionality)
   - [ ] Breaking change (fix or feature that would cause existing 
functionality to not work as expected)
   - [ ] Documentation Update (if none of the other choices apply)
   - [ ] Code refactor (Modify the code structure, format the code, etc...)
   - [ ] Optimization. Including functional usability improvements and 
performance improvements.
   - [ ] Dependency. Such as changes related to third-party components.
   - [ ] Other.
   
   ## Checklist
   
   _Put an `x` in the boxes that apply. You can also fill these out after 
creating the PR. If you're unsure about any of them, don't hesitate to ask. 
We're here to help! This is simply a reminder of what we are going to look for 
before merging your code._
   
   - [x] I have created an issue on (Fix #ISSUE) and described the bug/feature 
there in detail
   - [x] Compiling and unit tests pass locally with my changes
   - [x] I have added tests that prove my fix is effective or that my feature 
works
   - [x] If these changes need document changes, I have updated the document
   - [ ] Any dependent changes have been merged
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at 
[email protected] by explaining why you chose the solution you did and what 
alternatives you considered, etc...
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to