Re: difference between cast as timestamp and to_timestamp

2018-07-09 Thread Chris Cunningham
Hi Divya,
TO_TIMESTAMP takes varchar (string) input to convert to timestamps, not
numbers.
https://drill.apache.org/docs/data-type-conversion/#to_timestamp

Thanks,
Chris

On Wed, Jul 4, 2018 at 2:57 AM Divya Gehlot  wrote:

> Hi ,
> But Why I get the timestamp in below format
>
> 2018-07-03T07:00:00.049-05:00
>
> while you get in  2018-07-03 00:00:00.0
> do I need to make any config changes for it ?
>
> Why the Query 3 still gives me error
> select TO_TIMESTAMP(1530601200049/1000,'-MM-dd HH:mm:ss') from
> (values(1));
> Apache Drill
> org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR:
> IllegalArgumentException: Invalid format: "1530601200" is malformed at "0"
> [Error Id: ca3236d5-e99b-4a72-a915-8d4fe64afee6 on :31010]
>
> Doesn't it works this way ?
>
> Thanks,
> Divya
>
> On Wed, 4 Jul 2018 at 02:30, Arjun kr  wrote:
>
> > TO_TIMESTAMP function accepts epoch timestamp in seconds. Whereas cast to
> > Timestamp seems to be expecting value in milliseconds.
> >
> >
> >
> > 0: jdbc:drill:> select TO_TIMESTAMP(1530601200049/1000) from (values(1));
> > ++
> > | EXPR$0 |
> > ++
> > | 2018-07-03 00:00:00.0  |
> > ++
> > 1 row selected (0.297 seconds)
> > 0: jdbc:drill:>
> >
> > Thanks,
> >
> > Arjun
> >
> > 
> > From: Divya Gehlot 
> > Sent: Tuesday, July 3, 2018 8:51 PM
> > To: user@drill.apache.org
> > Subject: difference between cast as timestamp and to_timestamp
> >
> > Hi,
> > Below gives me different values
> > Query 1:
> > select CAST(1530601200049 AS TimeStamp) from (values(1));
> > EXPR$0
> > 2018-07-03T07:00:00.049-05:00
> >
> > Query 2:
> > select TO_TIMESTAMP(1530601200049) from (values(1));
> > Apache Drill
> > 50472-10-26T11:00:49.000-05:00
> >
> > Query 3 :
> > select TO_TIMESTAMP(1530601200049,'-MM-dd HH:mm:ss') from
> (values(1));
> > Error :
> > Apache Drill
> > org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR:
> > IllegalArgumentException: Invalid format: "1530601200049" is malformed at
> > "0049" [Error Id: 03ac470f-e959-41c4-beba-5f3827815709 on :31010]
> >
> > Why get I different values?
> >
> > Thanks,
> > Divya
> >
>


Re: Drill on Windows

2018-04-20 Thread Chris Cunningham
Hi Tim,
I would appreciate this as well.  Thank you for offering.
-Chris

On Fri, Apr 20, 2018 at 4:54 AM, Rahul Raj 
wrote:

> Thanks for the inputs.
>
> Tim, would really appreciate if you could get the docker image done.
>
> Regards,
> Rahul
>
> On Fri, Apr 20, 2018 at 9:43 AM, scott  wrote:
>
> > Tim,
> >
> > As it turns out, I was just out there looking for an official docker
> image
> > today, and was a little disappointed there wasn't one. It's not that hard
> > to make my own, but always preferable to me to use an official image
> where
> > I can just control it using parameters.
> >
> > Would be much appreciated if you built one.
> >
> >
> > Scott
> >
> >
> >
> > On 04/19/2018 11:21 AM, Timothy Farkas wrote:
> >
> >> Rahul / Chris,
> >>
> >> The easiest way to do this would be to create a docker container for
> >> Drill. Also it looks like Docker leverage's Windows 10's linux
> subsystem so
> >> docker images don't run in a VM https://www.hanselman.com/blog
> >> /DockerAndLinuxContainersOnWindowsWithOrWithoutHyperVVirtualM
> achines.aspx.
> >> So you get support for running on Windows 10 for free with no
> performance
> >> penalty. Plus everyone expects software to be package in docker images
> >> these days anyway.
> >>
> >> Currently, there is no official drill docker image. If you're
> interested,
> >> let me know, and I can create a Jira and make one. I'm pretty bored
> right
> >> now and need something to do anyway :).
> >>
> >> Thanks,
> >> Tim
> >>
> >> ___
>



Re: Drill on Windows

2018-04-18 Thread Chris Cunningham
Supposedly with Windows 10, there is a full Linux subsystem that you can
use.  Note: I haven't done this myself, so I'm not sure what would be
needed (or exactly how it would work).  But it looks like a reasonable
option to pursue.

https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/

This link says background processes aren't possible (which would make this
pointless for drill, right?), but it seems that has been fixed.

On Wed, Apr 18, 2018 at 10:45 AM, Kunal Khatua  wrote:

> I might be wrong, but I think it's partly because of the need for
> Zookeeper on Windows, which is not commonly done.
>
> Other more obvious factors, IMO, are the overhead in creating and
> maintaining *nix shell scripts in Batch files. Linux (Bash) scripts are
> much more powerful with a lot of capabilities to make use of a rich variety
> of utilities that the Linux OS offers. I've worked with Windows batch files
> nearly a decade ago and found it handicapping. Running in Cygwin is one
> low-risk workaround, but no one seems to have done (or shared the process).
>
>
> On 4/18/2018 4:41:11 AM, Rahul Raj 
> wrote:
> Is there any reason why Drill does not run on Windows as standalone? I can
> only see a windows batch file for sqlline.
>
> Will it not work if we get the shell scripts translated to windows as
> cmd/batch files?
>
> Regards,
> Rahul
>
> --
> _*** This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom it is
> addressed. If you are not the named addressee then you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately and delete this e-mail from your system.***_
>


Re: Drill Jdbc filter pushdown

2018-02-22 Thread Chris Cunningham
Hi Rahul,

while you are working on that, might I tempt to you also look at date_add()
and date_sub()?  They behave the same way as the interval issue with the
JDBC plugin - the issue might be similar between the two.

Thanks,
Chris

On Thu, Feb 22, 2018 at 6:12 AM, Rahul Raj 
wrote:

> I am working on a fix for DRILL-5578 which is due to CALCITE-2188.
>
> Query fails when there is a DATE/INTERVAL arithmetic on the where part -
> select  * from actor where  last_update - INTERVAL '20' SECOND > TIMESTAMP
> '2005-10-17 00:00:00"
>
> I have made the changes for ANSI and MySql dialect of calcite. For the rest
> of the dialects, calcite will default to ANSI syntax. Since INTERVAL syntax
> differs between DBs, I want to know what all filters are pushed down to the
> DB by Drill JDBC plugin.
>
> Could you point me to the location in Jdbc plugin?
>
> Thanks,
> Rahul
>
> --
>  This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom it is
> addressed. If you are not the named addressee then you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately and delete this e-mail from your system.
>