开发者社区> 问答> 正文

复制表结构和数据: create table new_table as sele?400报错

复制表结构和数据: create table new_table as select * from exists_table;  结构报错了

 

NoViableAltException(27@[799:1: ddlStatement : ( createDatabaseStatement | switchDatabaseStatement | dropDatabaseStatement | createTableStatement | dropTableStatement | truncateTableStatement | alterStatement | descStatement | showStatement | metastoreCheck | createViewStatement | dropViewStatement | createFunctionStatement | createMacroStatement | createIndexStatement | dropIndexStatement | dropFunctionStatement | reloadFunctionStatement | dropMacroStatement | analyzeStatement | lockStatement | unlockStatement | lockDatabase | unlockDatabase | createRoleStatement | dropRoleStatement | ( grantPrivileges )=> grantPrivileges | ( revokePrivileges )=> revokePrivileges | showGrants | showRoleGrants | showRolePrincipals | showRoles | grantRole | revokeRole | setRole | showCurrentRole | abortTransactionStatement );])
    at org.antlr.runtime.DFA.noViableAlt(DFA.java:158)
    at org.antlr.runtime.DFA.predict(DFA.java:144)
    at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:3061)
    at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:2266)
    at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1318)
    at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:218)
    at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:75)
    at org.apache.hadoop.hive.ql.parse.ParseUtils.parse(ParseUtils.java:68)
    at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:564)
    at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1425)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1493)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1339)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1328)
    at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:239)
    at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:187)
    at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:409)
    at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:836)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:772)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:699)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 

展开
收起
爱吃鱼的程序员 2020-06-05 14:29:58 906 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p><span>create table if not exists table3</span><br> <span>LIKE table1 ;</span>   这种方法是可以的</p>
                    
    
                        <p>hive 的问题 <span>NoViableAltException 应该是你调用的时候参数有问题了,或者执行的语句不对</span></p>
    
    2020-06-05 14:30:10
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载