Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-23 Thread Xuefu Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/#review58026
---

Ship it!


Ship It!

- Xuefu Zhang


On Oct. 23, 2014, 5:32 p.m., Chao Sun wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27046/
> ---
> 
> (Updated Oct. 23, 2014, 5:32 p.m.)
> 
> 
> Review request for hive, Brock Noland and Xuefu Zhang.
> 
> 
> Bugs: hive-8545
> https://issues.apache.org/jira/browse/hive-8545
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> With the current multi-insertion implementation, when caching is enabled for 
> input RDD, query may fail with the following exception:
> 2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: 
> scheduler.TaskSetManager (Logging.scala:logWarning(71)) - Lost task 0.0 in 
> stage 1.0 (TID 1, localhost): java.lang.ClassCastException: 
> org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.BytesWritable
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 
> org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
> 
> org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
> org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
> 
> org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:229)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> org.apache.spark.scheduler.Task.run(Task.scala:56)
> org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> java.lang.Thread.run(Thread.java:745)
> The fix should be easy. However, interestingly, this error doesn't show up 
> when the caching is turned off. We need to find out why.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
>  dc5d148 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
> 25a4515 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 
> 0f21b46 
> 
> Diff: https://reviews.apache.org/r/27046/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Chao Sun
> 
>



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-23 Thread Chao Sun

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/
---

(Updated Oct. 23, 2014, 5:32 p.m.)


Review request for hive, Brock Noland and Xuefu Zhang.


Changes
---

Thanks Xuefu for the suggestions. This patch uses a blank Configuration instead 
of serialize/deserialize JobConf.


Bugs: hive-8545
https://issues.apache.org/jira/browse/hive-8545


Repository: hive-git


Description
---

With the current multi-insertion implementation, when caching is enabled for 
input RDD, query may fail with the following exception:
2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: scheduler.TaskSetManager 
(Logging.scala:logWarning(71)) - Lost task 0.0 in stage 1.0 (TID 1, localhost): 
java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to 
org.apache.hadoop.io.BytesWritable

org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)

org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)

org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)

org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
org.apache.spark.rdd.RDD.iterator(RDD.scala:229)

org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)

org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
org.apache.spark.scheduler.Task.run(Task.scala:56)
org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
The fix should be easy. However, interestingly, this error doesn't show up when 
the caching is turned off. We need to find out why.


Diffs (updated)
-

  
ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
 dc5d148 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
25a4515 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 0f21b46 

Diff: https://reviews.apache.org/r/27046/diff/


Testing
---


Thanks,

Chao Sun



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-22 Thread Xuefu Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/#review57962
---



ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java


This assertion is incorrect. It seems that we don't need toCache at all. 
Patch #5 fixes all these.


- Xuefu Zhang


On Oct. 23, 2014, 12:42 a.m., Chao Sun wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27046/
> ---
> 
> (Updated Oct. 23, 2014, 12:42 a.m.)
> 
> 
> Review request for hive, Brock Noland and Xuefu Zhang.
> 
> 
> Bugs: hive-8545
> https://issues.apache.org/jira/browse/hive-8545
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> With the current multi-insertion implementation, when caching is enabled for 
> input RDD, query may fail with the following exception:
> 2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: 
> scheduler.TaskSetManager (Logging.scala:logWarning(71)) - Lost task 0.0 in 
> stage 1.0 (TID 1, localhost): java.lang.ClassCastException: 
> org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.BytesWritable
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 
> org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
> 
> org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
> org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
> 
> org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:229)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> org.apache.spark.scheduler.Task.run(Task.scala:56)
> org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> java.lang.Thread.run(Thread.java:745)
> The fix should be easy. However, interestingly, this error doesn't show up 
> when the caching is turned off. We need to find out why.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
>  dc5d148 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveCopyFunction.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
> 25a4515 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 
> 0f21b46 
> 
> Diff: https://reviews.apache.org/r/27046/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Chao Sun
> 
>



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-22 Thread Chao Sun

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/
---

(Updated Oct. 23, 2014, 12:42 a.m.)


Review request for hive, Brock Noland and Xuefu Zhang.


Changes
---

Thanks Xuefu for the comments. I've changed my patch accordingly.


Bugs: hive-8545
https://issues.apache.org/jira/browse/hive-8545


Repository: hive-git


Description
---

With the current multi-insertion implementation, when caching is enabled for 
input RDD, query may fail with the following exception:
2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: scheduler.TaskSetManager 
(Logging.scala:logWarning(71)) - Lost task 0.0 in stage 1.0 (TID 1, localhost): 
java.lang.ClassCastException: org.apache.hadoop.io.Text cannot be cast to 
org.apache.hadoop.io.BytesWritable

org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)

org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)

org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)

org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
org.apache.spark.rdd.RDD.iterator(RDD.scala:229)

org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)

org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
org.apache.spark.scheduler.Task.run(Task.scala:56)
org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
java.lang.Thread.run(Thread.java:745)
The fix should be easy. However, interestingly, this error doesn't show up when 
the caching is turned off. We need to find out why.


Diffs (updated)
-

  
ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
 dc5d148 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveCopyFunction.java 
PRE-CREATION 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
25a4515 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
  ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 0f21b46 

Diff: https://reviews.apache.org/r/27046/diff/


Testing
---


Thanks,

Chao Sun



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-22 Thread Chao Sun


> On Oct. 22, 2014, 11:36 p.m., Xuefu Zhang wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java,
> >  line 77
> > 
> >
> > I think we should let this stay in SparkUtils which otherwise now 
> > become an empty class.

OK. To make it consistent, I also moved copyHiveKey to SparkUtilities.


- Chao


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/#review57929
---


On Oct. 22, 2014, 5:50 p.m., Chao Sun wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27046/
> ---
> 
> (Updated Oct. 22, 2014, 5:50 p.m.)
> 
> 
> Review request for hive, Brock Noland and Xuefu Zhang.
> 
> 
> Bugs: hive-8545
> https://issues.apache.org/jira/browse/hive-8545
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> With the current multi-insertion implementation, when caching is enabled for 
> input RDD, query may fail with the following exception:
> 2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: 
> scheduler.TaskSetManager (Logging.scala:logWarning(71)) - Lost task 0.0 in 
> stage 1.0 (TID 1, localhost): java.lang.ClassCastException: 
> org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.BytesWritable
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 
> org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
> 
> org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
> org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
> 
> org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:229)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> org.apache.spark.scheduler.Task.run(Task.scala:56)
> org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> java.lang.Thread.run(Thread.java:745)
> The fix should be easy. However, interestingly, this error doesn't show up 
> when the caching is turned off. We need to find out why.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
>  dc5d148 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveCopyFunction.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
> 25a4515 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 
> 0f21b46 
> 
> Diff: https://reviews.apache.org/r/27046/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Chao Sun
> 
>



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-22 Thread Chao Sun


> On Oct. 22, 2014, 11:40 p.m., Xuefu Zhang wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java, line 25
> > 
> >
> > Why KO becomes Writable now? Should it be WritableComparable according 
> > to MapInput?

My mistake, it should be WritableComparable. Thanks for pointing out.


- Chao


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/#review57932
---


On Oct. 22, 2014, 5:50 p.m., Chao Sun wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27046/
> ---
> 
> (Updated Oct. 22, 2014, 5:50 p.m.)
> 
> 
> Review request for hive, Brock Noland and Xuefu Zhang.
> 
> 
> Bugs: hive-8545
> https://issues.apache.org/jira/browse/hive-8545
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> With the current multi-insertion implementation, when caching is enabled for 
> input RDD, query may fail with the following exception:
> 2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: 
> scheduler.TaskSetManager (Logging.scala:logWarning(71)) - Lost task 0.0 in 
> stage 1.0 (TID 1, localhost): java.lang.ClassCastException: 
> org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.BytesWritable
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 
> org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
> 
> org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
> org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
> 
> org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:229)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> org.apache.spark.scheduler.Task.run(Task.scala:56)
> org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> java.lang.Thread.run(Thread.java:745)
> The fix should be easy. However, interestingly, this error doesn't show up 
> when the caching is turned off. We need to find out why.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
>  dc5d148 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveCopyFunction.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
> 25a4515 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 
> 0f21b46 
> 
> Diff: https://reviews.apache.org/r/27046/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Chao Sun
> 
>



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-22 Thread Xuefu Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/#review57932
---



ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java


Why KO becomes Writable now? Should it be WritableComparable according to 
MapInput?


- Xuefu Zhang


On Oct. 22, 2014, 5:50 p.m., Chao Sun wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27046/
> ---
> 
> (Updated Oct. 22, 2014, 5:50 p.m.)
> 
> 
> Review request for hive, Brock Noland and Xuefu Zhang.
> 
> 
> Bugs: hive-8545
> https://issues.apache.org/jira/browse/hive-8545
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> With the current multi-insertion implementation, when caching is enabled for 
> input RDD, query may fail with the following exception:
> 2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: 
> scheduler.TaskSetManager (Logging.scala:logWarning(71)) - Lost task 0.0 in 
> stage 1.0 (TID 1, localhost): java.lang.ClassCastException: 
> org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.BytesWritable
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 
> org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
> 
> org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
> org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
> 
> org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:229)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> org.apache.spark.scheduler.Task.run(Task.scala:56)
> org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> java.lang.Thread.run(Thread.java:745)
> The fix should be easy. However, interestingly, this error doesn't show up 
> when the caching is turned off. We need to find out why.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
>  dc5d148 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveCopyFunction.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
> 25a4515 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 
> 0f21b46 
> 
> Diff: https://reviews.apache.org/r/27046/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Chao Sun
> 
>



Re: Review Request 27046: HIVE-8545 - Exception when casting Text to BytesWritable [Spark Branch]

2014-10-22 Thread Xuefu Zhang

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27046/#review57929
---



ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java


I think we should let this stay in SparkUtils which otherwise now become an 
empty class.



ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java


Nit: It seems that we need to create copy function function and set it to 
MapInput if only if caching is true. Can we avoid doing this work when caching 
is false?


- Xuefu Zhang


On Oct. 22, 2014, 5:50 p.m., Chao Sun wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27046/
> ---
> 
> (Updated Oct. 22, 2014, 5:50 p.m.)
> 
> 
> Review request for hive, Brock Noland and Xuefu Zhang.
> 
> 
> Bugs: hive-8545
> https://issues.apache.org/jira/browse/hive-8545
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> With the current multi-insertion implementation, when caching is enabled for 
> input RDD, query may fail with the following exception:
> 2014-10-21 13:57:34,742 WARN  [task-result-getter-0]: 
> scheduler.TaskSetManager (Logging.scala:logWarning(71)) - Lost task 0.0 in 
> stage 1.0 (TID 1, localhost): java.lang.ClassCastException: 
> org.apache.hadoop.io.Text cannot be cast to org.apache.hadoop.io.BytesWritable
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:67)
> 
> org.apache.hadoop.hive.ql.exec.spark.MapInput$CopyFunction.call(MapInput.java:61)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> 
> org.apache.spark.api.java.JavaPairRDD$$anonfun$pairFunToScalaFun$1.apply(JavaPairRDD.scala:1002)
> scala.collection.Iterator$$anon$11.next(Iterator.scala:328)
> 
> org.apache.spark.storage.MemoryStore.unrollSafely(MemoryStore.scala:234)
> 
> org.apache.spark.CacheManager.putInBlockManager(CacheManager.scala:163)
> org.apache.spark.CacheManager.getOrCompute(CacheManager.scala:70)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:227)
> 
> org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:35)
> org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:262)
> org.apache.spark.rdd.RDD.iterator(RDD.scala:229)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:68)
> 
> org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:41)
> org.apache.spark.scheduler.Task.run(Task.scala:56)
> org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:181)
> 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> java.lang.Thread.run(Thread.java:745)
> The fix should be easy. However, interestingly, this error doesn't show up 
> when the caching is turned off. We need to find out why.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveBaseFunctionResultList.java
>  dc5d148 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveCopyFunction.java 
> PRE-CREATION 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/MapInput.java 9849b49 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkPlanGenerator.java 
> 25a4515 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkTran.java 8a3dbf2 
>   ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SparkUtilities.java 
> 0f21b46 
> 
> Diff: https://reviews.apache.org/r/27046/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Chao Sun
> 
>