Review Board 1.7.22


HIVE-3951: Allow Decimal type columns in Regex Serde

Review Request #9173 - Created Jan. 31, 2013 and submitted

Mark Grover
trunk
HVIE-3951
Reviewers
hive
hive-git
Add support for RegexSerde to support newly added Decimal type
Added a client positive test
ql/src/test/queries/clientpositive/serde_regex.q
Revision c3254ca New Change
[20] 36 lines
[+20]
37
SELECT * FROM serde_regex ORDER BY time;
37
SELECT * FROM serde_regex ORDER BY time;
38

    
   
38

   
39
SELECT host, size, status, time from serde_regex ORDER BY time;
39
SELECT host, size, status, time from serde_regex ORDER BY time;
40

    
   
40

   
41
DROP TABLE serde_regex;
41
DROP TABLE serde_regex;

    
   
42

   

    
   
43
EXPLAIN

    
   
44
CREATE TABLE serde_regex1(

    
   
45
  key decimal,

    
   
46
  value int)

    
   
47
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'

    
   
48
WITH SERDEPROPERTIES (

    
   
49
  "input.regex" = "([^ ]*) ([^ ]*)"

    
   
50
)

    
   
51
STORED AS TEXTFILE;

    
   
52

   

    
   
53
CREATE TABLE serde_regex1(

    
   
54
  key decimal,

    
   
55
  value int)

    
   
56
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'

    
   
57
WITH SERDEPROPERTIES (

    
   
58
  "input.regex" = "([^ ]*) ([^ ]*)"

    
   
59
)

    
   
60
STORED AS TEXTFILE;

    
   
61

   

    
   
62
LOAD DATA LOCAL INPATH "../data/files/kv7.txt" INTO TABLE serde_regex1;

    
   
63

   

    
   
64
SELECT key, value FROM serde_regex1 ORDER BY key;

    
   
65

   

    
   
66
DROP TABLE serde_regex1;
ql/src/test/results/clientpositive/serde_regex.q.out
Revision a933538 New Change
 
serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java
Revision 9317a6c New Change
 
  1. ql/src/test/queries/clientpositive/serde_regex.q: Loading...
  2. ql/src/test/results/clientpositive/serde_regex.q.out: Loading...
  3. serde/src/java/org/apache/hadoop/hive/serde2/RegexSerDe.java: Loading...