Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/262#discussion_r87716124
  
    --- Diff: 
integration/spark/src/main/scala/org/apache/carbondata/spark/rdd/CarbonScanRDD.scala
 ---
    @@ -244,68 +195,40 @@ class CarbonScanRDD[V: ClassTag](
               throw new java.util.NoSuchElementException("End of stream")
             }
             havePair = false
    -        recordCount += 1
    -        keyClass.getValue(rowIterator.next())
    +        val value: V = reader.getCurrentValue
    +        value
           }
    +    }
    +  }
     
    -      def clearDictionaryCache(columnToDictionaryMap: 
java.util.Map[String, Dictionary]) = {
    -        if (null != columnToDictionaryMap) {
    -          org.apache.carbondata.spark.util.CarbonQueryUtil
    -            .clearColumnDictionaryCache(columnToDictionaryMap)
    -        }
    -      }
    +  private def prepareInputFormatForDriver(conf: Configuration): 
CarbonInputFormat[V] = {
    +    CarbonInputFormat.setCarbonTable(conf, carbonTable)
    +    createInputFormat(conf)
    +  }
     
    -      def logStatistics(): Unit = {
    -          if (null != queryModel.getStatisticsRecorder) {
    -            var queryStatistic = new QueryStatistic()
    -            queryStatistic
    -              
.addFixedTimeStatistic(QueryStatisticsConstants.EXECUTOR_PART,
    -                System.currentTimeMillis - queryStartTime
    -              )
    -            
queryModel.getStatisticsRecorder.recordStatistics(queryStatistic)
    -            // result size
    -            queryStatistic = new QueryStatistic()
    -            
queryStatistic.addCountStatistic(QueryStatisticsConstants.RESULT_SIZE, 
recordCount)
    -            
queryModel.getStatisticsRecorder.recordStatistics(queryStatistic)
    -            // print executor query statistics for each task_id
    -            queryModel.getStatisticsRecorder.logStatisticsAsTableExecutor()
    -          }
    -        }
    -      }
    +  private def prepareInputFormatForExecutor(conf: Configuration): 
CarbonInputFormat[V] = {
    +    CarbonInputFormat.setCarbonReadSupport(classOf[RawDataReadSupport], 
conf)
    +    createInputFormat(conf)
    +  }
     
    -    iter
    +  private def createInputFormat(conf: Configuration): CarbonInputFormat[V] 
= {
    +    val format = new CarbonInputFormat[V]
    +    CarbonInputFormat.setTablePath(conf, identifier.getTablePath)
    +    CarbonInputFormat.setFilterPredicates(conf, filterExpression)
    +    val projection = new CarbonProjection
    +    columnProjection.foreach { attr =>
    +      projection.addColumn(attr.asInstanceOf[AttributeReference].name)
    +    }
    --- End diff --
    
    ok


---
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.
---

Reply via email to