我在hive中有一个外部表
CREATE EXTERNAL TABLE FOO (
TS string,
customerId string,
products array< struct <productCategory:string, productId:string> >
)
PARTITIONED BY (ds string)
ROW FORMAT SERDE 'some.serde'
WITH SERDEPROPERTIES ('error.ignore'='true')
LOCATION 'some_locations'
;
Run Code Online (Sandbox Code Playgroud)
该表的记录可能包含以下数据:
1340321132000, 'some_company', [{"productCategory":"footwear","productId":"nik3756"},{"productCategory":"eyewear","productId":"oak2449"}]
Run Code Online (Sandbox Code Playgroud)
有没有人知道是否有办法简单地从该记录中提取所有productCategory并将其作为productCategories数组返回,而不使用explode.类似于以下内容:
["footwear", "eyewear"]
Run Code Online (Sandbox Code Playgroud)
或者我是否需要编写自己的GenericUDF,如果是这样,我不太了解Java(一个Ruby人),有人可以给我一些提示吗?我从Apache Hive读了一些关于UDF的说明.但是,我不知道哪种集合类型最适合处理数组,以及处理结构的集合类型是什么?
===
我通过编写GenericUDF来回答这个问题,但我遇到了另外两个问题.正是在这个SO问题中
嗨第一次调查Node.js应用程序中的内存泄漏.通过Chrome Profiler中的heapdump快照读取,我看到(编译代码)有一个条目,请参阅附件.我认为Javascript不是编译的,与Java不同.有人可以点灯吗?

此外,与JProfiler不同,并且编写代码的方式(没有正式的构造函数),很难找到泄漏,到目前为止快照提供的信息并不是很有用,我已经搜索了一段时间,到目前为止还没有有关阅读这些快照的有用信息,有什么建议吗?
谢谢!