Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Correct way of using regexserde


Copy link to this message
-
Correct way of using regexserde
Hello list,

         I would really appreciate if someone could show me the correct way
of using regexserde as i'm having some hard time using it. I have verified
my regex through http://www.regexplanet.com/advanced/java/index.html and
it's working fine there. But when i'm using the same pattern with
regexserde i'm getting NULL.

My input looks like this :
<SOME_CHARACTER_STRING>

and I want to extract the characters enclosed between the angle brackets.

This is the command i'm using :
hive> CREATE TABLE s(f1 STRING) ROW FORMAT SERDE
'org.apache.hadoop.hive.contrib.serde2.RegexSerDe'
    > WITH SERDEPROPERTIES ( "input.regex" = "(\\w*)", "output.regex" "%1$s") STORED AS TEXTFILE;

LOAD works fine, but SELECT * gives me NULL.

I am on hadoop-1.0.4 and hive-0.10.0

Thank you so much for you time.
Warm Regards,
Tariq
cloudfront.blogspot.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB