Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Plain View
Hive >> mail # user >> alter table add partition error


+
Pradeep Kamath 2010-06-17, 00:22
+
yq he 2010-06-17, 00:54
+
Pradeep Kamath 2010-06-17, 16:09
+
Ashish Thusoo 2010-06-17, 18:15
+
Pradeep Kamath 2010-06-17, 20:24
+
Pradeep Kamath 2010-06-18, 17:19
+
Ning Zhang 2010-06-18, 17:49
+
Edward Capriolo 2010-06-18, 18:22
+
Pradeep Kamath 2010-06-18, 18:25
+
Ning Zhang 2010-06-18, 18:51
+
Paul Yang 2010-06-18, 18:59
+
Pradeep Kamath 2010-06-18, 19:18
+
Paul Yang 2010-06-18, 19:10
+
Pradeep Kamath 2010-06-18, 20:37
+
Paul Yang 2010-06-18, 21:19
+
Pradeep Kamath 2010-06-18, 21:51
+
Pradeep Kamath 2010-06-21, 21:11
+
Paul Yang 2010-06-21, 21:34
+
Pradeep Kamath 2010-06-22, 00:46
+
Paul Yang 2010-06-22, 01:25
+
Pradeep Kamath 2010-06-22, 17:21
+
Paul Yang 2010-06-23, 01:06
+
Pradeep Kamath 2010-06-23, 16:03
+
John Sichi 2010-06-23, 16:44
Copy link to this message
-
RE: alter table add partition error
I have posted a patch for this - not sure how to write unit tests for it
- so patch doesn't have tests.

 

________________________________

From: Pradeep Kamath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 23, 2010 9:04 AM
To: [EMAIL PROTECTED]
Subject: RE: alter table add partition error

 

In the second step of

http://wiki.apache.org/hadoop/Hive/HowToContribute#Generating_Code

 

"Use the approved version of thrift. This is currently
thrift-instant-r790732, which you can obtain from
http://instant.thrift-rpc.org"

 

Looks like that site is down since it is not responding to requests - is
there an alternate url I can try? Also, is the approved version still
thrift-instant-r790732?

 

________________________________

From: Paul Yang [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 22, 2010 6:06 PM
To: [EMAIL PROTECTED]
Subject: RE: alter table add partition error

 

Hey Pradeep,

 

Yep, that's on the right path :) Since you made a change to
hive_metastore.thrift, you should run the thrift compiler by calling
'ant thriftif' within trunk/metastore. But before you can do that, the
thrift compiler has to be in your path. JVS has a nice write up on how
to do this:

 

http://wiki.apache.org/hadoop/Hive/HowToContribute#Generating_Code

 

Also, I've set up a JIRA for this issue at:

 

https://issues.apache.org/jira/browse/HIVE-1428

 

Can you post your patch there? It makes it a lot easier to track issues.
Thanks!

 

-Paul

 

From: Pradeep Kamath [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 22, 2010 10:22 AM
To: [EMAIL PROTECTED]
Subject: Re: alter table add partition error

 

Hi Paul,
   I have attached a draft of a patch (incomplete). The problem I am
facing is that to make this change I seem to need to change the thrift
idl (hive_metastore.thrift). Looking at the code structure it seems like
the generate java files are checked in rather than generated through the
build (is this so that the build does not depend on the thrift
compiler?). I tried downloading and building thrift but hit issues in
the make install - wanted to check with you if the patch looks correct
so far or if I am on the wrong path. Also if the direction is right, I
need some guidance on generating the java files from the modified idl.

Thanks,
Pradeep

Paul Yang wrote:

Well, the section of code you are referring to is automatically
generated by the thrift compiler so we can't modify it. As the inability
to return null is a limitation of Thrift, we can work around that issue
by throwing an exception instead.

 

Check out this thread:

http://publists.facebook.com/pipermail/thrift/2007-September/000085.html

 

 

From: Pradeep Kamath [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 21, 2010 5:46 PM
To: [EMAIL PROTECTED]
Subject: RE: alter table add partition error

 

Hi Paul,

  Yes I don't mind working on a patch though I have no knowledge of how
thrift code works. I was also confused by your suggestion for a fix. I
thought the fix would be in
ThriftHiveMetaStore.Client.recv_get_partition() - to first check
if(result.o1 != null) throw result.o1, then to just return
result.success and not throw the "unknown result" exception. I tried
something along these lines and the alter table worked. Am I missing
something?

 

Thanks,

Pradeep

 

________________________________

From: Paul Yang [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 21, 2010 2:35 PM
To: [EMAIL PROTECTED]
Subject: RE: alter table add partition error

 

Ah okay. So what's going on is that getPartition() is supposed to return
null if the specified partition doesn't exist. But because Thrift can't
handle null return values, we are seeing this exception. This isn't a
problem with a local metastore because Thrift isn't used.

 

One solution to this problem would be modify ObjectStore.getPartition()
to throw a NoSuchObjectException instead of returning null for
non-existent partitions. Then Hive.getPartition() can catch the
exception and return null to retain the original behavior.

 

Pradeep, are you interested in working on a patch for this problem?

 

From: Pradeep Kamath [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 21, 2010 2:11 PM
To: [EMAIL PROTECTED]
Subject: RE: alter table add partition error

 

I tried debugging in code a little more. Here is what I found:

The code in ThriftHiveMetaStore eventually makes a call -
get_partition() passing the partition key values for the partition I am
trying to add using alter table. I assume this is to check that the
partition doesn't already exist.

I added a debug line in the following code:

  public Partition recv_get_partition() throws MetaException, TException

    {

      TMessage msg = iprot_.readMessageBegin();

      if (msg.type == TMessageType.EXCEPTION) {

        TApplicationException x = TApplicationException.read(iprot_);

        iprot_.readMessageEnd();

        throw x;

      }

      get_partition_result result = new get_partition_result();

      

      result.read(iprot_);

      System.err.println("XXX: result:" + result);

      iprot_.readMessageEnd();

      if (result.isSetSuccess()) {

        return result.success;

      }

      if (result.o1 != null) {

        throw result.o1;

      }

      throw new
TApplicationException(TApplicationException.MISSING_RESULT,
"get_partition failed: unknown result");

    }

 

I also put a debug statements in the read() method:

    public void read(TProtocol iprot) throws TException {

      TField field;

      iprot.readStructBegin();

      System.err.println("XXX: Reading TProtocol object:");

      while (true)

      {

        field = iprot.readFieldBegin();

        System.err.println("XXX: field just read:" + field);

        if (field.type == TType.STOP) {

          break;

 

I got

XXX: Reading TProtocol object:

XXX: field just read:<TField name:'' type:0 field-id:0>

XXX: result:get_partition_result(success:null, o1:null
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB