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

PostgreSQL Manager is incorrectly escaping table names

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.4.2
    • Fix Version/s: 1.4.3
    • Component/s: None
    • Labels:
      None

      Description

      PostgreSQL Manager is incorrectly escaping entire table name argument into double quotes like on following example:

      schema.table => "schema.table"
      

      However this escaping is not valid as it should be one of following possibilities:

      schema.table => schema."table"
      schema.table => "schema"."table"
      

        Issue Links

          Activity

          Hide
          jarcec Jarek Jarcec Cecho added a comment -

          There is small "hack" for bypassing this issue. User might specify following parameter on the command line:

          --table 'schema"."table'
          

          The entire table name is enclosed in single quotes to prevent the shell from any other escape resolution as there are two double quotes inside. Sqoop should escape this term correctly to "schema"."table" - single quotes will be removed by the shell and double quotes will be added around the entire expression by Sqoop.

          Show
          jarcec Jarek Jarcec Cecho added a comment - There is small "hack" for bypassing this issue. User might specify following parameter on the command line: --table 'schema "." table' The entire table name is enclosed in single quotes to prevent the shell from any other escape resolution as there are two double quotes inside. Sqoop should escape this term correctly to "schema"."table" - single quotes will be removed by the shell and double quotes will be added around the entire expression by Sqoop.
          Hide
          jarcec Jarek Jarcec Cecho added a comment -

          I've done deeper analysis of the code and I'm afraid that current PostgreSQL connector is not supporting non default schemes at all. There is hard coded usage of default scheme and user can't change it on sqoop command line. I'm already working on connector modifications to support non default schemes.

          Jarcec

          Show
          jarcec Jarek Jarcec Cecho added a comment - I've done deeper analysis of the code and I'm afraid that current PostgreSQL connector is not supporting non default schemes at all. There is hard coded usage of default scheme and user can't change it on sqoop command line. I'm already working on connector modifications to support non default schemes. Jarcec
          Hide
          jarcec Jarek Jarcec Cecho added a comment -

          I'm closing this ticket as proper escaping is only one part of the problem. I've opened ticket SQOOP-601 to implement support for custom schemas into PostgreSQL connector.

          Show
          jarcec Jarek Jarcec Cecho added a comment - I'm closing this ticket as proper escaping is only one part of the problem. I've opened ticket SQOOP-601 to implement support for custom schemas into PostgreSQL connector.

            People

            • Assignee:
              jarcec Jarek Jarcec Cecho
              Reporter:
              jarcec Jarek Jarcec Cecho
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development