-- SyntaxCREATE [EXTERNAL] TABLE table_nameENGINE = ICEBERG[COMMENT "comment"]PROPERTIES ("iceberg.database" = "iceberg_db_name","iceberg.table" = "icberg_table_name","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG");-- Example 1: Mounting the 'iceberg_table' in 'iceberg_db' in IcebergCREATE TABLE `t_iceberg`ENGINE = ICEBERGPROPERTIES ("iceberg.database" = "iceberg_db","iceberg.table" = "iceberg_table","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG");-- Example 2: Mounting the 'iceberg_table' in 'iceberg_db' in Iceberg with HDFS HA enabledCREATE TABLE `t_iceberg`ENGINE = ICEBERGPROPERTIES ("iceberg.database" = "iceberg_db","iceberg.table" = "iceberg_table","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG","dfs.nameservices"="HDFS8000463","dfs.ha.namenodes.HDFS8000463"="nn2,nn1","dfs.namenode.rpc-address.HDFS8000463.nn2"="172.21.16.5:4007","dfs.namenode.rpc-address.HDFS8000463.nn1"="172.21.16.26:4007","dfs.client.failover.proxy.provider.HDFS8000463"="org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");
-- SyntaxCREATE DATABASE db_name[COMMENT "comment"]PROPERTIES ("iceberg.database" = "iceberg_db_name","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG");-- Example: Mounting 'iceberg_db' in Iceberg and all tables under this dbCREATE DATABASE `iceberg_test_db`PROPERTIES ("iceberg.database" = "iceberg_db","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG");
iceberg_test_db
can be viewed by HELP SHOW TABLE CREATION
.-- SyntaxCREATE [EXTERNAL] TABLE table_name (col_name col_type [NULL | NOT NULL] [COMMENT "comment"]) ENGINE = ICEBERG[COMMENT "comment"]PROPERTIES ("iceberg.database" = "iceberg_db_name","iceberg.table" = "icberg_table_name","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG");-- Example 1: Mounting the 'iceberg_table' in 'iceberg_db' in IcebergCREATE TABLE `t_iceberg` (`id` int NOT NULL COMMENT "id number",`name` varchar(10) NOT NULL COMMENT "user name") ENGINE = ICEBERGPROPERTIES ("iceberg.database" = "iceberg_db","iceberg.table" = "iceberg_table","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG");-- Example 2: Mounting the 'iceberg_table' in 'iceberg_db' in Iceberg with HDFS HA enabledCREATE TABLE `t_iceberg` (`id` int NOT NULL COMMENT "id number",`name` varchar(10) NOT NULL COMMENT "user name") ENGINE = ICEBERGPROPERTIES ("iceberg.database" = "iceberg_db","iceberg.table" = "iceberg_table","iceberg.hive.metastore.uris" = "thrift://192.168.0.1:9083","iceberg.catalog.type" = "HIVE_CATALOG","dfs.nameservices"="HDFS8000463","dfs.ha.namenodes.HDFS8000463"="nn2,nn1","dfs.namenode.rpc-address.HDFS8000463.nn2"="172.21.16.5:4007","dfs.namenode.rpc-address.HDFS8000463.nn1"="172.21.16.26:4007","dfs.client.failover.proxy.provider.HDFS8000463"="org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider");
iceberg.hive.metastore.uris
: Hive Metastore server address.iceberg.database
: The database name corresponding to the mounted Iceberg.iceberg.table
: The table name corresponding to the mounted Iceberg, no need to specify when mounting Iceberg database.iceberg.catalog.type
: The catalog method used in Iceberg, which is HIVE_CATALOG
by default. At present, only this method is supported, and more Iceberg catalog methods will be supported later.SHOW CREATE TABLE
.REFRESH
command, which will delete and rebuild the Iceberg External Table in Doris. For detailed information, see HELP REFRESH
.-- Synchronizing Iceberg TableREFRESH TABLE t_iceberg;-- Synchronizing Iceberg DatabaseREFRESH DATABASE iceberg_test_db;
Iceberg | Doris | Description |
BOOLEAN | BOOLEAN | - |
INTEGER | INT | - |
LONG | BIGINT | - |
FLOAT | FLOAT | - |
DOUBLE | DOUBLE | - |
DATE | DATE | - |
TIMESTAMP | DATETIME | Converting timestamp to datetime may result in loss of precision |
STRING | STRING | - |
UUID | VARCHAR | Use VARCHAR as a substitute |
DECIMAL | DECIMAL | - |
TIME | - | Not supported |
FIXED | - | Not supported |
BINARY | - | Not supported |
STRUCT | - | Not supported |
LIST | - | Not supported |
MAP | - | Not supported |
REFRESH
command.select * from t_iceberg where k1 > 1000 and k3 ='term' or k4 like '%doris';
fe.conf
or use ADMIN SET CONFIG
to configure.iceberg_table_creation_strict_mode
Create an Iceberg table, and the strict mode is enabled by default. The strict mode involves a strict filter on the column types of the Iceberg table. If there are data types that Doris does not currently support, the creation of the external table fails.iceberg_table_creation_interval_second
The interval between executing background tasks when Iceberg table is automatically created. The default value is 10s.max_iceberg_table_creation_record_size
The maximum value retained when an Iceberg table is created. The defaut value is 2000. This only applies to the creation of Iceberg database records.
Was this page helpful?