title: how to run .sql file in hive shell
body: <p>i was trying to run .sql file in hive shell like below. But getting the error below.</p>
  
  <pre><code>hive&gt; hive -f /home/centos/DB2.sql;
  NoViableAltException(24@[])
          at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1300)
          at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:204)
          at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:77)
          at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:70)
          at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:468)
          at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1316)
          at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1456)
          at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1236)
          at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1226)
          at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:233)
          at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:184)
          at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
          at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:821)
          at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:759)
          at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
          at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
  FAILED: ParseException line 1:0 cannot recognize input near 'hive' '-' 'f'
  </code></pre>
  
  <p>The sql file has the DDL queries.</p>