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

HDP on Windows – Other Forum

ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatLoader

  • #55458
    Mo Lin
    Participant

    Hi,

    When run below Pig command on HDP 2.1 for Windows, failed with ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatLoader. please advise what could be wrong.

    grunt> sample_01 = LOAD ‘hivesmoke’ using org.apache.hcatalog.pig.HCatLoader();

    Logfile shows below info:

    Caused by:
    <line 1, column 39> pig script failed to validate: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
    at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:1299)
    at org.apache.pig.parser.LogicalPlanBuilder.buildFuncSpec(LogicalPlanBuilder.java:1284)
    at org.apache.pig.parser.LogicalPlanGenerator.func_clause(LogicalPlanGenerator.java:5162)
    at org.apache.pig.parser.LogicalPlanGenerator.load_clause(LogicalPlanGenerator.java:3519)
    at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1629)
    at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:1106)
    at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:564)
    at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:421)
    at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:188)
    … 10 more
    Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.hcatalog.pig.HCatLoader using imports: [, java.lang., org.apache.pig.builtin., org.apache.pig.impl.builtin.]
    at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:653)
    at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:1296)
    … 18 more

    thanks,
    nemo

  • Author
    Replies
  • #55480
    Jianyong Dai
    Moderator

    Do you use “-useHCatalog” option when launching pig?

    #55497
    Mo Lin
    Participant

    yes, that’s the cause. thanks Jianyong!

    -Nemo

    #56506
    Mohamed ElSheikh
    Participant

    I was facing the same exact problem, the only difference is that I am using the HDInsight emulator for windows.
    The problem was fixed when I copy the jar file name hcatalog*.jar to the path “C:\Hadoop\hcatalog-0.4.1\bin\share\hcatalog”
    It now works fine!

    #57750
    Wonoh Kim
    Participant

    OK. pig -useHCatalog works.
    Yet, I want it work automatically. Is there a way to put the option (-useHCatalog) in .pigbootup file?

    #65033
    Nadeem Gul
    Participant

    Not working for me
    [root@sandbox ~]# env
    HOSTNAME=sandbox.hortonworks.com
    TERM=xterm-256color
    SHELL=/bin/bash
    SSH_CLIENT=10.0.2.2 61524 22
    QTDIR=/usr/lib64/qt-3.3
    QTINC=/usr/lib64/qt-3.3/include
    SSH_TTY=/dev/pts/0
    USER=root
    LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44; …
    PATH=/usr/lib64/qt-3.3/bin:/usr/lib/jvm/java-1.7.0-openjdk.x86_64/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/hdp/current/falcon-client/bin:/usr/hdp/current/hadoop-mapreduce-historyserver/bin:/usr/hdp/current/oozie-client/bin:/usr/hdp/current/falcon-server/bin:/usr/hdp/current/hadoop-yarn-client/bin:/usr/hdp/current/oozie-server/bin:/usr/hdp/current/flume-client/bin:/usr/hdp/current/hadoop-yarn-nodemanager/bin:/usr/hdp/current/pig-client/bin:/usr/hdp/current/flume-server/bin:/usr/hdp/current/hadoop-yarn-resourcemanager/bin:/usr/hdp/current/slider-client/bin:/usr/hdp/current/hadoop-client/bin:/usr/hdp/current/hadoop-yarn-timelineserver/bin:/usr/hdp/current/sqoop-client/bin:/usr/hdp/current/hadoop-hdfs-client/bin:/usr/hdp/current/hbase-client/bin:/usr/hdp/current/sqoop-server/bin:/usr/hdp/current/hadoop-hdfs-datanode/bin:/usr/hdp/current/hbase-master/bin:/usr/hdp/current/storm-client/bin:/usr/hdp/current/hadoop-hdfs-journalnode/bin:/usr/hdp/current/hbase-regionserver/bin:/usr/hdp/current/storm-nimbus/bin:/usr/hdp/current/hadoop-hdfs-namenode/bin:/usr/hdp/current/hive-client/bin:/usr/hdp/current/storm-supervisor/bin:/usr/hdp/current/hadoop-hdfs-nfs3/bin:/usr/hdp/current/hive-metastore/bin:/usr/hdp/current/zookeeper-client/bin:/usr/hdp/current/hadoop-hdfs-portmap/bin:/usr/hdp/current/hive-server2/bin:/usr/hdp/current/zookeeper-server/bin:/usr/hdp/current/hadoop-hdfs-secondarynamenode/bin:/usr/hdp/current/hive-webhcat/bin:/usr/hdp/current/hadoop-mapreduce-client/bin:/usr/hdp/current/knox-server/bin:/usr/hdp/current/hadoop-client/sbin:/usr/hdp/current/hadoop-hdfs-nfs3/sbin:/usr/hdp/current/hadoop-yarn-client/sbin:/usr/hdp/current/hadoop-hdfs-client/sbin:/usr/hdp/current/hadoop-hdfs-portmap/sbin:/usr/hdp/current/hadoop-yarn-nodemanager/sbin:/usr/hdp/current/hadoop-hdfs-datanode/sbin:/usr/hdp/current/hadoop-hdfs-secondarynamenode/sbin:/usr/hdp/current/hadoop-yarn-resourcemanager/sbin:/usr/hdp/current/hadoop-hdfs-journalnode/sbin:/usr/hdp/current/hadoop-mapreduce-client/sbin:/usr/hdp/current/hadoop-yarn-timelineserver/sbin:/usr/hdp/current/hadoop-hdfs-namenode/sbin:/usr/hdp/current/hadoop-mapreduce-historyserver/sbin:/usr/hdp/current/hive-webhcat/sbin:/root/bin
    PWD=/root
    JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk.x86_64
    QTLIB=/usr/lib64/qt-3.3/lib
    LESSOPEN=||/usr/bin/lesspipe.sh %s
    _=/bin/env
    OLDPWD=//usr/hdp/2.2.0.0-2041/hive-hcatalog

    #78325
    Fatih Tekin
    Participant

    Hi

    After replacing org.apache.hcatalog.pig.HCatLoader() with   org.apache.hive.hcatalog.pig.HCatLoader() , the issue is solved. However i still wonder why pig does not use the first option. Should we load jars into the classpath of pig?

     

    #81515
    Rene Sluiter
    Participant

    thanks Fatih, worked for me. Trying the practice exam for developer on amazon servers and your solution worked.

The forum ‘HDP on Windows – Other’ 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.