You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Uli Bethke <ul...@sonra.io> on 2015/06/09 13:49:29 UTC

from_unixtime in drill explorer/ODBC

The following query run through Drill Explorer/ODBC returns NULL, while running
it from SQLLINE it works fine.

select from_unixtime(1432912733) from `sys`.`version`;

Is this a limitation of the ODBC driver?
Running on Drill 1.0.0 on Windows in Embedded mode. Using 1.0.0 ODBC driver

Re: from_unixtime in drill explorer/ODBC

Posted by Jason Altekruse <al...@gmail.com>.
This is pretty well implied with Christopher's message, but Drill ships
with a Hive storage plugin which puts Hive jars on the default class path.
Just as with Drill native UDFs we pick up the default Hive functions in
these jars and register them. Another one that was causing some issues was
the Hive rand() function, which looks like we are not integrating with
properly. For Drill the random() function can be used instead for the
correct behavior.

On Tue, Jun 9, 2015 at 5:20 AM, Christopher Matta <cm...@mapr.com> wrote:

> The function from_unixtime() is actually a Hive UDF and drill doesn’t yet
> know how to deal with the 2 extra bytes returned from it. It’s better to
> use the Drill function to_timestamp():
>
> select to_timestamp(1432912733) from `sys`.`version`
>
> Chris Mattacmatta@mapr.com
> 215-701-3146
>
> On Tue, Jun 9, 2015 at 7:49 AM, Uli Bethke <ul...@sonra.io> wrote:
>
> The following query run through Drill Explorer/ODBC returns NULL, while
> > running
> > it from SQLLINE it works fine.
> >
> > select from_unixtime(1432912733) from `sys`.`version`;
> >
> > Is this a limitation of the ODBC driver?
> > Running on Drill 1.0.0 on Windows in Embedded mode. Using 1.0.0 ODBC
> driver
>
> ​
>

Re: from_unixtime in drill explorer/ODBC

Posted by Christopher Matta <cm...@mapr.com>.
The function from_unixtime() is actually a Hive UDF and drill doesn’t yet
know how to deal with the 2 extra bytes returned from it. It’s better to
use the Drill function to_timestamp():

select to_timestamp(1432912733) from `sys`.`version`

Chris Mattacmatta@mapr.com
215-701-3146

On Tue, Jun 9, 2015 at 7:49 AM, Uli Bethke <ul...@sonra.io> wrote:

The following query run through Drill Explorer/ODBC returns NULL, while
> running
> it from SQLLINE it works fine.
>
> select from_unixtime(1432912733) from `sys`.`version`;
>
> Is this a limitation of the ODBC driver?
> Running on Drill 1.0.0 on Windows in Embedded mode. Using 1.0.0 ODBC driver

​