I will try the split_part function myself to see if I can reproduce your
issue. And I couldn't see the query which references the output of split
function. Something like the below should work
SELECT
d.columns_arr[0],
d.columns_arr[1]FROM (SELECT
split(CONVERT_FROM(binary_value, 'UTF8'), chr
Thanks, SPLIT_PART looks useful.
0: jdbc:drill:zk=cdh57-01-node-01.moffatt.me:> select
split_part(version,'.',1),split_part(version,'.',2),split_part(version,'.',3)
from sys.version;
+-+-+-+
| EXPR$0 | EXPR$1 | EXPR$2 |
+-+-+-+
| 1 | 7
Also you can refer to [1] for the list of string functions implemented.
[1]
https://github.com/apache/drill/blob/master/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/StringFunctions.java
On Tue, Aug 30, 2016 at 11:06 AM, rahul challapalli <
challapallira...@gmail.com> wrote:
>
You should be able to use split_part function (I haven't tried it
myself...but it is supported). With this function you can extract
individual columns. Unfortunately I couldn't find the documentation for
this function as well. But it should be similar to how other databases
implement this function.
Hi,
Thanks - I think SPLIT gets me some of the way, but after the FLATTEN I
want to PIVOT, so instead of :
0: jdbc:drill:zk=cdh57-01-node-01.moffatt.me:> select
flatten(split(version,'.')) from sys.version;
+-+
| EXPR$0 |
+-+
| 1 |
| 7 |
| 0 |
+-+
I'd g
If the column is delimited by some character, you can use the SPLIT()
function to separate the value into an array of values. You can then use
the FLATTEN() function to separate the array of values into individual
records.
E.g., if your column has the value "a:b", where your delimiter is ":", you
Hi,
I'm trying to read a sequence file, in which the key is null and the value
holds multiple columns [1], delimited by \x01. In Hive I simply define it
as :
CREATE EXTERNAL TABLE foo (col1 string, col2 string, col3 timestamp)
ROW FORMAT DELIMITED
STORED as sequencefile
LOCATION '/user/oracle/foo