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 the JDBC engine provider name #6037

Closed
wants to merge 1 commit into from

Conversation

silencily
Copy link
Contributor

@silencily silencily commented Feb 1, 2024

🔍 Description

Issue References 🔗

This pull request fixes create Jdbc Engine error:

 java.lang.IllegalArgumentException: Could not find a JDBC connection provider with name 'org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider' that can handle the specified driver and options. Available providers are [org.apache.kyuubi.engine.jdbc.doris.DorisConnectionProvider@57459491, org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider@dcfda20, org.apache.kyuubi.engine.jdbc.phoenix.PhoenixConnectionProvider@5c87bfe2, org.apache.kyuubi.engine.jdbc.postgresql.PostgreSQLConnectionProvider@51cd7ffc, org.apache.kyuubi.engine.jdbc.starrocks.StarRocksConnectionProvider@40f1be1b]

Describe Your Solution 🔧

  val ENGINE_JDBC_CONNECTION_PROVIDER: OptionalConfigEntry[String] =
    buildConf("kyuubi.engine.jdbc.connection.provider")
      .doc("A JDBC connection provider plugin for the Kyuubi Server " +
        "to establish a connection to the JDBC URL." +
        " The configuration value should be a subclass of " +
        "`org.apache.kyuubi.engine.jdbc.connection.JdbcConnectionProvider`. " +
        "Kyuubi provides the following built-in implementations: " +
        "<li>doris: For establishing Doris connections.</li> " +
        "<li>mysql: For establishing MySQL connections.</li> " +
        "<li>phoenix: For establishing Phoenix connections.</li> " +
        "<li>postgresql: For establishing PostgreSQL connections.</li>" +
        "<li>starrocks: For establishing StarRocks connections.</li>")
      .version("1.6.0")
      .stringConf
      .transform {
        case "Doris" | "doris" | "DorisConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.doris.DorisConnectionProvider"
        case "MySQL" | "mysql" | "MySQLConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider"
        case "Phoenix" | "phoenix" | "PhoenixConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.phoenix.PhoenixConnectionProvider"
        case "PostgreSQL" | "postgresql" | "PostgreSQLConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.postgresql.PostgreSQLConnectionProvider"
        case "StarRocks" | "starrocks" | "StarRocksConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.starrocks.StarRocksConnectionProvider"
        case other => other
      }
      .createOptional

because the provider name transforms the fully qualified class name, but class simple name is compared

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 🎉

I have passed this pull request at local integration testing

Related Unit Tests


Checklist 📝

Be nice. Be informative.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (208354c) 61.18% compared to head (35b3dc7) 61.10%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6037      +/-   ##
============================================
- Coverage     61.18%   61.10%   -0.08%     
  Complexity       23       23              
============================================
  Files           623      623              
  Lines         37144    37145       +1     
  Branches       5032     5033       +1     
============================================
- Hits          22726    22698      -28     
- Misses        11976    11998      +22     
- Partials       2442     2449       +7     

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

@pan3793 pan3793 changed the title fix create Jdbc Engine error Fix the JDBC engine provider name Feb 1, 2024
Copy link
Member

@pan3793 pan3793 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for fixing this. Does it affect branch-1.8 too?

@silencily
Copy link
Contributor Author

LGTM, thanks for fixing this. Does it affect branch-1.8 too?

It does not affect branch-1.8, this bug is caused by pull request #5464

@pan3793 pan3793 added this to the v1.9.0 milestone Feb 2, 2024
@pan3793 pan3793 closed this in a2179cc Feb 4, 2024
@pan3793
Copy link
Member

pan3793 commented Feb 4, 2024

Thanks, merged to master

zhaohehuhu pushed a commit to zhaohehuhu/incubator-kyuubi that referenced this pull request Feb 5, 2024
# 🔍 Description
## Issue References 🔗

This pull request fixes create Jdbc Engine error:
```
 java.lang.IllegalArgumentException: Could not find a JDBC connection provider with name 'org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider' that can handle the specified driver and options. Available providers are [org.apache.kyuubi.engine.jdbc.doris.DorisConnectionProvider57459491, org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProviderdcfda20, org.apache.kyuubi.engine.jdbc.phoenix.PhoenixConnectionProvider5c87bfe2, org.apache.kyuubi.engine.jdbc.postgresql.PostgreSQLConnectionProvider51cd7ffc, org.apache.kyuubi.engine.jdbc.starrocks.StarRocksConnectionProvider40f1be1b]
```

## Describe Your Solution 🔧

```
  val ENGINE_JDBC_CONNECTION_PROVIDER: OptionalConfigEntry[String] =
    buildConf("kyuubi.engine.jdbc.connection.provider")
      .doc("A JDBC connection provider plugin for the Kyuubi Server " +
        "to establish a connection to the JDBC URL." +
        " The configuration value should be a subclass of " +
        "`org.apache.kyuubi.engine.jdbc.connection.JdbcConnectionProvider`. " +
        "Kyuubi provides the following built-in implementations: " +
        "<li>doris: For establishing Doris connections.</li> " +
        "<li>mysql: For establishing MySQL connections.</li> " +
        "<li>phoenix: For establishing Phoenix connections.</li> " +
        "<li>postgresql: For establishing PostgreSQL connections.</li>" +
        "<li>starrocks: For establishing StarRocks connections.</li>")
      .version("1.6.0")
      .stringConf
      .transform {
        case "Doris" | "doris" | "DorisConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.doris.DorisConnectionProvider"
        case "MySQL" | "mysql" | "MySQLConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider"
        case "Phoenix" | "phoenix" | "PhoenixConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.phoenix.PhoenixConnectionProvider"
        case "PostgreSQL" | "postgresql" | "PostgreSQLConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.postgresql.PostgreSQLConnectionProvider"
        case "StarRocks" | "starrocks" | "StarRocksConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.starrocks.StarRocksConnectionProvider"
        case other => other
      }
      .createOptional
```

because the provider name transforms the fully qualified class name, but class simple name is compared

## Types of changes 🔖

- [x] 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 🎉

I have passed this pull request at local integration testing

#### Related Unit Tests

---

# Checklist 📝

- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes apache#6037 from silencily/bugfix-jdbc-provider.

Closes apache#6037

35b3dc7 [silencily] fix create Jdbc Engine error

Authored-by: silencily <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
zhaohehuhu pushed a commit to zhaohehuhu/incubator-kyuubi that referenced this pull request Mar 21, 2024
# 🔍 Description
## Issue References 🔗

This pull request fixes create Jdbc Engine error:
```
 java.lang.IllegalArgumentException: Could not find a JDBC connection provider with name 'org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider' that can handle the specified driver and options. Available providers are [org.apache.kyuubi.engine.jdbc.doris.DorisConnectionProvider57459491, org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProviderdcfda20, org.apache.kyuubi.engine.jdbc.phoenix.PhoenixConnectionProvider5c87bfe2, org.apache.kyuubi.engine.jdbc.postgresql.PostgreSQLConnectionProvider51cd7ffc, org.apache.kyuubi.engine.jdbc.starrocks.StarRocksConnectionProvider40f1be1b]
```

## Describe Your Solution 🔧

```
  val ENGINE_JDBC_CONNECTION_PROVIDER: OptionalConfigEntry[String] =
    buildConf("kyuubi.engine.jdbc.connection.provider")
      .doc("A JDBC connection provider plugin for the Kyuubi Server " +
        "to establish a connection to the JDBC URL." +
        " The configuration value should be a subclass of " +
        "`org.apache.kyuubi.engine.jdbc.connection.JdbcConnectionProvider`. " +
        "Kyuubi provides the following built-in implementations: " +
        "<li>doris: For establishing Doris connections.</li> " +
        "<li>mysql: For establishing MySQL connections.</li> " +
        "<li>phoenix: For establishing Phoenix connections.</li> " +
        "<li>postgresql: For establishing PostgreSQL connections.</li>" +
        "<li>starrocks: For establishing StarRocks connections.</li>")
      .version("1.6.0")
      .stringConf
      .transform {
        case "Doris" | "doris" | "DorisConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.doris.DorisConnectionProvider"
        case "MySQL" | "mysql" | "MySQLConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.mysql.MySQLConnectionProvider"
        case "Phoenix" | "phoenix" | "PhoenixConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.phoenix.PhoenixConnectionProvider"
        case "PostgreSQL" | "postgresql" | "PostgreSQLConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.postgresql.PostgreSQLConnectionProvider"
        case "StarRocks" | "starrocks" | "StarRocksConnectionProvider" =>
          "org.apache.kyuubi.engine.jdbc.starrocks.StarRocksConnectionProvider"
        case other => other
      }
      .createOptional
```

because the provider name transforms the fully qualified class name, but class simple name is compared

## Types of changes 🔖

- [x] 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 🎉

I have passed this pull request at local integration testing

#### Related Unit Tests

---

# Checklist 📝

- [ ] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

**Be nice. Be informative.**

Closes apache#6037 from silencily/bugfix-jdbc-provider.

Closes apache#6037

35b3dc7 [silencily] fix create Jdbc Engine error

Authored-by: silencily <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
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.

5 participants