You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sqoop.apache.org by ja...@apache.org on 2013/02/03 00:09:36 UTC

git commit: SQOOP-853: sqoop list-tables isn't returning the tables that have custom schemas'

Updated Branches:
  refs/heads/trunk 7c5b46fb2 -> bae5604a3


SQOOP-853: sqoop list-tables isn't returning the tables that have custom schemas'

(Vasanth kumar RJ via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/bae5604a
Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/bae5604a
Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/bae5604a

Branch: refs/heads/trunk
Commit: bae5604a3c2dcfa4c908b5370cb55bb4dc54235b
Parents: 7c5b46f
Author: Jarek Jarcec Cecho <ja...@apache.org>
Authored: Sat Feb 2 15:09:02 2013 -0800
Committer: Jarek Jarcec Cecho <ja...@apache.org>
Committed: Sat Feb 2 15:09:02 2013 -0800

----------------------------------------------------------------------
 src/docs/user/list-tables.txt                      |    7 +++++++
 src/java/org/apache/sqoop/tool/ListTablesTool.java |    4 +++-
 2 files changed, 10 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/sqoop/blob/bae5604a/src/docs/user/list-tables.txt
----------------------------------------------------------------------
diff --git a/src/docs/user/list-tables.txt b/src/docs/user/list-tables.txt
index 2d00237..fad14c4 100644
--- a/src/docs/user/list-tables.txt
+++ b/src/docs/user/list-tables.txt
@@ -53,3 +53,10 @@ job_descriptions
 office_supplies
 ----
 
+In case of postgresql, list tables command with common arguments fetches only "public" schema. For custom schema, use --schema argument to list tables of particular schema
+Example
+----
+$ sqoop list-tables --connect jdbc:postgresql://localhost/corp  --username name -P -- --schema payrolldept
+employees
+expenses
+----

http://git-wip-us.apache.org/repos/asf/sqoop/blob/bae5604a/src/java/org/apache/sqoop/tool/ListTablesTool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/sqoop/tool/ListTablesTool.java b/src/java/org/apache/sqoop/tool/ListTablesTool.java
index 529df37..5d47bc9 100644
--- a/src/java/org/apache/sqoop/tool/ListTablesTool.java
+++ b/src/java/org/apache/sqoop/tool/ListTablesTool.java
@@ -80,7 +80,9 @@ public class ListTablesTool extends com.cloudera.sqoop.tool.BaseSqoopTool {
   /** {@inheritDoc} */
   public void validateOptions(SqoopOptions options)
       throws InvalidOptionsException {
-    if (hasUnrecognizedArgs(extraArguments)) {
+    options.setExtraArgs(getSubcommandArgs(extraArguments));
+    int dashPos = getDashPosition(extraArguments);
+    if (hasUnrecognizedArgs(extraArguments, 0, dashPos)) {
       throw new InvalidOptionsException(HELP_STR);
     }