Github user jackylk commented on a diff in the pull request:
https://github.com/apache/incubator-carbondata/pull/248#discussion_r84681004
--- Diff:
integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonDataLoadRDD.scala
---
@@ -196,30 +195,28 @@ class DataFileLoaderRDD[K, V](
sc.setLocalProperty("spark.scheduler.pool", "DDL")
override def getPartitions: Array[Partition] = {
- isTableSplitPartition match {
- case true =>
- // for table split partition
- var splits = Array[TableSplit]()
- if (carbonLoadModel.isDirectLoad) {
- splits =
CarbonQueryUtil.getTableSplitsForDirectLoad(carbonLoadModel.getFactFilePath,
- partitioner.nodeList, partitioner.partitionCount)
- }
- else {
- splits =
CarbonQueryUtil.getTableSplits(carbonLoadModel.getDatabaseName,
- carbonLoadModel.getTableName, null, partitioner)
- }
+ if (isTableSplitPartition) {
+ // for table split partition
+ var splits = Array[TableSplit]()
+ if (carbonLoadModel.isDirectLoad) {
+ splits =
CarbonQueryUtil.getTableSplitsForDirectLoad(carbonLoadModel.getFactFilePath,
+ partitioner.nodeList, partitioner.partitionCount)
+ } else {
+ splits =
CarbonQueryUtil.getTableSplits(carbonLoadModel.getDatabaseName,
+ carbonLoadModel.getTableName, null, partitioner)
+ }
- splits.zipWithIndex.map {s =>
- // filter the same partition unique id, because only one will
match, so get 0 element
- val blocksDetails: Array[BlockDetails] = blocksGroupBy.filter(p
=>
- p._1 == s._1.getPartition.getUniqueID)(0)._2
- new CarbonTableSplitPartition(id, s._2, s._1, blocksDetails)
- }
- case false =>
- // for node partition
- blocksGroupBy.zipWithIndex.map{b =>
- new CarbonNodePartition(id, b._2, b._1._1, b._1._2)
- }
+ splits.zipWithIndex.map { s =>
--- End diff --
instead of `s`, please give a more meaningful name, like `case (split,
index)`
---
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 [email protected] or file a JIRA ticket
with INFRA.
---