Skip to content
Closed
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 @@ -85,9 +85,12 @@ private[sql] object DataSourceStrategy extends Strategy with Logging {
s"Selected $selected partitions out of $total, pruned $percentPruned% partitions."
}

// need to add projections from combineFilters in
val combineProjections =
projects.toSet.union(combineFilters.flatMap(_.references).toSet).toSeq
val scan = buildPartitionedTableScan(
l,
projects,
combineProjections,
pushedFilters,
t.partitionSpec.partitionColumns,
selectedPartitions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,31 @@ class DataFrameNaFunctionsSuite extends QueryTest with SharedSQLContext {
assert(out1(4) === Row("Amy", null, null))
assert(out1(5) === Row(null, null, null))
}

test("dropna with partitionBy and groupBy") {
withTempPath { dir =>
val df = sqlContext.range(10)
val df1 = df.withColumn("a", $"id".cast("int"))
df1.write.partitionBy("id").parquet(dir.getCanonicalPath)

val df2 = sqlContext.read.parquet(dir.getCanonicalPath)

val group = df2.na.drop().groupBy().count()
group.collect()
}
}

test("dropna with partitionBy") {
withTempPath { dir =>
val df = sqlContext.range(10)
val df1 = df.withColumn("a", $"id".cast("int"))
df1.write.partitionBy("id").parquet(dir.getCanonicalPath)

val df2 = sqlContext.read.parquet(dir.getCanonicalPath)

val group = df2.na.drop().count()

}
}

}