Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass multiple parameter in hive script

Tags:

shell

hive

hiveql

employee: Table data

I want to fetch records of year=2016 by running hive script sample.hql.

use octdb;
select * from '${hiveconf:table}' where year = '${hiveconf:year}';

[cloudera@quickstart ~]$ hive -hiveconf table='employee', year=2016 -f sample.hql

But i am getting error NoViableAltException(307@[]).......

like image 916
Riyaz Khan Avatar asked Dec 07 '22 16:12

Riyaz Khan


1 Answers

You need to use the --hiveconf option twice:

hive --hiveconf table=employee --hiveconf year=2016 -f sample.hql
like image 117
chepner Avatar answered Dec 22 '22 23:12

chepner