hive导出数据到mysql时能排序吗
发布网友
发布时间:2022-05-02 16:36
我来回答
共2个回答
懂视网
时间:2022-05-02 20:57
.3.jar;
add jar /opt/local/hive/lib/mysql-connector-java-5.1.35-bin.jar;
CREATE TEMPORARY FUNCTION dboutput AS ‘org.apache.hadoop.hive.contrib.genericudf.example.GenericUDFDBOutput‘;
2. dboutput使用方法
创建function实现hive表结果导出到mysql
标签:sql style ora 需要 gen 开发 pac tput UNC
热心网友
时间:2022-05-02 18:05
一、创建mysql表
mysql> create table award (rowkey varchar(255), proctid int, matchid varchar(255), rank varchar(255), tourneyid varchar(255), userid bigint, gameid int, gold int, loginid varchar(255), nick varchar(255), plat varchar(255));
Query OK, 0 rows affected (0.01 sec)
二、尝试用hive作为外部数据库连接hbase,导入mysql
hive> CREATE EXTERNAL TABLE hive_award(key string, proctid int,matchid string, rank string, tourneyid string, userid bigint,gameid int,gold int,loginid string,nick string,plat string) STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' WITH SERDEPROPERTIES ("hbase.columns.mapping" = ":key,info:MPID,info:MatchID,info:Rank,info:TourneyID,info:UserId,info:gameID,info:gold,info:loginId,info:nickName,info:platform") TBLPROPERTIES("hbase.table.name" = "award");
hive> desc hive_award;
key string from deserializer
proctid int from deserializer
matchid string from deserializer
rank string from deserializer
tourneyid string from deserializer
userid bigint from deserializer