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

Import fails on tables with names containing hyphens ( - )

    Details

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

      Description

      Table import fails when the table name contains hyphens. This issue was noticed when importing through SQLServer 2008, which allows hyphens in table names.

      1. SQOOP-521.patch
        0.7 kB
        Abhijeet Gaikwad

        Activity

        Hide
        abhijeet_gaikwad Abhijeet Gaikwad added a comment -

        Table names can contain hyphen in SQL Server, but when using them they should be escaped with double quotes or square brackets. See -
        http://msdn.microsoft.com/en-us/library/ms175874%28v=sql.100%29.aspx
        Current SQL Server Manager in SQOOP does not escape identifier names.
        I will work on adding this support for SQL Server.

        Till then, as a work around you can try escaping them when you specify the table name on SQOOP command-line.

        Show
        abhijeet_gaikwad Abhijeet Gaikwad added a comment - Table names can contain hyphen in SQL Server, but when using them they should be escaped with double quotes or square brackets. See - http://msdn.microsoft.com/en-us/library/ms175874%28v=sql.100%29.aspx Current SQL Server Manager in SQOOP does not escape identifier names. I will work on adding this support for SQL Server. Till then, as a work around you can try escaping them when you specify the table name on SQOOP command-line.
        Hide
        abhijeet_gaikwad Abhijeet Gaikwad added a comment -

        checkstyle - 0 errors
        ant test - pass

        Note: Sqoop job containing table names with spaces and other special characters import/export data successfully with this patch.

        Show
        abhijeet_gaikwad Abhijeet Gaikwad added a comment - checkstyle - 0 errors ant test - pass Note: Sqoop job containing table names with spaces and other special characters import/export data successfully with this patch.
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Patch is quite simple, so I'm giving +1 here (bypassing review board).

        Jarcec

        Show
        jarcec Jarek Jarcec Cecho added a comment - Patch is quite simple, so I'm giving +1 here (bypassing review board). Jarcec
        Hide
        jarcec Jarek Jarcec Cecho added a comment -

        Committed revision 1366886.

        Thank you for your contribution Abhijeet!

        Jarcec

        Show
        jarcec Jarek Jarcec Cecho added a comment - Committed revision 1366886. Thank you for your contribution Abhijeet! Jarcec
        Hide
        hudson Hudson added a comment -

        Integrated in Sqoop-ant-jdk-1.6 #128 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6/128/)
        SQOOP-521. Import fails on tables with names containing hyphens ( - ).

        (Abhijeet Gaikwad via Jarek Jarcec Cecho) (Revision 1366886)

        Result = SUCCESS
        jarcec :
        Files :

        • /sqoop/trunk/src/java/org/apache/sqoop/manager/SQLServerManager.java
        Show
        hudson Hudson added a comment - Integrated in Sqoop-ant-jdk-1.6 #128 (See https://builds.apache.org/job/Sqoop-ant-jdk-1.6/128/ ) SQOOP-521 . Import fails on tables with names containing hyphens ( - ). (Abhijeet Gaikwad via Jarek Jarcec Cecho) (Revision 1366886) Result = SUCCESS jarcec : Files : /sqoop/trunk/src/java/org/apache/sqoop/manager/SQLServerManager.java

          People

          • Assignee:
            abhijeet_gaikwad Abhijeet Gaikwad
            Reporter:
            glca Glyton Camilleri
          • Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development