Uploaded image for project: 'Sqoop'
  1. Sqoop
  2. SQOOP-741

The OracleConnect getTables() implementation needs to restrict tables to current user

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.2
    • Fix Version/s: 1.4.3
    • Component/s: None
    • Labels:
      None
    • Environment:

      Oracle 11g

      Description

      SQOOP has various managers specific to each Database. Each of these managers provide database specific queries to list databases, tables, table columns, etc. The Oracle implementation (org.apache.sqoop.manager.OracleManager) defines queries specific for Oracle. The query for list tables in this implementation provides a list of all the tables the user has access to.

      This is inconsistent with the other queries defined (for getting list of table columns, get primary key for table etc) which restrict the table being queried to be owned by the user.

      This inconsisent behavior has more issues. For example, when we do import-all-tables (subject to other restrictions of import-all-tables), it fails because the list tables query used by import all tables returns tables like DUAL (which is a dummy Oracle table that gets blessed into all user schemas for historical reasons and other tables).

      I can provide a patch for this if there is agreement that this behavior needs fixing (and it will make Oracle manager work like other database connectors at least in spirit)

      1. SQOOP-741.patch
        2 kB
        Venkat Ranganathan

        Activity

        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Contributions are most certainly welcomed Venkat! Feel free to assign this jira to yourself and start working on it, I'll be more than happy to review it.

        Show
        jarcec Jarek Jarcec Cecho added a comment - Contributions are most certainly welcomed Venkat! Feel free to assign this jira to yourself and start working on it, I'll be more than happy to review it.
        Hide
        venkatnrangan Venkat Ranganathan added a comment -

        Thanks Jarek, please find the patch attached. I tested against an Oracle database to validate the functionality of list-tables

        Show
        venkatnrangan Venkat Ranganathan added a comment - Thanks Jarek, please find the patch attached. I tested against an Oracle database to validate the functionality of list-tables
        Hide
        venkatnrangan Venkat Ranganathan added a comment - - edited

        I have submitted a patch. Please review the patch.
        PS: I attached a file, and just added a comment instead of saying submit a patch which changes the status. Sorry about that

        Show
        venkatnrangan Venkat Ranganathan added a comment - - edited I have submitted a patch. Please review the patch. PS: I attached a file, and just added a comment instead of saying submit a patch which changes the status. Sorry about that
        Hide
        venkatnrangan Venkat Ranganathan added a comment -

        Attaching a new patch after git rebase. thanks

        Show
        venkatnrangan Venkat Ranganathan added a comment - Attaching a new patch after git rebase. thanks
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        The patch is fairly simple, so I'm giving my +1 here.

        Show
        jarcec Jarek Jarcec Cecho added a comment - The patch is fairly simple, so I'm giving my +1 here.
        Hide
        jarcec Jarek Jarcec Cecho added a comment -
        Show
        jarcec Jarek Jarcec Cecho added a comment - The patch is in: https://git-wip-us.apache.org/repos/asf?p=sqoop.git;a=commit;h=05774d49bef891ba8552ed717cf2945161a75352 Thank you Venkat for your contribution! Jarcec
        Hide
        hudson Hudson added a comment -

        Integrated in Sqoop-ant-jdk-1.6-hadoop20 #351 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/351/)
        SQOOP-741: The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352)

        Result = SUCCESS
        jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352
        Files :

        • src/java/org/apache/sqoop/manager/OracleManager.java
        Show
        hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop20 #351 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop20/351/ ) SQOOP-741 : The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352 Files : src/java/org/apache/sqoop/manager/OracleManager.java
        Hide
        hudson Hudson added a comment -

        Integrated in Sqoop-ant-jdk-1.6-hadoop23 #518 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/518/)
        SQOOP-741: The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352)

        Result = SUCCESS
        jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352
        Files :

        • src/java/org/apache/sqoop/manager/OracleManager.java
        Show
        hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop23 #518 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop23/518/ ) SQOOP-741 : The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352 Files : src/java/org/apache/sqoop/manager/OracleManager.java
        Hide
        hudson Hudson added a comment -

        Integrated in Sqoop-ant-jdk-1.6-hadoop200 #358 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/358/)
        SQOOP-741: The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352)

        Result = FAILURE
        jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352
        Files :

        • src/java/org/apache/sqoop/manager/OracleManager.java
        Show
        hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop200 #358 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop200/358/ ) SQOOP-741 : The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352) Result = FAILURE jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352 Files : src/java/org/apache/sqoop/manager/OracleManager.java
        Hide
        hudson Hudson added a comment -

        Integrated in Sqoop-ant-jdk-1.6-hadoop100 #358 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/358/)
        SQOOP-741: The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352)

        Result = SUCCESS
        jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352
        Files :

        • src/java/org/apache/sqoop/manager/OracleManager.java
        Show
        hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6-hadoop100 #358 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6-hadoop100/358/ ) SQOOP-741 : The OracleConnect getTables() implementation needs to restrict tables to current user (Revision 05774d49bef891ba8552ed717cf2945161a75352) Result = SUCCESS jarcec : https://git-wip-us.apache.org/repos/asf?p=sqoop.git&a=commit&h=05774d49bef891ba8552ed717cf2945161a75352 Files : src/java/org/apache/sqoop/manager/OracleManager.java
        Hide
        venkatnrangan Venkat Ranganathan added a comment -

        Thanks Jarek for committing this

        Show
        venkatnrangan Venkat Ranganathan added a comment - Thanks Jarek for committing this
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Failure on profile hadoop200 is expected due to the SQOOP-731.

        Show
        jarcec Jarek Jarcec Cecho added a comment - Failure on profile hadoop200 is expected due to the SQOOP-731 .

          People

          • Assignee:
            venkatnrangan Venkat Ranganathan
            Reporter:
            venkatnrangan Venkat Ranganathan
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development