Hello! I'm trying to create a table using RegexSerDe. But I'm completely lost on the string escape rules for hive:
create table alerts (tstamp STRING, host STRING, service STRING, status STRING) CLUSTERED BY(host, service) SORTED BY (tstamp) INTO 1024 BUCKETS ROW FORMAT SERDE 'org.apache.hadoop.hive.contrib.serde2.RegexSerDe' WITH SERDEPROPERTIES ("input.regex" = "\\[([^\\]]*)\\] SERVICE ALERT: ([^;]*);([^;]*);([^;]*).*") STORED AS SEQUENCEFILE; FAILED: Parse Error: line 3:41 mismatched input '[' expecting StringLiteral in specifying key/value property I tested the Regex both in pcre and java (pcre minus one '\') and both seem to work nicely. I can however supply regexes from other hive examples (using "\\[" syntax) and these work nicely. So what's the trick? Thanks. Kind regards, Mark