The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

Hive / HCatalog Forum

Hive Import Error: SemanticException Error 10028

  • #46900
    Jeffrey
    Participant

    Using the following Java code:
    String driver = “com.microsoft.sqlserver.jdbc.SQLServerDriver”;
    Class.forName(driver).newInstance();
    SqoopOptions options = new SqoopOptions();
    options.setConnManagerClassName(“org.apache.sqoop.manager.GenericJdbcManager”);
    options.setDriverClassName(driver);
    options.setHadoopMapRedHome(“/usr/lib/hadoop-mapreduce”);
    options.setConnectString(“jdbc:sqlserver://sqlbox;databaseName=db;user=usr;password=pass”);
    options.setTableName(“Parameters”);
    options.setUsername(“usr”);
    options.setPassword(“pass”);
    options.setOverwriteHiveTable(true);
    options.setDirectMode(true);
    options.setNumMappers(1);
    options.setJobName(“Test Import”);
    options.setTargetDir(“/home/Tmp-Parameters”);
    options.setFileLayout(FileLayout.TextFile);
    options.setDirectMode(true);
    options.setHiveImport(true);
    options.setHiveDatabaseName(“default”);
    options.setHiveTableName(“Parameters”);
    options.setHiveHome(“/usr/lib/hive”);

    ImportTool tool = new ImportTool();
    int result = tool.run(options);
    System.out.println(new Integer(result));

    I am getting this error:
    FAILED: SemanticException [Error 10028]: Line 2:17 Path is not legal ”file:/home/Tmp-Parameters”: Move from: file:/home/Tmp-Parameters to: hdfs://sandbox.hortonworks.com:8020/apps/hive/warehouse/parameters is not valid. Please check that values for params “default.fs.name” and “hive.metastore.warehouse.dir” do not conflict.
    ERROR main org.apache.sqoop.tool.ImportTool – Encountered IOException running import job: java.io.IOException: Hive exited with status 44
    at org.apache.sqoop.hive.HiveImport.executeExternalHiveScript(HiveImport.java:385)
    at org.apache.sqoop.hive.HiveImport.executeScript(HiveImport.java:335)
    at org.apache.sqoop.hive.HiveImport.importTable(HiveImport.java:239)
    at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:425)
    at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:502)
    at SqlImport.importSQLToHDFS(SqlImport.java:52)
    at SqlImport.main(SqlImport.java:11)

    I am using Hortonworks Sandbox 2.0 – running this Java code directly on the Sandbox Virtual Machine.
    It gets way down to the end after pulling all of the data from our SQL Server and then throws out this error.
    Anyone know what is causing this?

  • Author
    Replies
  • #47379
    Jeffrey
    Participant

    With Help from Eric Mizell @ Hortonworks, we finally got past this error.

    I was executing my Java class using the standard JVM. i.e. ‘java myclassname’

    I needed to export a JAR file from Eclipse and execute it like this:
    ‘hadoop jar myfile.jar myclassname’

    #82064
    Radhakrishnan Iyer
    Participant

    Can you please specify the reason why it is executed as hadoop jar instead of JAVA jar

The forum ‘Hive / HCatalog’ is closed to new topics and 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.