gpt4 book ai didi

hadoop - Hive:是否可以重命名现有的 Hive 数据库?

转载 作者:可可西里 更新时间:2023-11-01 14:13:45 26 4
gpt4 key购买 nike

似乎有类似的要求:https://issues.apache.org/jira/browse/HIVE-4847

但是,当我尝试问题描述中建议的语法时 - 'ALTER DATABASE dbname RENAME TO newdbname',它给了我以下错误:

ALTER DATABASE testdb RENAME TO testdb1;

NoViableAltException(26@[])
at org.apache.hadoop.hive.ql.parse.HiveParser.alterDatabaseStatementSuffix(HiveParser.java:7881)
at org.apache.hadoop.hive.ql.parse.HiveParser.alterStatement(HiveParser.java:6588)
at org.apache.hadoop.hive.ql.parse.HiveParser.ddlStatement(HiveParser.java:2183)
at org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1392)
at org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1030)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:199)
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:414)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:332)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:988)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1053)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:924)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:914)
at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:269)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:221)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:431)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:367)
at org.apache.hadoop.hive.cli.CliDriver.processReader(CliDriver.java:464)
at org.apache.hadoop.hive.cli.CliDriver.processFile(CliDriver.java:474)
at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:756)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:694)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:633)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
FAILED: ParseException line 3:15 cannot recognize input near 'testdb' 'RENAME' 'TO' in alter database statement

最佳答案

当前的 Apache 配置单元版本不支持此功能。在这个 apache Hive Jira 中 HIVE-4847 ,您可以看到这是一项新功能,补丁可用,但尚未合并并标记到特定版本。我们可以期待在以后的任何版本中都有此功能。

关于hadoop - Hive:是否可以重命名现有的 Hive 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29481237/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com