Apache的配置单元SERDE正则表达式:数据类型 [英] Apache Hive regEx serde: data types

查看:273
本文介绍了Apache的配置单元SERDE正则表达式:数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关处理日志,我想使用Apache蜂巢SERDE正则表达式,但我只发现使用String作为数据类型的表列的例子。

For processing logs I want to use Apache Hive regEx serde but I only found examples that use String as datatype for the columns of the table.

现在我的问题是:datebased支持的类型和整数和数组或只是字符串

Now my question is: are datebased types and integers and arrays supported or is it just strings?

这个例子(和其他人)只使用字符串:

This example (and others) only uses strings:

CREATE TABLE access_log (
  remote_ip STRING,
  request_date STRING,
  method STRING,
  request STRING,
  protocol STRING
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES  (
"input.regex" = "([^ ]) . . [([^]]+)] \"([^ ]) ([^ ]) ([^ \"])\" *",
"output.format.string" = "%1$s %2$s %3$s %4$s %5$s"
)
STORED AS TEXTFILE

推荐答案

希望这有助于:)

这篇关于Apache的配置单元SERDE正则表达式:数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆