5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-03 07:11:02 +08:00

MAPREDUCE-1224. Calling "SELECT t.* from <table> AS t" to get meta information is too expensive for big tables. Contributed by Spencer Ho.

From: Thomas White <tomwhite@apache.org>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149844 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Bayer 2011-07-22 20:03:29 +00:00
parent 8e813b95a4
commit 12827a1765

View File

@ -67,7 +67,8 @@ public SqlManager(final SqoopOptions opts) {
* be tuned per-database, but the main extraction loop is still inheritable.
*/
protected String getColNamesQuery(String tableName) {
return "SELECT t.* FROM " + tableName + " AS t";
// adding where clause to prevent loading a big table
return "SELECT t.* FROM " + tableName + " AS t WHERE 1=0";
}
@Override