Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test limitpush down #429

Open
wants to merge 1 commit into
base: branch-0.7
Choose a base branch
from
Open
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 @@ -198,6 +198,8 @@ class DeltaSharedTable(
refreshToken: Option[String]
): (Long, Seq[model.SingleAction]) = withClassLoader {
// TODO Support `limitHint`
// scalastyle:off println
Console.println(s"----[linzhou]----TableLoader, limit:$limitHint")
if (Seq(version, timestamp, startingVersion).filter(_.isDefined).size >= 2) {
throw new DeltaSharingIllegalArgumentException(
ErrorStrings.multipleParametersSetErrorMsg(Seq("version", "timestamp", "startingVersion"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ private[spark] class DeltaSharingRestClient(
timestampAsOf: Option[String],
jsonPredicateHints: Option[String],
refreshToken: Option[String]): DeltaTableFiles = {
// scalastyle:off println
Console.println(s"----[linzhou]----Client, limit:$limit")
// Retrieve refresh token when querying the latest snapshot.
val includeRefreshToken = versionAsOf.isEmpty && timestampAsOf.isEmpty
val encodedShareName = URLEncoder.encode(table.share, "UTF-8")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ object DeltaSharingLimitPushDown extends Rule[LogicalPlan] {
_, _, _)
) =>
if (remoteIndex.limitHint.isEmpty) {
// scalastyle:off println
Console.println(s"----[linzhou]----PushDown, limit:$limit")
val spark = SparkSession.active
LocalLimit(literalExpr,
l.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ class DeltaSharingSuite extends QueryTest with SharedSparkSession with DeltaShar
}
}

integrationTest("cdf_table_with_partition: limit pushdown") {
val tablePath = testProfileFile.getCanonicalPath + "#share8.default.cdf_table_with_partition"

val expected = Seq(
Row("2", 2, sqlDate("2020-02-02"))
)
val result = spark.read.format("deltaSharing").load(tablePath).limit(1)
checkAnswer(result, expected)
}

integrationTest("cdf_table_with_partition: filter success") {
val tablePath = testProfileFile.getCanonicalPath + "#share8.default.cdf_table_with_partition"

Expand Down