HIVE,Beeline:Error: Error while compiling statement: FAILED: ParseException line 1:0 cannot recognize input near ‘stop’ ‘‘ ‘‘ (state=42000,code=40000)
在使用HIVE的beeline的时候你可能遇到如题所示的问题。
该问题发生在你希望退出HIVE的Beeline命令行的时候,具体如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
[hdfs@cdh1 ~]$ beeline -u jdbc:hive2://cdh1:10000 -n hdfs Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0 scan complete in 3ms Connecting to jdbc:hive2://cdh1:10000 Connected to: Apache Hive (version 1.1.0-cdh5.10.0) Driver: Hive JDBC (version 1.1.0-cdh5.10.0) Transaction isolation: TRANSACTION_REPEATABLE_READ Beeline version 1.1.0-cdh5.10.0 by Apache Hive 0: jdbc:hive2://cdh1:10000> 0: jdbc:hive2://cdh1:10000> exit; Error: Error while compiling statement: FAILED: ParseException line 1:0 cannot recognize input near 'exit' '<EOF>' '<EOF>' (state=42000,code=40000) 0: jdbc:hive2://cdh1:10000> 0: jdbc:hive2://cdh1:10000> quit; Error: Error while compiling statement: FAILED: ParseException line 1:0 cannot recognize input near 'quit' '<EOF>' '<EOF>' (state=42000,code=40000) 0: jdbc:hive2://cdh1:10000> |
其实,正确的退出方法应该是这样的:
1:!quit
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[hdfs@cdh1 ~]$ beeline -u jdbc:hive2://cdh1:10000 -n hdfs Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512M; support was removed in 8.0 scan complete in 3ms Connecting to jdbc:hive2://cdh1:10000 Connected to: Apache Hive (version 1.1.0-cdh5.10.0) Driver: Hive JDBC (version 1.1.0-cdh5.10.0) Transaction isolation: TRANSACTION_REPEATABLE_READ Beeline version 1.1.0-cdh5.10.0 by Apache Hive 0: jdbc:hive2://cdh1:10000> 0: jdbc:hive2://cdh1:10000> !quit Closing: 0: jdbc:hive2://cdh1:10000 [hdfs@cdh1 ~]$ |
2:!exit
1 2 3 |
0: jdbc:hive2://cdh1:10000> !exit Closing: 0: jdbc:hive2://cdh1:10000 [hdfs@cdh1 ~]$ |
————————————————
Done。