I have two tables one is schools and one is students.I want to find all the students of a particular school. The schema of schools is: id, name, location and of students is :id, name, schoolId. I wrote the following script:
schoolId=$(hive -e "set hive.cli.print.header=false;select id from school;")
hive -hiveconf "schoolId"="$schoolId"
hive>select id,name from student where schoolId like '${hiveconf:schoolId}%'
I dont get any result as schoolId stores all the id together.For example there are 3 schools with id: 123, 256,346 schoolId variable stores as 123 256 346 and the result is null.