drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya <adityakish...@gmail.com>
Subject Re: Convert Base64 to varbinary function
Date Wed, 05 Nov 2014 07:43:34 GMT
Hi Mehdi,

As you might have already noticed, the flatten()[1] operator has recently
been
made available in Drill.

However, encoder and decoder for Base64 is missing. If you are interested,
you could implement convert_to(<VARCHAR>, 'BASE64'), i.e. decoder and
convert_from(<VARBINARY>, 'BASE64'), i.e. encoder functions.

Please take a look at [2] for examples on writing convert_xxxxx() functions.

[1] https://issues.apache.org/jira/browse/DRILL-1333
[2]
https://github.com/apache/incubator-drill/blob/c1c0eba5bad30a433161ebf4e1b6c36ace2a881e/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/impl/conv/JsonConvertTo.java

aditya...

On Tue, Nov 4, 2014 at 10:44 PM, Mehdi Chitforoosh <
mehdichitforoosh@gmail.com> wrote:

> Hi.
> Adity,
> I will read the source code and tell you the details for Hbase 0.98.
> Another Problem I want to work on:
> Write a function to convert a Base64 encoded bytes to Varbinary like Apache
> Hive.
> Hive uses Base64 in Array<Binary> and a delimiter {0x02} .
> Hive uses explode() that flatten array and change Base64 to Binary.
> this function can be helpful in nested array.especially in one to many
> relationships.
> For example:
> we have a one to many relationship between Table ONE and Table MANY.
> Table ONE has many entities of MANY.Convert  MANY entitiy ids(byte[]) to
> Base64 and nested in a hbase column with an
> array,['AUl+g0XMAAEAAQ==','AUl+g0XMAAEAEQ==']
> Table ONE:
> i:many:['AUl+g0XMAAEAAQ==','AUl+g0XMAAEAEQ==']
>
> select * from (select base64converter(c.b) AS bc from (select
> flatten(oneside.i.many) AS b from hbase.one) as c)) as one
> join (select many.row_key AS t from hbase.many) as many on one.bc=many.t;
>
> Do you have a suggestion?
> Thank you.
>
>
> --
> Mehdi Chitforoosh
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message