5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-21 03:10:49 +08:00

SQOOP-464. Warn when user is importing data into /user/hive/warehouse with flag --hive-import.

(Jarek Jarcec Cecho via Arvind Prabhakar)


git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1304026 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arvind Prabhakar 2012-03-22 20:20:27 +00:00
parent 84a25b206a
commit 885248536a

View File

@ -938,6 +938,25 @@ protected void validateHiveOptions(SqoopOptions options)
+ " option conflicts with the " + HIVE_DELIMS_REPLACEMENT_ARG
+ " option." + HELP_STR);
}
// Many users are reporting issues when they are trying to import data
// directly into hive warehouse. This should prevent users from doing
// so in case of a default location.
String defaultHiveWarehouse = "/user/hive/warehouse";
if (options.doHiveImport()
&& ((
options.getWarehouseDir() != null
&& options.getWarehouseDir().startsWith(defaultHiveWarehouse)
) || (
options.getTargetDir() != null
&& options.getTargetDir().startsWith(defaultHiveWarehouse)
))) {
LOG.warn("It seems that you're doing hive import directly into default");
LOG.warn("hive warehouse directory which is not supported. Sqoop is");
LOG.warn("firstly importing data into separate directory and then");
LOG.warn("inserting data into hive. Please consider removing");
LOG.warn("--target-dir or --warehouse-dir into /user/hive/warehouse in");
LOG.warn("case that you will detect any issues.");
}
}
protected void validateHBaseOptions(SqoopOptions options)