Hadoop 无法在指定位置的配置单元中查看创建的数据库
我是新来的蜂巢 我已经在配置单元中创建了一个数据库,默认情况下,该数据库是在配置单元仓库中创建的。当我对Hive Warehouse运行-ls时,我能够看到创建的数据库practice.db 用于创建数据库的查询: 创建数据库实践 注释“保存所有练习表” 我在配置单元中创建了另一个数据库。当我在创建数据库的路径上运行-ls命令时,无法看到practice_first.db 用于创建数据库的查询: 首先创建数据库 注释“保存所有练习表” 位置“/somepath in hdfs here” 即使是我在蜂巢仓库中也检查了实践_first.db在蜂巢仓库中也不存在 当我运行ShowDatabase时,我能够看到数据库列表中的第一个数据库 任何关于Hive在何处创建practice_first.db的建议Hadoop 无法在指定位置的配置单元中查看创建的数据库,hadoop,hive,hdfs,hiveql,Hadoop,Hive,Hdfs,Hiveql,我是新来的蜂巢 我已经在配置单元中创建了一个数据库,默认情况下,该数据库是在配置单元仓库中创建的。当我对Hive Warehouse运行-ls时,我能够看到创建的数据库practice.db 用于创建数据库的查询: 创建数据库实践 注释“保存所有练习表” 我在配置单元中创建了另一个数据库。当我在创建数据库的路径上运行-ls命令时,无法看到practice_first.db 用于创建数据库的查询: 首先创建数据库 注释“保存所有练习表” 位置“/somepath in hdfs here” 即使是
提前感谢。它将在
位置指定的路径上创建
选中并它将在位置指定的路径上创建
检查并测试它,确保它在没有添加任何表格的情况下显示,并且确实显示了。创建后,请尝试在数据库上使用“描述”来验证路径:
hive> create database test1 COMMENT 'testing' LOCATION '/user/testuser/test1.db';
OK
Time taken: 0.63 seconds
hive> describe database test1;
OK
test1 testing hdfs://nameserviceHA/user/testuser/test1.db testuser USER
Time taken: 0.183 seconds, Fetched: 1 row(s)
hive> exit;
$ hadoop fs -ls /user/testuser/ | grep test
drwxr-xr-x - testuser testgrp 0 2015-02-12 15:43 /user/testuser/test1.db
对默认位置执行相同操作将自动使用.db扩展名命名目录。此外,本例中的组看起来将是配置单元,而不是用户的组:
hive> drop database test1;
OK
Time taken: 0.379 seconds
hive> create database test1 COMMENT 'testing'; OK
Time taken: 0.319 seconds
hive> describe database test1;
OK
test1 testing hdfs://nameserviceHA/user/hive/warehouse/test1.db testuser USER
Time taken: 0.263 seconds, Fetched: 1 row(s)
hive> exit;
$ hadoop fs -ls /user/hive/warehouse | grep test1
drwxrwxrwt - testuser hive 0 2015-02-12 15:53 /user/hive/warehouse/test1.db
只是为了确保它在没有添加任何表的情况下显示而进行了测试,确实如此。创建后,请尝试在数据库上使用“描述”来验证路径:
hive> create database test1 COMMENT 'testing' LOCATION '/user/testuser/test1.db';
OK
Time taken: 0.63 seconds
hive> describe database test1;
OK
test1 testing hdfs://nameserviceHA/user/testuser/test1.db testuser USER
Time taken: 0.183 seconds, Fetched: 1 row(s)
hive> exit;
$ hadoop fs -ls /user/testuser/ | grep test
drwxr-xr-x - testuser testgrp 0 2015-02-12 15:43 /user/testuser/test1.db
对默认位置执行相同操作将自动使用.db扩展名命名目录。此外,本例中的组看起来将是配置单元,而不是用户的组:
hive> drop database test1;
OK
Time taken: 0.379 seconds
hive> create database test1 COMMENT 'testing'; OK
Time taken: 0.319 seconds
hive> describe database test1;
OK
test1 testing hdfs://nameserviceHA/user/hive/warehouse/test1.db testuser USER
Time taken: 0.263 seconds, Fetched: 1 row(s)
hive> exit;
$ hadoop fs -ls /user/hive/warehouse | grep test1
drwxrwxrwt - testuser hive 0 2015-02-12 15:53 /user/hive/warehouse/test1.db
如果需要,您将能够看到practice_first.db目录
1) 您可以在默认位置创建数据库
2) 在CREATEDATABASE语句的LOCATION中显式地提供目录名为practice_first.db 如果需要,您将能够看到practice_first.db目录
1) 您可以在默认位置创建数据库
2) 在CREATEDATABASE语句的LOCATION中显式地提供目录名为practice_first.db Hi@sonic根据JIRA链接,它应位于指定位置。但是,当我针对指定位置运行-ls时,practice_first.db不在指定位置。请给我任何建议。应该是这样的,我只是在我的机器上试用过,它就在那里。还有一点,当你指定位置时,文件夹不会有.db扩展名,除非你指定。Hi@sonic根据JIRA链接,它应该在指定的位置。但是,当我针对指定位置运行-ls时,practice_first.db不在指定位置。请给我任何建议。应该是这样的,我只是在我的机器上试用过,它就在那里。还有一点,当你指定位置时,文件夹不会有.db扩展名,除非你指定。