Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Not able to insert into correct column when GrokSerde is used

Highlighted

Not able to insert into correct column when GrokSerde is used

New Contributor

Hi , I have a log file which contains data in the following format

1.1.someData.10.4

1.3.someData.true

i have created a table and used GrokSerDe,

CREATE EXTERNAL TABLE `my_table`( col_1 string, col_2 string ) ROW FORMAT SERDE 'com.amazonaws.glue.serde.GrokSerDe' WITH SERDEPROPERTIES ( 'input.grokCustomPatterns' = 'TEST ((?:(?:1)[.](?:1)[.])someData[.]%{GREEDYDATA:col_1}|(?:(?:1)[.](?:3)[.])someData[.]%{GREEDYDATA:col_2})', 'input.format'='%{TEST}' ) STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' LOCATION 's3://location/';

Actual output

col_1 col_2

10.4

true

I expected to be in the following format

col_1 col_2

10.4

true

Don't have an account?
Coming from Hortonworks? Activate your account here