You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@drill.apache.org by Divya Gehlot <di...@gmail.com> on 2017/08/03 02:30:26 UTC

pass parameters to Drill query in file

Hi,
how to  pass parameters to Drill query in file?

Thanks,
Divya

RE: pass parameters to Drill query in file

Posted by Kunal Khatua <kk...@mapr.com>.
Drill doesn't support that, but you're welcome to implement that and contribute to Drill. 

A workaround would be to create your own script that takes parameters and writes a SQL file that will then be used by SQLLine to run.

-----Original Message-----
From: Divya Gehlot [mailto:divya.htconex@gmail.com] 
Sent: Sunday, August 06, 2017 6:47 PM
To: user@drill.apache.org
Subject: Re: pass parameters to Drill query in file

I am talking about the parameters in the query itself like

passing the tablename to the query or the directory parameters where the parquet file should be created

Thanks,
Divya

On 3 August 2017 at 12:30, Kunal Khatua <kk...@mapr.com> wrote:

> If you just want to run the query with the parameters like "alter 
> session", you can write those session-altering SQL as the initial set 
> of queries before the actual query in the same file.
>
> Then run something like this:
>
> /opt /drill/apache-drill-1.11.0/bin/sqlline -u "jdbc:drill:zk=local"
> --force true -f <queryFileName>
>
> This opens a session, and runs all the queries (separated by a semi-colon).
>
> The force flag is meant for ensuring that in the event a query within 
> the file fails, it will still continue to execute the following 
> queries in the file.
>
>
> -----Original Message-----
> From: Divya Gehlot [mailto:divya.htconex@gmail.com]
> Sent: Wednesday, August 02, 2017 7:30 PM
> To: user@drill.apache.org
> Subject: pass parameters to Drill query in file
>
> Hi,
> how to  pass parameters to Drill query in file?
>
> Thanks,
> Divya
>

Re: pass parameters to Drill query in file

Posted by Divya Gehlot <di...@gmail.com>.
I am talking about the parameters in the query itself like

passing the tablename to the query or the directory parameters where the
parquet file should be created

Thanks,
Divya

On 3 August 2017 at 12:30, Kunal Khatua <kk...@mapr.com> wrote:

> If you just want to run the query with the parameters like "alter
> session", you can write those session-altering SQL as the initial set of
> queries before the actual query in the same file.
>
> Then run something like this:
>
> /opt /drill/apache-drill-1.11.0/bin/sqlline -u "jdbc:drill:zk=local"
> --force true -f <queryFileName>
>
> This opens a session, and runs all the queries (separated by a semi-colon).
>
> The force flag is meant for ensuring that in the event a query within the
> file fails, it will still continue to execute the following queries in the
> file.
>
>
> -----Original Message-----
> From: Divya Gehlot [mailto:divya.htconex@gmail.com]
> Sent: Wednesday, August 02, 2017 7:30 PM
> To: user@drill.apache.org
> Subject: pass parameters to Drill query in file
>
> Hi,
> how to  pass parameters to Drill query in file?
>
> Thanks,
> Divya
>

RE: pass parameters to Drill query in file

Posted by Kunal Khatua <kk...@mapr.com>.
If you just want to run the query with the parameters like "alter session", you can write those session-altering SQL as the initial set of queries before the actual query in the same file.

Then run something like this:

/opt /drill/apache-drill-1.11.0/bin/sqlline -u "jdbc:drill:zk=local" --force true -f <queryFileName>

This opens a session, and runs all the queries (separated by a semi-colon). 

The force flag is meant for ensuring that in the event a query within the file fails, it will still continue to execute the following queries in the file.


-----Original Message-----
From: Divya Gehlot [mailto:divya.htconex@gmail.com] 
Sent: Wednesday, August 02, 2017 7:30 PM
To: user@drill.apache.org
Subject: pass parameters to Drill query in file

Hi,
how to  pass parameters to Drill query in file?

Thanks,
Divya