Sqoop Forum

Sqoop incremental import

  • #56285


    Im trying to do an incremental import using the Sanbox 2.1 and a Microsoft SQL Server (AdventureWorks database). For the incremental import i’m using the following command:

    sqoop import --connect "jdbc:sqlserver://;database=AdventureWorksLT2012;username=test;password=test" --table ProductModel --hive-import --check-column ProductModelID --incremental append --last-value 128 -- --schema SalesLT

    As you can see in the error message below, the select statement “SELECT MAX([SalesLT].[ProductModelID]) FROM ProductModel” is not constructed the right way.

    The schema name is added to the column without the table name and the table name in the FROM clause is missing the schema name…

    Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
    Please set $ACCUMULO_HOME to the root of your Accumulo installation.
    14/06/24 07:05:33 INFO sqoop.Sqoop: Running Sqoop version:
    14/06/24 07:05:33 INFO tool.BaseSqoopTool: Using Hive-specific delimiters for output. You can override
    14/06/24 07:05:33 INFO tool.BaseSqoopTool: delimiters with --fields-terminated-by, etc.
    14/06/24 07:05:33 INFO manager.SqlManager: Using default fetchSize of 1000
    14/06/24 07:05:33 INFO manager.SQLServerManager: We will use schema SalesLT
    14/06/24 07:05:33 INFO tool.CodeGenTool: Beginning code generation
    14/06/24 07:05:34 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM [SalesLT].[ProductModel] AS t WHERE 1=0
    14/06/24 07:05:34 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /usr/lib/hadoop-mapreduce
    Note: /tmp/sqoop-root/compile/bcb9143989664ced51458e8a0dbd52b9/ProductModel.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    14/06/24 07:05:37 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-root/compile/bcb9143989664ced51458e8a0dbd52b9/ProductModel.jar
    14/06/24 07:05:37 INFO tool.ImportTool: Maximal id query for free form incremental import: SELECT MAX([SalesLT].[ProductModelID]) FROM ProductModel
    14/06/24 07:05:37 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: com.microsoft.sqlserver.jdbc.SQLServerException: Invalid object name 'ProductModel'.

    Any help is appreciated.

    Thank you!

    Importing a full table is working fine.

    sqoop import --connect "jdbc:sqlserver://;database=AdventureWorksLT2012;username=test;password=test" --table ProductModel --hive-import -- --schema SalesLT

to create new topics or reply. | New User Registration

  • Author
  • #56866


    sqoop import –connect “jdbc:sqlserver://;database=AdventureWorksLT2012;username=test;password=test” –table ProductModel –hive-import — –schema SalesLT –incremental append –check-column ProductModelID –last-value “128”

The topic ‘Sqoop incremental import’ is closed to new replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.