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

fix: Comet should not fail on negative limit parameter #288

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

viirya
Copy link
Member

@viirya viirya commented Apr 18, 2024

Which issue does this PR close?

Closes #287.

Rationale for this change

What changes are included in this PR?

How are these changes tested?

@viirya
Copy link
Member Author

viirya commented Apr 18, 2024

cc @sunchao @andygrove

Comment on lines 63 to 69
test("offset") {
assume(isSpark34Plus, "Dataset.offset is not available before Spark 3.4")
withSQLConf(CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true") {
checkSparkAnswer(testData.offset(90))
checkSparkAnswer(arrayData.toDF().offset(99))
checkSparkAnswer(mapData.toDF().offset(99))
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, Dataset.offset is a 3.4+ API. isSpark34Plus cannot make this test buildable with 3.2/3.3. 🤔

Comment on lines +44 to +51
// Dataset.offset API is not available before Spark 3.4
test("offset") {
withSQLConf(CometConf.COMET_COLUMNAR_SHUFFLE_ENABLED.key -> "true") {
checkSparkAnswer(testData.offset(90))
checkSparkAnswer(arrayData.toDF().offset(99))
checkSparkAnswer(mapData.toDF().offset(99))
}
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Dataset.offset API is only available on Spark 3.4+. I cannot have this test in CometExecSuite which will be built in Spark 3.2 and 3.3. So I move it to a 3.4 specific test suite.

Copy link
Contributor

@advancedxy advancedxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines 35 to 36
override protected def test(testName: String, testTags: Tag*)(testFun: => Any)(implicit
pos: Position): Unit = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the indentation looks weird.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@viirya viirya merged commit c698d82 into apache:main Apr 19, 2024
28 checks passed
@viirya
Copy link
Member Author

viirya commented Apr 19, 2024

Merged. Thanks.

@viirya viirya deleted the fix_neg_limit branch April 19, 2024 04:51
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
* fix: Comet should not fail on negative limit parameter

* Move test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Comet fails on limit operator with negative limit parameter
3 participants