[GitHub] spark pull request #14913: [SPARK-17358][SQL] Cached table(parquet/orc) shou...

2016-09-05 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/spark/pull/14913


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14913: [SPARK-17358][SQL] Cached table(parquet/orc) shou...

2016-09-01 Thread cloud-fan
Github user cloud-fan commented on a diff in the pull request:

https://github.com/apache/spark/pull/14913#discussion_r77285873
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/fileSourceInterfaces.scala
 ---
@@ -169,6 +169,13 @@ case class HadoopFsRelation(
 location.allFiles().map(_.getPath.toUri.toString).toArray
 
   override def sizeInBytes: Long = location.allFiles().map(_.getLen).sum
+
+  override def equals(other: Any): Boolean = other match {
+case r: HadoopFsRelation => location == r.location
--- End diff --

+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14913: [SPARK-17358][SQL] Cached table(parquet/orc) shou...

2016-09-01 Thread JoshRosen
Github user JoshRosen commented on a diff in the pull request:

https://github.com/apache/spark/pull/14913#discussion_r77283932
  
--- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/fileSourceInterfaces.scala
 ---
@@ -169,6 +169,13 @@ case class HadoopFsRelation(
 location.allFiles().map(_.getPath.toUri.toString).toArray
 
   override def sizeInBytes: Long = location.allFiles().map(_.getLen).sum
+
+  override def equals(other: Any): Boolean = other match {
+case r: HadoopFsRelation => location == r.location
--- End diff --

Is it safe to completely ignore the other options? Why not ignore just the 
session and nothing else?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

-
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org



[GitHub] spark pull request #14913: [SPARK-17358][SQL] Cached table(parquet/orc) shou...

2016-09-01 Thread watermen
GitHub user watermen opened a pull request:

https://github.com/apache/spark/pull/14913

[SPARK-17358][SQL] Cached table(parquet/orc) should be shard between 
beelines

## What changes were proposed in this pull request?
Cached table(parquet/orc) couldn't be shard between beelines, because the 
`sameResult` method used by `CacheManager` always return false when compare two 
`HadoopFsRelation` in different beelines. So I override the `equals` and 
`hashCode` in `HadoopFsRelation`.(Just compare the locations)

## How was this patch tested?
Beeline1
```
1: jdbc:hive2://localhost:1> cache table src_pqt;
+-+--+
| Result  |
+-+--+
+-+--+
No rows selected (5.143 seconds)
1: jdbc:hive2://localhost:1> explain select * from src_pqt;

++--+
|   

 plan   


 |

++--+
| == Physical Plan ==
InMemoryTableScan [key#49, value#50]
   +- InMemoryRelation [key#49, value#50], true, 1, StorageLevel(disk, 
memory, deserialized, 1 replicas), `src_pqt`
 +- *FileScan parquet default.src_pqt[key#0,value#1] Batched: true, 
Format: ParquetFormat, InputPaths: hdfs://199.0.0.1:9000/qiyadong/src_pqt, 
PartitionFilters: [], PushedFilters: [], ReadSchema: 
struct  |

++--+
```

Beeline2
```
0: jdbc:hive2://localhost:1> explain select * from src_pqt;

++--+
|   

 plan   


 |

++--+
| == Physical Plan ==
InMemoryTableScan [key#68, value#69]
   +- InMemoryRelation [key#68, value#69], true, 1, StorageLevel(disk, 
memory, deserialized, 1 replicas), `src_pqt`
 +- *FileScan parquet default.src_pqt[key#0,value#1] Batched: true, 
Format: ParquetFormat, InputPaths: hdfs://199.0.0.1:9000/qiyadong/src_pqt, 
PartitionFilters: [], PushedFilters: [], ReadSchema: 
struct  |

+-