mirror of
https://github.com/apache/sqoop.git
synced 2025-05-03 19:02:36 +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:
parent
8e813b95a4
commit
12827a1765
@ -67,7 +67,8 @@ public SqlManager(final SqoopOptions opts) {
|
|||||||
* be tuned per-database, but the main extraction loop is still inheritable.
|
* be tuned per-database, but the main extraction loop is still inheritable.
|
||||||
*/
|
*/
|
||||||
protected String getColNamesQuery(String tableName) {
|
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
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user