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

[KYUUBI #4522] use:catalog should execute before than use:database #4648

Closed
wants to merge 4 commits into from

Conversation

lsm1
Copy link
Contributor

@lsm1 lsm1 commented Apr 2, 2023

Why are the changes needed?

close #4522

How was this patch tested?

  • Add some test cases that check the changes thoroughly including negative and positive cases if possible

  • Add screenshots for manual tests if appropriate

  • Run test locally before make a pull request

@codecov-commenter
Copy link

codecov-commenter commented Apr 2, 2023

Codecov Report

Merging #4648 (eda34d4) into master (4c2f1e6) will decrease coverage by 0.04%.
The diff coverage is 0.00%.

❗ Current head eda34d4 differs from pull request most recent head e060468. Consider uploading reports for the commit e060468 to get more accurate results

@@             Coverage Diff              @@
##             master    #4648      +/-   ##
============================================
- Coverage     57.64%   57.60%   -0.04%     
  Complexity       13       13              
============================================
  Files           579      579              
  Lines         31901    31956      +55     
  Branches       4263     4270       +7     
============================================
+ Hits          18389    18409      +20     
- Misses        11755    11786      +31     
- Partials       1757     1761       +4     
Impacted Files Coverage Δ
...kyuubi/engine/spark/session/SparkSessionImpl.scala 65.11% <0.00%> (ø)

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -57,16 +57,20 @@ class FlinkSessionImpl(

override def open(): Unit = {
executor.openSession(handle.identifier.toString)
normalizedConf.foreach {
case ("use:catalog", catalog) =>
normalizedConf.get("use:catalog") match {
Copy link
Member

@pan3793 pan3793 Apr 3, 2023

Choose a reason for hiding this comment

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

How about

    val (useCatalogAndDatabaseConf, otherConf) = normalizedConf.partition { case (k, _) =>
      Array("use:catalog", "use:database").contains(k)
    }

?

@bowenliang123
Copy link
Contributor

Apply the same changes on Trino session too?

Array("use:catalog", "use:database").contains(k)
}

useCatalogAndDatabaseConf.get("use:catalog") match {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
useCatalogAndDatabaseConf.get("use:catalog") match {
useCatalogAndDatabaseConf.get("use:catalog").foreach { catalog =>
...

@pan3793 pan3793 changed the title [KYUUBI #4522][Bug] The use:catalog and use:database execution order seems not guaranteed [KYUUBI #4522] use:catalog should execute before than use:database Apr 4, 2023
@pan3793 pan3793 added this to the v1.7.1 milestone Apr 4, 2023
@pan3793
Copy link
Member

pan3793 commented Apr 4, 2023

Thanks, merged to master/1.7

@pan3793 pan3793 closed this in f0796ec Apr 4, 2023
pan3793 pushed a commit that referenced this pull request Apr 4, 2023
### _Why are the changes needed?_

close #4522

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.readthedocs.io/en/master/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #4648 from lsm1/fix/kyuubi_4522.

Closes #4522

e060468 [senmiaoliu] use foreach
bd83d66 [senmiaoliu] spilt narmalizedConf
4d8445a [senmiaoliu] avoid sort
eda34d4 [senmiaoliu] use catalog first

Authored-by: senmiaoliu <senmiaoliu@trip.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit f0796ec)
Signed-off-by: Cheng Pan <chengpan@apache.org>
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.

[Bug] The use:catalog and use:database execution order seems not guaranteed
4 participants