You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by 肖辉 <xi...@163.com> on 2020/05/19 07:39:53 UTC

one question about using pipe in drill

Hi, when i use drill, i can inquire successfully in the drill shell. However, now i want to inquire data in the format of the script, it failed.
when i transfer command to dirll through the pipe, it failed and quit immediately like the following picture:
my script is a simple sentence like
but when i remove the pipe, it can access into drill successfully. How can i use script to inquire and export data successfully in drill? Thanks and waiting for your advice sincerely.

Re: one question about using pipe in drill

Posted by Paul Rogers <pa...@gmail.com>.
Try doing sqlline -? to get the help. I didn't see anything for reading
from a piped stdin, but you can read from and write to a file:

-f <file>                       script file to execute (same as --run)

-log <file>                     file to write output

- Paul

On Tue, May 19, 2020 at 8:15 AM Charles Givre <cg...@gmail.com> wrote:

> Hi there,
> You might first want to take a look at the docs for sqlline:
> http://sqlline.sourceforge.net/#introduction <
> http://sqlline.sourceforge.net/#introduction>
> I don't really think it is meant to be used in that manner.  I'd suggest
> writing a simple python script using PyDrill that accepts a query as input
> and outputs the result in the format that you need.
> Best,
> -- C
>
>
> > On May 19, 2020, at 3:39 AM, 肖辉 <xi...@163.com> wrote:
> >
> > Hi, when i use drill, i can inquire successfully in the drill shell.
> However, now i want to inquire data in the format of the script, it failed.
> > when i transfer command to dirll through the pipe, it failed and quit
> immediately like the following picture:
> >
> > my script is a simple sentence like
> >
> > but when i remove the pipe, it can access into drill successfully. How
> can i use script to inquire and export data successfully in drill? Thanks
> and waiting for your advice sincerely.
> >
> >
> >
>
>

Re: one question about using pipe in drill

Posted by Charles Givre <cg...@gmail.com>.
Hi there,
You might first want to take a look at the docs for sqlline: http://sqlline.sourceforge.net/#introduction <http://sqlline.sourceforge.net/#introduction>
I don't really think it is meant to be used in that manner.  I'd suggest writing a simple python script using PyDrill that accepts a query as input and outputs the result in the format that you need.
Best,
-- C


> On May 19, 2020, at 3:39 AM, 肖辉 <xi...@163.com> wrote:
> 
> Hi, when i use drill, i can inquire successfully in the drill shell. However, now i want to inquire data in the format of the script, it failed.
> when i transfer command to dirll through the pipe, it failed and quit immediately like the following picture:
> 
> my script is a simple sentence like
> 
> but when i remove the pipe, it can access into drill successfully. How can i use script to inquire and export data successfully in drill? Thanks and waiting for your advice sincerely.
> 
> 
>