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 check write for spark 3.5 unit tests #6793

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wForget
Copy link
Member

@wForget wForget commented Nov 5, 2024

🔍 Description

Issue References 🔗

KyuubiSparkSQLExtensionTest#withListener in Spark 3.5 may not work, make the following adjustments:

  • skip AdaptiveSparkPlanExec when collecting writes
  • execute callback function in main thread to avoid assert failed not working
  • add collectRebalancePartitions methoad
  • fix unit tests

Describe Your Solution 🔧

Types of changes 🔖

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Test Plan 🧪

Behavior Without This Pull Request ⚰️

Behavior With This Pull Request 🎉

Related Unit Tests


Checklist 📝

Be nice. Be informative.

@wForget wForget changed the title Fix check write test Fix check write for spark 3.5 unit tests Nov 5, 2024
assert(write.isInstanceOf[InsertIntoHadoopFsRelationCommand])
checkSort(write.query)
}
// TODO: CreateDataSourceTableAsSelectCommand is not supported
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

why does CreateDataSourceTableAsSelectCommandnot support ? CreateDataSourceTableAsSelectCommand should call InsertIntoHadoopFsRelationCommand internally.

Copy link
Member Author

Choose a reason for hiding this comment

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

InsertIntoHadoopFsRelationCommand's catalogTable will be empty

Copy link
Member Author

@wForget wForget Nov 6, 2024

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (b4838b4) to head (a989de5).

Additional details and impacted files
@@          Coverage Diff           @@
##           master   #6793   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         687     687           
  Lines       42442   42442           
  Branches     5793    5793           
======================================
  Misses      42442   42442           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

def collect(p: LogicalPlan): Seq[RebalancePartitions] = {
p.flatMap {
case r: RebalancePartitions => Seq(r)
case s: LogicalQueryStage => collect(s.logicalPlan)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need to match LogicalQueryStage ?

Copy link
Member Author

Choose a reason for hiding this comment

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

This test case gets a logical plan like this:

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it a Spark issue ? IMO, LogicalQueryStage should not exist in query execution.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess it's because the logical plan is obtained by write.cmd

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

Successfully merging this pull request may close these issues.

3 participants