CREATE TABLE `ads_ad_tt_ad_product_shopping_ads_type_global_report_d` (
  `stat_date` date NOT NULL COMMENT '统计时间_天',
  `ad_id` varchar(512) NOT NULL COMMENT '广告id',
  `ad_name` text NULL COMMENT '广告名称',
  `stat_mon` varchar(100) NULL COMMENT '统计时间_月',
  `spu_id` varchar(255) NULL COMMENT '商品的SPUID',
  `shopping_ads_type` varchar(100) NULL COMMENT '购物广告类型',
  `account_id` varchar(255) NULL COMMENT '媒体账号id',
  `adv_id` varchar(512) NULL COMMENT '广告主id',
  `product_name` varchar(1024) NULL COMMENT '商品名称',
  `account_name` varchar(255) NULL COMMENT '媒体账号名称',
  `adv_name` varchar(1024) NULL COMMENT '广告主名称',
  `spend_amt_1d` DECIMAL(38, 2) NULL DEFAULT "0.0" COMMENT '最近1天消耗金额',
  `imps_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天曝光量',
  `clk_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天点击量',
  `cvr_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天转化量',
  `cart_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天加购量',
  `pur_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天购买量',
  `revenue_amt_1d` DECIMAL(38, 2) NULL DEFAULT "0.0" COMMENT '最近1天收入金额',
  `collect_timestamp` datetime NULL COMMENT '采集时间戳',
  INDEX product_name_idx (`product_name`) USING BITMAP COMMENT 'Bitmap index on column product_name',
  INDEX adv_name_idx (`adv_name`) USING BITMAP COMMENT 'Bitmap index on column adv_name',
  INDEX account_name_idx (`account_name`) USING BITMAP COMMENT 'Bitmap index on column account_name'
) ENGINE=OLAP
UNIQUE KEY(`stat_date`, `ad_id`)
COMMENT '广告域-素材近1天广告效果数据'
PARTITION BY RANGE(`stat_date`)
(PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')),
PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01')),
PARTITION p202207 VALUES [('2022-07-01'), ('2022-08-01')),
PARTITION p202208 VALUES [('2022-08-01'), ('2022-09-01')),
PARTITION p202209 VALUES [('2022-09-01'), ('2022-10-01')),
PARTITION p202210 VALUES [('2022-10-01'), ('2022-11-01')),
PARTITION p202211 VALUES [('2022-11-01'), ('2022-12-01')),
PARTITION p202212 VALUES [('2022-12-01'), ('2023-01-01')),
PARTITION p202301 VALUES [('2023-01-01'), ('2023-02-01')),
PARTITION p202302 VALUES [('2023-02-01'), ('2023-03-01')),
PARTITION p202303 VALUES [('2023-03-01'), ('2023-04-01')),
PARTITION p202304 VALUES [('2023-04-01'), ('2023-05-01')),
PARTITION p202305 VALUES [('2023-05-01'), ('2023-06-01')),
PARTITION p202306 VALUES [('2023-06-01'), ('2023-07-01')),
PARTITION p202307 VALUES [('2023-07-01'), ('2023-08-01')),
PARTITION p202308 VALUES [('2023-08-01'), ('2023-09-01')),
PARTITION p202309 VALUES [('2023-09-01'), ('2023-10-01')),
PARTITION p202310 VALUES [('2023-10-01'), ('2023-11-01')),
PARTITION p202311 VALUES [('2023-11-01'), ('2023-12-01')),
PARTITION p202312 VALUES [('2023-12-01'), ('2024-01-01')),
PARTITION p202401 VALUES [('2024-01-01'), ('2024-02-01')),
PARTITION p202402 VALUES [('2024-02-01'), ('2024-03-01')),
PARTITION p202403 VALUES [('2024-03-01'), ('2024-04-01')),
PARTITION p202404 VALUES [('2024-04-01'), ('2024-05-01')),
PARTITION p202405 VALUES [('2024-05-01'), ('2024-06-01')),
PARTITION p202406 VALUES [('2024-06-01'), ('2024-07-01')),
PARTITION p202407 VALUES [('2024-07-01'), ('2024-08-01')),
PARTITION p202408 VALUES [('2024-08-01'), ('2024-09-01')),
PARTITION p202409 VALUES [('2024-09-01'), ('2024-10-01')),
PARTITION p202410 VALUES [('2024-10-01'), ('2024-11-01')),
PARTITION p202411 VALUES [('2024-11-01'), ('2024-12-01')),
PARTITION p202412 VALUES [('2024-12-01'), ('2025-01-01')))
DISTRIBUTED BY HASH(`stat_date`, `ad_id`) BUCKETS 6
PROPERTIES (
"replication_allocation" = "tag.location.default: 3",
"is_being_synced" = "false",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "MONTH",
"dynamic_partition.time_zone" = "Europe/London",
"dynamic_partition.start" = "-2147483648",
"dynamic_partition.end" = "1",
"dynamic_partition.prefix" = "p",
"dynamic_partition.replication_allocation" = "tag.location.default: 3",
"dynamic_partition.buckets" = "16",
"dynamic_partition.create_history_partition" = "true",
"dynamic_partition.history_partition_num" = "24",
"dynamic_partition.hot_partition_num" = "0",
"dynamic_partition.reserved_history_periods" = "NULL",
"dynamic_partition.storage_policy" = "",
"dynamic_partition.storage_medium" = "HDD",
"dynamic_partition.start_day_of_month" = "1",
"storage_format" = "V2",
"light_schema_change" = "true",
"disable_auto_compaction" = "false",
"enable_single_replica_compaction" = "false"
);
--------------------
CREATE TABLE `ads_ad_tt_ad_product_shopping_ads_type_global_report_d` (
	`stat_date` date NOT NULL COMMENT '统计时间_天',
	`ad_id` varchar(512) NOT NULL COMMENT '广告id',
	`ad_name` text NULL COMMENT '广告名称',
	`stat_mon` varchar(100) NULL COMMENT '统计时间_月',
	`spu_id` varchar(255) NULL COMMENT '商品的SPUID',
	`shopping_ads_type` varchar(100) NULL COMMENT '购物广告类型',
	`account_id` varchar(255) NULL COMMENT '媒体账号id',
	`adv_id` varchar(512) NULL COMMENT '广告主id',
	`product_name` varchar(1024) NULL COMMENT '商品名称',
	`account_name` varchar(255) NULL COMMENT '媒体账号名称',
	`adv_name` varchar(1024) NULL COMMENT '广告主名称',
	`spend_amt_1d` DECIMAL(38, 2) NULL DEFAULT "0.0" COMMENT '最近1天消耗金额',
	`imps_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天曝光量',
	`clk_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天点击量',
	`cvr_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天转化量',
	`cart_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天加购量',
	`pur_cnt_1d` bigint(20) NULL DEFAULT "0" COMMENT '最近1天购买量',
	`revenue_amt_1d` DECIMAL(38, 2) NULL DEFAULT "0.0" COMMENT '最近1天收入金额',
	`collect_timestamp` datetime NULL COMMENT '采集时间戳',
	INDEX product_name_idx(`product_name`) USING BITMAP COMMENT 'Bitmap index on column product_name',
	INDEX adv_name_idx(`adv_name`) USING BITMAP COMMENT 'Bitmap index on column adv_name',
	INDEX account_name_idx(`account_name`) USING BITMAP COMMENT 'Bitmap index on column account_name'
) ENGINE = OLAP
UNIQUE KEY (`stat_date`, `ad_id`)
COMMENT '广告域-素材近1天广告效果数据'
PARTITION BY RANGE (`stat_date`) (
	PARTITION p202205 VALUES [('2022-05-01'), ('2022-06-01')),
	PARTITION p202206 VALUES [('2022-06-01'), ('2022-07-01')),
	PARTITION p202207 VALUES [('2022-07-01'), ('2022-08-01')),
	PARTITION p202208 VALUES [('2022-08-01'), ('2022-09-01')),
	PARTITION p202209 VALUES [('2022-09-01'), ('2022-10-01')),
	PARTITION p202210 VALUES [('2022-10-01'), ('2022-11-01')),
	PARTITION p202211 VALUES [('2022-11-01'), ('2022-12-01')),
	PARTITION p202212 VALUES [('2022-12-01'), ('2023-01-01')),
	PARTITION p202301 VALUES [('2023-01-01'), ('2023-02-01')),
	PARTITION p202302 VALUES [('2023-02-01'), ('2023-03-01')),
	PARTITION p202303 VALUES [('2023-03-01'), ('2023-04-01')),
	PARTITION p202304 VALUES [('2023-04-01'), ('2023-05-01')),
	PARTITION p202305 VALUES [('2023-05-01'), ('2023-06-01')),
	PARTITION p202306 VALUES [('2023-06-01'), ('2023-07-01')),
	PARTITION p202307 VALUES [('2023-07-01'), ('2023-08-01')),
	PARTITION p202308 VALUES [('2023-08-01'), ('2023-09-01')),
	PARTITION p202309 VALUES [('2023-09-01'), ('2023-10-01')),
	PARTITION p202310 VALUES [('2023-10-01'), ('2023-11-01')),
	PARTITION p202311 VALUES [('2023-11-01'), ('2023-12-01')),
	PARTITION p202312 VALUES [('2023-12-01'), ('2024-01-01')),
	PARTITION p202401 VALUES [('2024-01-01'), ('2024-02-01')),
	PARTITION p202402 VALUES [('2024-02-01'), ('2024-03-01')),
	PARTITION p202403 VALUES [('2024-03-01'), ('2024-04-01')),
	PARTITION p202404 VALUES [('2024-04-01'), ('2024-05-01')),
	PARTITION p202405 VALUES [('2024-05-01'), ('2024-06-01')),
	PARTITION p202406 VALUES [('2024-06-01'), ('2024-07-01')),
	PARTITION p202407 VALUES [('2024-07-01'), ('2024-08-01')),
	PARTITION p202408 VALUES [('2024-08-01'), ('2024-09-01')),
	PARTITION p202409 VALUES [('2024-09-01'), ('2024-10-01')),
	PARTITION p202410 VALUES [('2024-10-01'), ('2024-11-01')),
	PARTITION p202411 VALUES [('2024-11-01'), ('2024-12-01')),
	PARTITION p202412 VALUES [('2024-12-01'), ('2025-01-01'))
)
DISTRIBUTED BY HASH (`stat_date`, `ad_id`) BUCKETS 6
PROPERTIES (
	"replication_allocation" = "tag.location.default: 3",
	"is_being_synced" = "false",
	"dynamic_partition.enable" = "true",
	"dynamic_partition.time_unit" = "MONTH",
	"dynamic_partition.time_zone" = "Europe/London",
	"dynamic_partition.start" = "-2147483648",
	"dynamic_partition.end" = "1",
	"dynamic_partition.prefix" = "p",
	"dynamic_partition.replication_allocation" = "tag.location.default: 3",
	"dynamic_partition.buckets" = "16",
	"dynamic_partition.create_history_partition" = "true",
	"dynamic_partition.history_partition_num" = "24",
	"dynamic_partition.hot_partition_num" = "0",
	"dynamic_partition.reserved_history_periods" = "NULL",
	"dynamic_partition.storage_policy" = "",
	"dynamic_partition.storage_medium" = "HDD",
	"dynamic_partition.start_day_of_month" = "1",
	"storage_format" = "V2",
	"light_schema_change" = "true",
	"disable_auto_compaction" = "false",
	"enable_single_replica_compaction" = "false"
);
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.table_hash
(
    k1 TINYINT,
    k2 DECIMAL(10, 2) DEFAULT "10.5",
    v1 CHAR(10) REPLACE,
    v2 INT SUM
)
ENGINE=olap
AGGREGATE KEY(k1, k2)
COMMENT "my first starrocks table"
DISTRIBUTED BY HASH(k1)
PROPERTIES ("storage_type"="column",
"replication_num"="3")
BROKER PROPERTIES (
    "broker.username"="user1",
    "broker.password"="passw0rd"
)
--------------------
CREATE TABLE example_db.table_hash (
	k1 TINYINT,
	k2 DECIMAL(10, 2) DEFAULT "10.5",
	v1 CHAR(10) REPLACE,
	v2 INT SUM
) ENGINE = olap
AGGREGATE KEY (k1, k2)
COMMENT "my first starrocks table"
DISTRIBUTED BY HASH (k1)
PROPERTIES (
	"storage_type" = "column",
	"replication_num" = "3"
)
BROKER PROPERTIES (
	"broker.username" = "user1",
	"broker.password" = "passw0rd"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.table_hash
(
    k1 BIGINT,
    k2 LARGEINT,
    v1 VARCHAR(2048) REPLACE,
    v2 SMALLINT SUM DEFAULT "10"
)
ENGINE=olap
UNIQUE KEY(k1, k2)
DISTRIBUTED BY HASH (k1, k2)
PROPERTIES(
    "storage_type"="column",
    "storage_medium" = "SSD",
    "storage_cooldown_time" = "2015-06-04 00:00:00"
)
--------------------
CREATE TABLE example_db.table_hash (
	k1 BIGINT,
	k2 LARGEINT,
	v1 VARCHAR(2048) REPLACE,
	v2 SMALLINT SUM DEFAULT "10"
) ENGINE = olap
UNIQUE KEY (k1, k2)
DISTRIBUTED BY HASH (k1, k2)
PROPERTIES (
	"storage_type" = "column",
	"storage_medium" = "SSD",
	"storage_cooldown_time" = "2015-06-04 00:00:00"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.table_hash
(
    k1 BIGINT,
    k2 LARGEINT,
    v1 VARCHAR(2048) REPLACE,
    v2 SMALLINT SUM DEFAULT "10"
)
ENGINE=olap
PRIMARY KEY(k1, k2)
DISTRIBUTED BY HASH (k1, k2)
PROPERTIES(
    "storage_type"="column",
    "storage_medium" = "SSD",
    "storage_cooldown_time" = "2015-06-04 00:00:00"
)
--------------------
CREATE TABLE example_db.table_hash (
	k1 BIGINT,
	k2 LARGEINT,
	v1 VARCHAR(2048) REPLACE,
	v2 SMALLINT SUM DEFAULT "10"
) ENGINE = olap
PRIMARY KEY (k1, k2)
DISTRIBUTED BY HASH (k1, k2)
PROPERTIES (
	"storage_type" = "column",
	"storage_medium" = "SSD",
	"storage_cooldown_time" = "2015-06-04 00:00:00"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.table_range
(
    k1 DATE,
    k2 INT,
    k3 SMALLINT,
    v1 VARCHAR(2048),
    v2 DATETIME DEFAULT "2014-02-04 15:36:00"
)
ENGINE=olap
DUPLICATE KEY(k1, k2, k3)
PARTITION BY RANGE (k1)
(
    PARTITION p1 VALUES LESS THAN ("2014-01-01"),
    PARTITION p2 VALUES LESS THAN ("2014-06-01"),
    PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH(k2)
PROPERTIES(
    "storage_medium" = "SSD", 
    "storage_cooldown_time" = "2015-06-04 00:00:00"
)
--------------------
CREATE TABLE example_db.table_range (
	k1 DATE,
	k2 INT,
	k3 SMALLINT,
	v1 VARCHAR(2048),
	v2 DATETIME DEFAULT "2014-02-04 15:36:00"
) ENGINE = olap
DUPLICATE KEY (k1, k2, k3)
PARTITION BY RANGE (k1) (
	PARTITION p1 VALUES LESS THAN ("2014-01-01"),
	PARTITION p2 VALUES LESS THAN ("2014-06-01"),
	PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH (k2)
PROPERTIES (
	"storage_medium" = "SSD",
	"storage_cooldown_time" = "2015-06-04 00:00:00"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE table_range
(
    k1 DATE,
    k2 INT,
    k3 SMALLINT,
    v1 VARCHAR(2048),
    v2 DATETIME DEFAULT "2014-02-04 15:36:00"
)
ENGINE=olap
DUPLICATE KEY(k1, k2, k3)
PARTITION BY RANGE (k1, k2, k3)
(
    PARTITION p1 VALUES [("2014-01-01", "10", "200"), ("2014-01-01", "20", "300")),
    PARTITION p2 VALUES [("2014-06-01", "100", "200"), ("2014-07-01", "100", "300"))
)
DISTRIBUTED BY HASH(k2)
PROPERTIES(
    "storage_medium" = "SSD"
)
--------------------
CREATE TABLE table_range (
	k1 DATE,
	k2 INT,
	k3 SMALLINT,
	v1 VARCHAR(2048),
	v2 DATETIME DEFAULT "2014-02-04 15:36:00"
) ENGINE = olap
DUPLICATE KEY (k1, k2, k3)
PARTITION BY RANGE (k1, k2, k3) (
	PARTITION p1 VALUES [("2014-01-01", "10", "200"), ("2014-01-01", "20", "300")),
	PARTITION p2 VALUES [("2014-06-01", "100", "200"), ("2014-07-01", "100", "300"))
)
DISTRIBUTED BY HASH (k2)
PROPERTIES (
	"storage_medium" = "SSD"
)
------------------------------------------------------------------------------------------------------------------------
CREATE EXTERNAL TABLE example_db.table_mysql
(
    k1 DATE,
    k2 INT,
    k3 SMALLINT,
    k4 VARCHAR(2048),
    k5 DATETIME
)
ENGINE=mysql
PROPERTIES
(
    "host" = "127.0.0.1",
    "port" = "8239",
    "user" = "mysql_user",
    "password" = "mysql_passwd",
    "database" = "mysql_db_test",
    "table" = "mysql_table_test"
)
--------------------
CREATE EXTERNAL TABLE example_db.table_mysql (
	k1 DATE,
	k2 INT,
	k3 SMALLINT,
	k4 VARCHAR(2048),
	k5 DATETIME
) ENGINE = mysql
PROPERTIES (
	"host" = "127.0.0.1",
	"port" = "8239",
	"user" = "mysql_user",
	"password" = "mysql_passwd",
	"database" = "mysql_db_test",
	"table" = "mysql_table_test"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.example_table
(
    k1 TINYINT,
    k2 DECIMAL(10, 2) DEFAULT "10.5",
    v1 HLL HLL_UNION,
    v2 HLL HLL_UNION
)
ENGINE=olap
AGGREGATE KEY(k1, k2)
DISTRIBUTED BY HASH(k1)
PROPERTIES ("storage_type"="column")
--------------------
CREATE TABLE example_db.example_table (
	k1 TINYINT,
	k2 DECIMAL(10, 2) DEFAULT "10.5",
	v1 HLL HLL_UNION,
	v2 HLL HLL_UNION
) ENGINE = olap
AGGREGATE KEY (k1, k2)
DISTRIBUTED BY HASH (k1)
PROPERTIES (
	"storage_type" = "column"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.example_table
(
    k1 TINYINT,
    k2 DECIMAL(10, 2) DEFAULT "10.5",
    v1 BITMAP BITMAP_UNION,
    v2 BITMAP BITMAP_UNION
)
ENGINE=olap
AGGREGATE KEY(k1, k2)
DISTRIBUTED BY HASH(k1)
PROPERTIES ("storage_type"="column")
--------------------
CREATE TABLE example_db.example_table (
	k1 TINYINT,
	k2 DECIMAL(10, 2) DEFAULT "10.5",
	v1 BITMAP BITMAP_UNION,
	v2 BITMAP BITMAP_UNION
) ENGINE = olap
AGGREGATE KEY (k1, k2)
DISTRIBUTED BY HASH (k1)
PROPERTIES (
	"storage_type" = "column"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.table_hash
(
    k1 TINYINT,
    k2 DECIMAL(10, 2) DEFAULT "10.5",
    v1 CHAR(10) REPLACE,
    v2 INT SUM,
    INDEX k1_idx (k1) USING BITMAP COMMENT 'xxxxxx'
)
ENGINE=olap
AGGREGATE KEY(k1, k2)
COMMENT "my first starrocks table"
DISTRIBUTED BY HASH(k1)
PROPERTIES ("storage_type"="column")
--------------------
CREATE TABLE example_db.table_hash (
	k1 TINYINT,
	k2 DECIMAL(10, 2) DEFAULT "10.5",
	v1 CHAR(10) REPLACE,
	v2 INT SUM,
	INDEX k1_idx(k1) USING BITMAP COMMENT 'xxxxxx'
) ENGINE = olap
AGGREGATE KEY (k1, k2)
COMMENT "my first starrocks table"
DISTRIBUTED BY HASH (k1)
PROPERTIES (
	"storage_type" = "column"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE example_db.dynamic_partition
(
    k1 DATE,
    k2 INT,
    k3 SMALLINT,
    v1 VARCHAR(2048),
    v2 DATETIME DEFAULT "2014-02-04 15:36:00"
)
ENGINE=olap
DUPLICATE KEY(k1, k2, k3)
PARTITION BY RANGE (k1)
(
    PARTITION p1 VALUES LESS THAN ("2014-01-01"),
    PARTITION p2 VALUES LESS THAN ("2014-06-01"),
    PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH(k2)
PROPERTIES(
    "storage_medium" = "SSD",
    "dynamic_partition.enable" = "true",
    "dynamic_partition.time_unit" = "DAY",
    "dynamic_partition.start" = "-3",
    "dynamic_partition.end" = "3",
    "dynamic_partition.prefix" = "p",
    "dynamic_partition.buckets" = "10"
)
--------------------
CREATE TABLE example_db.dynamic_partition (
	k1 DATE,
	k2 INT,
	k3 SMALLINT,
	v1 VARCHAR(2048),
	v2 DATETIME DEFAULT "2014-02-04 15:36:00"
) ENGINE = olap
DUPLICATE KEY (k1, k2, k3)
PARTITION BY RANGE (k1) (
	PARTITION p1 VALUES LESS THAN ("2014-01-01"),
	PARTITION p2 VALUES LESS THAN ("2014-06-01"),
	PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH (k2)
PROPERTIES (
	"storage_medium" = "SSD",
	"dynamic_partition.enable" = "true",
	"dynamic_partition.time_unit" = "DAY",
	"dynamic_partition.start" = "-3",
	"dynamic_partition.end" = "3",
	"dynamic_partition.prefix" = "p",
	"dynamic_partition.buckets" = "10"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE site_access (
    datekey INT,
    site_id INT,
    city_code SMALLINT,
    user_name VARCHAR(32),
    pv BIGINT DEFAULT '0'
)
ENGINE=olap
DUPLICATE KEY(datekey, site_id, city_code, user_name)
PARTITION BY RANGE (datekey) (START ("1") END ("5") EVERY (1)
)
DISTRIBUTED BY HASH(site_id)
PROPERTIES ("replication_num" = "3")
--------------------
CREATE TABLE site_access (
	datekey INT,
	site_id INT,
	city_code SMALLINT,
	user_name VARCHAR(32),
	pv BIGINT DEFAULT '0'
) ENGINE = olap
DUPLICATE KEY (datekey, site_id, city_code, user_name)
PARTITION BY RANGE (datekey) (
	START ("1") END ("5") EVERY (1)
)
DISTRIBUTED BY HASH (site_id)
PROPERTIES (
	"replication_num" = "3"
)
------------------------------------------------------------------------------------------------------------------------
CREATE TEMPORARY TABLE example_db.temp_table
(
    k1 DATE,
    k2 INT,
    k3 SMALLINT,
    v1 VARCHAR(2048),
    v2 DATETIME DEFAULT "2014-02-04 15:36:00"
)
ENGINE=olap
DUPLICATE KEY(k1, k2, k3)
PARTITION BY RANGE (k1)
(
    PARTITION p1 VALUES LESS THAN ("2014-01-01"),
    PARTITION p2 VALUES LESS THAN ("2014-06-01"),
    PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH(k2)
--------------------
CREATE TEMPORARY TABLE example_db.temp_table (
	k1 DATE,
	k2 INT,
	k3 SMALLINT,
	v1 VARCHAR(2048),
	v2 DATETIME DEFAULT "2014-02-04 15:36:00"
) ENGINE = olap
DUPLICATE KEY (k1, k2, k3)
PARTITION BY RANGE (k1) (
	PARTITION p1 VALUES LESS THAN ("2014-01-01"),
	PARTITION p2 VALUES LESS THAN ("2014-06-01"),
	PARTITION p3 VALUES LESS THAN ("2014-12-01")
)
DISTRIBUTED BY HASH (k2)
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE order_new
AS SELECT * FROM order
--------------------
CREATE TABLE order_new
AS
SELECT *
FROM order
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE customers_new 
(   customer_id_new,
    first_name_new,
    INDEX idx_bitmap_customer_id (customer_id_new) USING BITMAP
) 
AS SELECT customer_id,first_name FROM customers
--------------------
CREATE TABLE customers_new (
	customer_id_new,
	first_name_new,
	INDEX idx_bitmap_customer_id(customer_id_new) USING BITMAP
)
AS
SELECT customer_id, first_name
FROM customers
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE customers_pk
PRIMARY KEY (customer_id)
ORDER BY (first_name,last_name)
AS SELECT  * FROM customers
--------------------
CREATE TABLE customers_pk
PRIMARY KEY (customer_id)
ORDER BY (first_name, last_name)
AS
SELECT *
FROM customers
------------------------------------------------------------------------------------------------------------------------
CREATE TABLE employee_new
PRIMARY KEY (order_id)
AS SELECT
    order_list.order_id,
    sum(goods.price) as total
FROM order_list INNER JOIN goods ON goods.item_id1 = order_list.item_id2
GROUP BY order_id
--------------------
CREATE TABLE employee_new
PRIMARY KEY (order_id)
AS
SELECT order_list.order_id, sum(goods.price) AS total
FROM order_list
	INNER JOIN goods ON goods.item_id1 = order_list.item_id2
GROUP BY order_id