You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by Apache Wiki <wi...@apache.org> on 2009/07/24 06:45:22 UTC
[Hadoop Wiki] Update of "Hive/UserGuide" by ZhengShao
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.
The following page has been changed by ZhengShao:
http://wiki.apache.org/hadoop/Hive/UserGuide
------------------------------------------------------------------------------
==== Apache Access Log Tables ====
{{{
+ add jar ../build/contrib/hive_contrib.jar;
+
CREATE TABLE apachelog (
- ipaddress STRING, identd STRING, user STRING,finishtime STRING,
- requestline string, returncode INT, size INT)
+ host STRING,
+ identity STRING,
+ user STRING,
+ time STRING,
+ request STRING,
+ status STRING,
+ size STRING,
+ referer STRING,
+ agent STRING)
- ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.dynamic_type.DynamicSerDe'
+ ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
+ "input.regex" = "([^ ]*) ([^ ]*) ([^ ]*) (-|\\[[^\\]]*\\]) ([^ \"]*|\"[^\"]*\") (-|[0-9]*) (-|[0-9]*)(?: ([^ \"]*|\"[^\"]*\") ([^ \"]*|\"[^\"]*\"))?",
+ "output.format.string" = "%1$s %2$s %3$s %4$s %5$s %6$s %7$s %8$s %9$s"
+ )
- 'serialization.format'='org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol',
- 'quote.delim'='("|\\[|\\])',
- 'field.delim'=' ',
- 'serialization.null.format'='-')
STORED AS TEXTFILE;
}}}
@@ -38, +46 @@
{{{
CREATE TABLE mylog (
name STRING, language STRING, groups ARRAY<STRING>, entities MAP<INT, STRING>)
+ ROW FORMAT DELIMITED
+ FIELDS TERMINATED BY '\001'
+ COLLECTION ITEMS TERMINATED BY '\002'
+ MAP KEYS TERMINATED BY '\003'
- ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.dynamic_type.DynamicSerDe'
- WITH SERDEPROPERTIES (
- 'serialization.format'='org.apache.hadoop.hive.serde2.thrift.TCTLSeparatedProtocol',
- 'field.delim'='\001', 'collection.delim'='\004',
- mapkey.delim='\002', linedelim='\n')
STORED AS TEXTFILE;
}}}