I want to pass one path from spark submit command while loading data from one file to hive table. I am trying pass that path using below code but its showing mismatch input '$' expecting StringLiteral Inpath near 'inpath' in load statement.
obj hive_scala{
def main(args:Array[String]){
// creating sparksession
val dbsession=HiveWareHouseSession.session(sparksession).build()
dbsession.setDatabase("dbname")
if(args.length<1){
System.exit(1)
}
var a="load data inpath $args(0) into table tablename";
val b=dbsession.executeUpdate(a)
}
}
then using below spark submit command: spark-submit --class classname projectjar location(from here i need to load data into table) can anyone suggest how should i pass this path using spark-submit and what code needs to change in scala.