I am a newbie of Apache Drill, and I need to run a SQL script through sqlline. In most SQL client, it is allowed to use some variables in sqlline, so hereby I would like to ask that is it possible to use variables in sqlline of Apache Drill?
Apache Drill > sqlline: how to run a sql script containing variable
3.3k Views Asked by Rui At
2
There are 2 best solutions below
0

Here's a real world example where I substitute all occurrences of the text 'staticLoadTime' in a drill file with the variable ${staticLoadTime} using sed and then pipe the result to sqlline. This avoids having to create a wrapper or other temporary file.
sed 's/staticLoadTime/${staticLoadTime}/g' ${Source}.drill | sqlline -u jdbc:drill:zk=local
Someone asked a similar question on Drill user mailing list. Here is the answer from the same link: