Kel*_*ton 3 amazon-web-services amazon-athena
这是我第一次尝试在Athena中制作自己的表,所以请保持谨慎:)我在此数据库中运行的基于AWS示例的其他几个表没有问题,因此我相信数据库已正确设置。
另外,我敢肯定,我的正则表达式是残酷的,请尽量忽略它!
我有存储在S3有些VPC流量日志,日志文件的格式为:
2 123456654321 eni-ae343be4 100.75.233.178 172.31.26.162 49178 80 6 6 270 1488872163 1488872180 ACCEPT OK
2 123456654321 eni-ae343be4 100.75.233.178 172.31.26.162 64013 80 6 2 84 1488872163 1488872180 ACCEPT OK
2 123456654321 eni-ae343be4 206.97.36.202 172.31.26.162 33164 445 6 2 96 1488872163 1488872180 REJECT OK
Run Code Online (Sandbox Code Playgroud)
我有我的基础上表的发布在AWS实例。我创建的查询是:
CREATE EXTERNAL TABLE IF NOT EXISTS flow_logs_raw_native (
version int,
account-id bigint,
interface-id string,
srcaddr string,
dstaddr string,
srcport int,
dstport int,
protocol int,
packets int,
bytes int,
Tstart bigint,
Tend bigint,
action string,
log-status string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1','input.regex' = '([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*)' ) LOCATION 's3://vpcflowlogstos3-bucket-1ns5peqxgc31n/flowlogs/';
Run Code Online (Sandbox Code Playgroud)
我每次运行查询我收到一个错误:
line 1:8: no viable alternative at input 'create external' (service: amazonathena; status code: 400; error code: invalidrequestexception; request id: b0cfde99-031c-11e7-b4de-4139fae95147)
Run Code Online (Sandbox Code Playgroud)
我已经研究了几个小时,试图查找拼写错误或元素丢失,但是我被卡住了!谁能看到这里有什么问题吗?
谢谢,
凯利。
| 归档时间: |
|
| 查看次数: |
6804 次 |
| 最近记录: |