Re: how to read array enclosed within square brackets

2014-09-23 Thread Ankita Bakshi
Thanks Xuefu. I was hoping I don't have to do that. We create this file by serializing java array so was hoping that it would be a common case to handle arrays with square brackets. Thanks, Ankita On Mon, Sep 22, 2014 at 7:55 PM, Xuefu Zhang wrote: > Hive doesn't know it needs to skip your squa

Re: how to read array enclosed within square brackets

2014-09-22 Thread Xuefu Zhang
Hive doesn't know it needs to skip your square brackets, so you numbers are really [1, 2, and 3]. [1 and 3] cannot be parsed to numbers, so they become null. I think you interpret the second column as [1, 2, 3] of type string. Then you can remove the brackets, and use a UDF (write your own if the

how to read array enclosed within square brackets

2014-09-22 Thread Ankita Bakshi
Hi, I have '|' delimited file where arrays are serialized with square brackets. I am trying create a hive table to parse this file. Example: first|[1,2,3]|100 second|[11,12,13]|200 Create External Table H_histoTest(dim1 string, hist ARRAY, measure1 bigint) ROW FORMAT DELIMITED FIELDS TERMIN