0: jdbc:hive2://master:10000/> truncate student; 表失败了
0: jdbc:hive2://master:10000/> truncate student;
Error: Error while compiling statement: FAILED: ParseException line 1:9 missing TABLE at 'student' near '<EOF>' (state=42000,code=40000)
.
但是select不报错,这是为啥呢
0: jdbc:hive2://master:10000/> select * from student limit 1;
INFO : Compiling command(queryId=hive_20190927152605_62e5072f-c4ba-4eb9-bfd8-f821238f53c4): select * from student limit 1
INFO : Semantic Analysis Completed
INFO : Returning Hive schema: Schema(fieldSchemas:[FieldSchema(name:student.id, type:string, comment:null), FieldSchema(name:student.name, type:string, comment:null)], properties:null)
INFO : Completed compiling command(queryId=hive_20190927152605_62e5072f-c4ba-4eb9-bfd8-f821238f53c4); Time taken: 0.107 seconds
INFO : Executing command(queryId=hive_20190927152605_62e5072f-c4ba-4eb9-bfd8-f821238f53c4): select * from student limit 1
INFO : Completed executing command(queryId=hive_20190927152605_62e5072f-c4ba-4eb9-bfd8-f821238f53c4); Time taken: 0.0 seconds
INFO : OK
+----------------------------------------------------+---------------+
| student.id | student.name |
+----------------------------------------------------+---------------+
| ORC$�bb����E'���M�=/A�g�v��sw�q�"�#�N3{�s��F|_�' ��� | NULL |
+----------------------------------------------------+---------------+
1 row selected (0.223 seconds)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误已经提示了,缺少TABLE关键字。语法错误了,正确语句:truncate table student;
truncate table student;