[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-05-04 Thread Chris Drome (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989148#comment-13989148
 ] 

Chris Drome commented on HIVE-6765:
---

[~adrian-wang] this does not appear to be an issue with hive-0.13 as they are 
using Kryo for XML serialization.

For clarification, I found that several setting can impact whether this problem 
arises or not. hive.auto.convert.join.noconditionaltask.size is used to 
determine the big table candidate set. Then hive.mapjoin.smalltable.filesize is 
used as a cutoff to determine whether a map-size join should be performed.

I found that when hive.auto.convert.join is true, it will try to perform a 
map-side join first. Based on hive.auto.convert.join.noconditionaltask.size it 
will return a set of big table candidates to the physical optimizer. The 
physical optimizer will use hive.mapjoin.smalltable.filesize to determine 
whether the map-side join should proceed. If not the clonePlan method is 
called, which manifests the problem. I don't think it is solely influenced by 
the size of the tables involved in the join. In my tests, shrinking the size of 
the table allows the map-side join to proceed, while increasing the size of the 
table causes this failure.

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Fix For: 0.13.0

 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-05-04 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13989287#comment-13989287
 ] 

Adrian Wang commented on HIVE-6765:
---

[~cdrome] good catch. I knew the serialization in Hive has been notorious for a 
long time, but I didn't know the progress they made there. Actually, I was real 
curious when I saw my case was OK with Tez with hive-0.13, while I never tried 
Apache's hive-0.13 since there was no official release.

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Fix For: 0.13.0

 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-05-03 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13988648#comment-13988648
 ] 

Adrian Wang commented on HIVE-6765:
---

[~selinazh] Thanks for your comment! It's so glad that someone also noticed 
this. Actually, I found that only when there was something like an aggregation 
function in the view, will the problem came up. The problem results from 
cloning the plan, but when joining with view as described, the plan would 
contain a node of ASTNodeOrigin, which does not have a default construct 
method, in which case when duplicating, exception will be thrown.
Could you please try to apply my patch here to see whether your problem is 
resolved? Thanks again.

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Fix For: 0.13.0

 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-04-30 Thread Selina Zhang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13986234#comment-13986234
 ] 

Selina Zhang commented on HIVE-6765:


[~adrian-wang] We came across the same problem. Just wonder why this 
ASTNodeOrigin serialization problem came up suddenly. It is not the first day 
we join with a view. The root cause maybe something else? Thanks!

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Fix For: 0.13.0

 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-03-27 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13949052#comment-13949052
 ] 

Adrian Wang commented on HIVE-6765:
---

I added a PersistenceDelegate in serializeObject() in Class Utilities and 
resolved the problem. later I'll attach the patch.

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
  Components: Query Processor
Affects Versions: 0.12.0
Reporter: Adrian Wang

 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-03-27 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13949075#comment-13949075
 ] 

Adrian Wang commented on HIVE-6765:
---

Here's an example to see the Exception:
CREATE TABLE t1 (a1 INT, b1 INT);
CREATE VIEW v1 (x1) AS SELECT MAX(a1) FROM t1;
SELECT s1.x1 FROM v1 s1 JOIN (SELECT MAX(a1) AS ma FROM t1) s2 ON s1.x1 = s2.ma;

This is a bug on both ApacheHive and Tez, outputing return code 1 ...

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
  Components: Query Processor
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-03-27 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13949076#comment-13949076
 ] 

Adrian Wang commented on HIVE-6765:
---

And I think this is just another drawback for using XMLEncoder to clone plan.

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
  Components: Query Processor
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-03-27 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13949113#comment-13949113
 ] 

Adrian Wang commented on HIVE-6765:
---

Sorry, the previous example works on Tez with hive-0.13.
But it fails when I run the query in Hive-0.12 in eclipse.

 ASTNodeOrigin unserializable leads to fail when join with view
 --

 Key: HIVE-6765
 URL: https://issues.apache.org/jira/browse/HIVE-6765
 Project: Hive
  Issue Type: Bug
  Components: Query Processor
Affects Versions: 0.12.0
Reporter: Adrian Wang
 Attachments: HIVE-6765.patch.1


 when a view contains a UDF, and the view comes into a JOIN operation, Hive 
 will encounter a bug with stack trace like
 Caused by: java.lang.InstantiationException: 
 org.apache.hadoop.hive.ql.parse.ASTNodeOrigin
   at java.lang.Class.newInstance0(Class.java:359)
   at java.lang.Class.newInstance(Class.java:327)
   at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
   at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)



--
This message was sent by Atlassian JIRA
(v6.2#6252)


[jira] [Commented] (HIVE-6765) ASTNodeOrigin unserializable leads to fail when join with view

2014-03-27 Thread Adrian Wang (JIRA)

[ 
https://issues.apache.org/jira/browse/HIVE-6765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13949118#comment-13949118
 ] 

Adrian Wang commented on HIVE-6765:
---

when I run the test case in hive command line(0.12-release), the full output is 
as follows,
hive SELECT s1.x1 FROM v1 s1 JOIN (SELECT MAX(a1) AS ma FROM t1) s2 ON s1.x1 = 
s2.ma;
java.lang.RuntimeException: Cannot serialize object
at 
org.apache.hadoop.hive.ql.exec.Utilities$1.exceptionThrown(Utilities.java:652)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:361)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:277)
at 
org.apache.hadoop.hive.ql.exec.Utilities.serializeObject(Utilities.java:666)
at 
org.apache.hadoop.hive.ql.exec.Utilities.clonePlan(Utilities.java:637)
at 
org.apache.hadoop.hive.ql.optimizer.physical.CommonJoinTaskDispatcher.processCurrentTask(CommonJoinTaskDispatcher.java:505)
at 
org.apache.hadoop.hive.ql.optimizer.physical.AbstractJoinTaskDispatcher.dispatch(AbstractJoinTaskDispatcher.java:182)
at 
org.apache.hadoop.hive.ql.lib.TaskGraphWalker.dispatch(TaskGraphWalker.java:111)
at 
org.apache.hadoop.hive.ql.lib.TaskGraphWalker.walk(TaskGraphWalker.java:194)
at 
org.apache.hadoop.hive.ql.lib.TaskGraphWalker.startWalking(TaskGraphWalker.java:139)
at 
org.apache.hadoop.hive.ql.optimizer.physical.CommonJoinResolver.resolve(CommonJoinResolver.java:79)
at 
org.apache.hadoop.hive.ql.optimizer.physical.PhysicalOptimizer.optimize(PhysicalOptimizer.java:90)
at 
org.apache.hadoop.hive.ql.parse.MapReduceCompiler.compile(MapReduceCompiler.java:300)
at 
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:8410)
at 
org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:284)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:441)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:342)
at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:977)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:888)
at 
org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
at 
org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:781)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
Caused by: java.lang.Exception: XMLEncoder: discarding statement 
XMLEncoder.writeObject(MapredWork);
... 29 more
Caused by: java.lang.RuntimeException: Cannot serialize object
at 
org.apache.hadoop.hive.ql.exec.Utilities$1.exceptionThrown(Utilities.java:652)
at 
java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:267)
at 
java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:408)
at 
java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:116)
at java.beans.Encoder.writeObject(Encoder.java:74)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:274)
at java.beans.Encoder.writeExpression(Encoder.java:304)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:389)
at 
java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:113)
at java.beans.Encoder.writeObject(Encoder.java:74)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:274)
at java.beans.Encoder.writeObject1(Encoder.java:231)
at java.beans.Encoder.cloneStatement(Encoder.java:244)
at java.beans.Encoder.writeStatement(Encoder.java:275)
at java.beans.XMLEncoder.writeStatement(XMLEncoder.java:348)
... 28 more
Caused by: java.lang.RuntimeException: Cannot serialize object
at 
org.apache.hadoop.hive.ql.exec.Utilities$1.exceptionThrown(Utilities.java:652)
at 
java.beans.DefaultPersistenceDelegate.initBean(DefaultPersistenceDelegate.java:267)
at 
java.beans.DefaultPersistenceDelegate.initialize(DefaultPersistenceDelegate.java:408)
at 
java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:116)
at java.beans.Encoder.writeObject(Encoder.java:74)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:274)
at