Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,12 @@ case class TypedImperativeAggRowsColumn[B](
val estimRowSize =
if (rows.length >= N) {
val totalSize = (0 until N)
.map(i => {
serializedRow(i) match {
.foldLeft(0)((total, i) => {
total + (serializedRow(i) match {
case row if row != null => row.length
case null => 0
}
})
})
.sum
val estimRowSize = totalSize / N * 4 + 16
evaluator.estimatedRowSize = Some(estimRowSize)
estimRowSize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ abstract class NativeFileSourceScanBase(basedFileScan: FileSourceScanExec)
private val fileSizes = inputFileScanRDD.filePartitions
.flatMap(_.files)
.groupBy(_.filePath)
.mapValues(_.map(_.length).sum)
.mapValues(_.foldLeft(0L)(_ + _.length))
.map(identity) // make this map serializable

protected def nativePruningPredicateFilters: Seq[pb.PhysicalExprNode] =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ abstract class NativeHiveTableScanBase(basedHiveScan: HiveTableScanExec)
private lazy val fileSizes = partitions
.flatMap(_.files)
.groupBy(_.filePath)
.mapValues(_.map(_.length).sum)
.mapValues(_.foldLeft(0L)(_ + _.length))
.map(identity) // make this map serializable

// should not include partition columns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class Tables(sqlContext: SQLContext, scaleFactor: Int) extends Serializable {
val cached = data.cache()
val plainDataSize = cached
.mapPartitions { iter =>
Iterator.single(iter.map(_.mkString("\t").length).sum.toLong)
Iterator.single(iter.foldLeft(0L)(_ + _.mkString("\t").length.toLong))
}
.collect()
.sum
Expand Down
Loading