栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Hologres使用小记

Hologres使用小记

1、Hologres 0.8 创建数组类型外部表采坑

ODPS:CREATE TABLE `test_clue` ( `id_c` array, `name` array ) ;

Holo:

CREATE FOREIGN TABLE test_clue(

id int8[],

name text[])

SERVER odps_server

OPTIONS(project_name 'itsl_dev', table_name 'test_clue');

报错:

 原因:odps文件类型不是orc

odps的文件类型有哪些:??aliorc

hive的文件存储类型:

||SequenceFile
Hadoop用来存储二进制形式的[Key,Value]对而设计的一种平面文件(Flat File)。

||TextFile文本格式

||RCFile一种列存储格式

||ORC ★一种列存储格式 进阶版RCFile

||Parquet ★一种列存储格式AVRO

||JsonFile(json文件)

||InputFormat

解决办法:

odps建表前加:

set odps.sql.default.file.format=aliorc;

set odps.storage.force.aliorc=true;

CREATE TABLE `test_clue` ( `id_c` array, `name` array ) ;

2、Hologres 0.8 使用get_json_object函数

先用super账号设置开启hive函数支持:CREATE extension hive_compatible;

SELECt

get_json_object(message,'$.profileData.advertisingID') AS advertisingID

,get_json_object(message,'$.profileData.appKey') AS appkey

,get_json_object(message,'$.profileData.identityId') AS identityId

,get_json_object(message,'$.profileData.productid') AS productid

,get_json_object(message,'$.profileData.properties._td_mobile') AS td_mobile

,get_json_object(message,'$.profileData.properties._td_pixel') AS td_pixel

,get_json_object(message,'$.profileData.properties._td_platform') AS td_platform

,get_json_object(message,'$.profileData.properties._td_brand') AS td_brand

,get_json_object(message,'$.profileData.properties.tenantid') AS tenantid

,get_json_object(message,'$.profileData.properties._td_os') AS td_os

,get_json_object(message,'$.type') AS TYPE

,get_json_object(message,'$.version') AS version

,get_json_object(message,'$.profileData.properties._td_sdk_source') AS td_sdk_source

,get_json_object(message,'$.profileData.properties._td_browser') AS td_browser

,get_json_object(message,'$.profileData.properties._td_channel') AS td_channel

FROM ti_datahub_ae_collector_data_4h

;

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/604308.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号