Is there any way to run impala shell with sql script with parameters?

Is there any way to run impala shell with SQL script with parameters?

For example:

impala-shell -f /home/john/sql/load.sql /dir1/dir2/dir3/data_file

I got errors:

Error, could not parse arguments "-f /home/john/sql/load.sql /dir1/dir2/dir3/data_file”

Answers


No, you can specify a file of sql statements with -f, but it does not take a file of parameters. See the impala-shell documentation for more details: http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/impala_impala_shell.html


This feature is available in CDH 5.7 / Impala 2.5 and higher.

The --var option lets you pass substitution variables to the statements that are executed by that impala-shell session, for example the statements in a script file processed by the -f option. You encode the substitution variable on the command line using the notation --var=variable_name=value. Within a SQL statement, you substitute the value by using the notation ${var:variable_name}.

See more details directly in the documentation : https://www.cloudera.com/documentation/enterprise/latest/topics/impala_set.html


Need Your Help

NSOperationQueue operations filteredArrayUsingPredicate error

iphone ios nspredicate nsoperation nsoperationqueue

I have class MyOperation : NSOperation with @property (nonatomic, retain) NSString *oID;

error when connecting solr to mysql

java mysql apache tomcat solr

I was able to install Tomcat and solr, and I can view the solr dashboard at SERVERIP:8080/solr