hadoop蜂巢问题

发布于 2024-07-27 22:38:33 字数 134 浏览 6 评论 0原文

我正在尝试使用 JDBC 实用地创建表。 但是,我无法真正看到从 hive shell 创建的表。 更糟糕的是,当我从不同的目录访问 hive shell 时,我看到数据库的不同结果。 我需要配置任何设置吗?

提前致谢。

I'm trying to create tables pragmatically using JDBC. However, I can't really see the table I created from the hive shell. What's worse, when i access hive shell from different directories, i see different result of the database.
Is any setting i need to configure?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

我的影子我的梦 2024-08-03 22:38:33

确保每次都从同一目录运行 hive,因为当您第一次启动 hive CLI 时,它会在当前目录中创建一个 Metastore derby db。 该 derby DB 包含 Hive 表的元数据。 如果更改目录,Hive 表的元数据将是无组织的。 此外,Derby DB 无法处理多个会话。 为了允许并发 Hive 访问,您需要使用真正的数据库来管理 Metastore,而不是它附带的弱小 derbyDB。 您可以为此下载 mysql 并将 jdbc 连接的 hive 属性更改为 mysql 类型 4 纯 java 驱动程序。

Make sure you run hive from the same directory every time because when you launch hive CLI for the first time, it creates a metastore derby db in the current directory. This derby DB contains metadata of hive tables. If you change directories, you will have unorganized metadata for hive tables. Also the Derby DB cannot handle multiple sessions. To allow for concurrent Hive access you would need to use a real database to manage the Metastore rather than the wimpy little derbyDB that comes with it. You can download mysql for this and change hive properties for jdbc connection to mysql type 4 pure java driver.

轻拂→两袖风尘 2024-08-03 22:38:33

尝试通过电子邮件发送 Hive 用户列表或 IRC 频道。

Try emailing the Hive userlist or the IRC channel.

于我来说 2024-08-03 22:38:33

您可能需要设置中央 Hive 元存储(默认情况下为 Derby,但也可以是 mySQL/Oracle/Postgres)。 元存储是 Hive 和 HDFS 之间的“粘合剂”。 它告诉 Hive 您的数据文件位于 HDFS 中的位置、它们包含什么类型的数据、它们属于哪些表等。

有关详细信息,请参阅 http://wiki.apache.org/hadoop/HiveDerbyServerMode

You probably need to setup the central Hive metastore (by default, Derby, but it can be mySQL/Oracle/Postgres). The metastore is the "glue" between Hive and HDFS. It tells Hive where your data files live in HDFS, what type of data they contain, what tables they belong to, etc.

For more information, see http://wiki.apache.org/hadoop/HiveDerbyServerMode

捶死心动 2024-08-03 22:38:33

检查您的 hadoop 日志。 对我来说,当我的 hadoop 系统设置不正确时,就会发生这种情况。 namenode无法联系其他机器上的datanode等。

Examine your hadoop logs. For me this happened when my hadoop system was not setup properly. The namenode was not able to contact the datanodes on other machines etc.

风筝有风,海豚有海 2024-08-03 22:38:33

是的,这是由于元存储设置不正确造成的。 Metastore 存储与 Hive 表关联的元数据(例如表名称、表位置、列名称、列类型、分桶/排序信息、分区信息、SerDe 信息等)。

默认元存储是一个嵌入式 Derby 数据库,在任何给定时间只能由一个客户端使用。 对于大多数实际目的来说,这显然不够好。 与大多数用户一样,您应该将 Hive 安装配置为使用不同的元存储。 MySQL 似乎是一个流行的选择。 我已使用 Cloudera 网站上的此链接成功配置我的 MySQL元存储。

Yeah, it's due to the metastore not being set up properly. Metastore stores the metadata associated with your Hive table (e.g. the table name, table location, column names, column types, bucketing/sorting information, partitioning information, SerDe information, etc.).

The default metastore is an embedded Derby database which can only be used by one client at any given time. This is obviously not good enough for most practical purposes. You, like most users, should configure your Hive installation to use a different metastore. MySQL seems to be a popular choice. I have used this link from Cloudera's website to successfully configure my MySQL metastore.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文