Member since
11-10-2017
2
Posts
0
Kudos Received
0
Solutions
11-01-2018
12:40 PM
I think I find the answer. The reason that String command = "hive -f /hive/scripts/test.hql";
p =Runtime.getRuntime().exec(command); or String command = "sh hive -f /hive/scripts/test.hql";
p =Runtime.getRuntime().exec(command); can't work is: the Runtime.getRuntime().exec() method bring the full string to bash. But the bash parser can't understand the command. Bash parser need to parse the command step by step:
Read data to execute Process quotes Split the read data into commands Parse special operators Perform expansions Split the command into a command name and arguments Execute the command A full string can't be parsed.
... View more