oracle、mysql 建表语句转为hql
1、hql需要在表名前加上层级名称. ;建表语句区分一:表名称
create table student -- oracle sql
create table ods.student -- hive sql
2、数据数据类型对应关系;建表语句区分二:字段数据类型对应关系
oracle/mysql hive
varchar(XX) string
number(16) decimal(16,0)
DATE string
3、注释的区别:建表语句区分三:字段注释
-- oracle/mysql 中的注释
uuid varchar2(32) default sys_guid() not null,
comment on column student.uuid
is '主键'
-- hive中的注释
uuid string COMMENT '主键'
4、注释的区别:建表语句区分四:表名建表语句的区别
-- oracle/mysql 中的注释
comment on column student
is '学生表'
-- hive 中的注释
create table student(
uuid string comment '主键'
)comment '学生表' --表的注释在hive建表字段)后