目录
1. 数据库选择
选中操作的数据库
USE {table_name};
2. 建表
drop table if exists {table_name};
create table if not exists {table_name}
(
{col_name_1} {col_type_1},
{col_name_2} {col_type_2},
{col_name_2} {col_type_3},
...
)
row format delimited -- 设置分隔符设置开始语句
fields terminated by ',' -- 设置字段与字段之间的分隔符
map keys terminated by ':' -- 设置复杂类型(map)字段的key value之间的分隔符
lines terminated by '\n' -- 设置行与行之间的分隔符
NULL DEFINED AS '' -- 设置NULL为空字符 ''
stored as orc; -- 设置存储格式
3. 插入数据
4. 其他