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-beeline auto constructs JDBC URL from kyuubi-defaults.conf #6339

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

Conversation

zhaohehuhu
Copy link
Contributor

@zhaohehuhu zhaohehuhu commented Apr 26, 2024

🔍 Description

Issue References 🔗

as title
This pull request closes #6255

Describe Your Solution 🔧

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

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.

try {
Map<String, String> propsMap = getPropertiesFromFile(propsFile);
StringBuilder hiveConf = new StringBuilder();
for (Entry<String, String> kv : propsMap.entrySet()) {
Copy link
Member

Choose a reason for hiding this comment

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

Load all configurations? Should we use a fixed prefix like BEELINE_CONNECTION_PROPERTY_PREFIX?

Copy link
Member

Choose a reason for hiding this comment

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

the intention is infer Kyuubi connection info from the existing kyuubi-defaults.conf, instead supporting configuring beeline specific configurations inside kyuubi-defaults.conf

Copy link
Member

Choose a reason for hiding this comment

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

Currently, most of configurations in kyuubi-defaults.conf are server-side configurations. We can define a prefix to determine whether it is a client config, and then add them to hive_conf of jdbc url.

In addition to inferring HIVE_CONF_PROPERTY_KEY, we also need to infer HOST_PROPERTY_KEY based on server configuration.

Copy link
Member

Choose a reason for hiding this comment

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

We can define a prefix to determine whether it is a client config

beeline-site.xml takes responsibility for that, I don't think we should propagate it to kyuubi-defaults.conf

Why do we need HOST_PROPERTY_KEY?

Copy link
Member

Choose a reason for hiding this comment

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

beeline-site.xml takes responsibility for that, I don't think we should propagate it to kyuubi-defaults.conf

In addition to kyuubi server host and port, what other valid configurations can we infer in the current kyuubi-defaults.conf?

Why do we need HOST_PROPERTY_KEY?

Pass server host and port configured in kyuubi-defaults.conf to jdbc url.

// get the connection properties from user specific config file
Properties properties = kyuubiConfFileParser.getConnectionProperties();
for (String key : properties.stringPropertyNames()) {
userConnectionProperties.setProperty(key, properties.getProperty(key));
Copy link
Member

Choose a reason for hiding this comment

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

We should merge HIVE_CONF_PROPERTY_KEY instead of overwriting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done.

@pan3793
Copy link
Member

pan3793 commented Apr 26, 2024

we need the design before implementation.

what's the priority of those configuration files? does our change break the compatibility of vanilla Hive BeeLine? should we merge configurations from different files?

@github-actions github-actions bot added the kind:documentation Documentation is a feature! label May 10, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 10, 2024

Codecov Report

Attention: Patch coverage is 0% with 150 lines in your changes missing coverage. Please review.

Project coverage is 0.00%. Comparing base (f7e8d69) to head (c90265e).
Report is 1 commits behind head on master.

Files Patch % Lines
...ve/beeline/hs2connection/KyuubiConfFileParser.java 0.00% 87 Missing ⚠️
...rc/main/java/org/apache/kyuubi/util/JavaUtils.java 0.00% 30 Missing ⚠️
...src/main/java/org/apache/hive/beeline/BeeLine.java 0.00% 12 Missing ⚠️
...ne/hs2connection/KyuubiConfFileParseException.java 0.00% 4 Missing ⚠️
...ine/hs2connection/UserHS2ConnectionFileParser.java 0.00% 4 Missing ⚠️
...ache/kyuubi/server/KyuubiRestFrontendService.scala 0.00% 3 Missing ⚠️
...ache/kyuubi/engine/spark/SparkProcessBuilder.scala 0.00% 2 Missing ⚠️
...che/kyuubi/server/KyuubiTrinoFrontendService.scala 0.00% 2 Missing ⚠️
...rg/apache/kyuubi/zookeeper/EmbeddedZookeeper.scala 0.00% 2 Missing ⚠️
...rg/apache/kyuubi/engine/spark/SparkSQLEngine.scala 0.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #6339    +/-   ##
=======================================
  Coverage    0.00%   0.00%            
=======================================
  Files         675     677     +2     
  Lines       41641   41744   +103     
  Branches     5685    5702    +17     
=======================================
- Misses      41641   41744   +103     

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

@zhaohehuhu
Copy link
Contributor Author

plz help review again @pan3793 @wForget. Thanks!

@pan3793
Copy link
Member

pan3793 commented Jun 4, 2024

thanks for update, will take a look soon

@zhaohehuhu
Copy link
Contributor Author

thanks for update, will take a look soon

Appreciate it.


2. `beeline-hs2-connection.xml`: This file is checked next, and any properties in this file take precedence over those in `beeline-site.xml`.

3. `kyuubi-defaults.conf`: Properties from this file are loaded next. Values in this file may merge with the values of hiveconf from `beeline-hs2-connection.xml`.
Copy link
Member

Choose a reason for hiding this comment

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

the "merge" behavior is confusing here, which one will take effect for duplicated properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They are both appended to the URL, but the latter one will take effect in case of duplicated properties.

@pan3793
Copy link
Member

pan3793 commented Jun 4, 2024

@zhaohehuhu before looking into the code, I read and modified kyuubi_beeline.md, almost good, there is still one question on the docs, could you please clarify it?

@pan3793
Copy link
Member

pan3793 commented Jun 4, 2024

Also cc @wForget, do you think the behavior described in the docs make sense?

| kyuubi.authentication.ldap.userFilter | comma-separated values are not supported |
| kyuubi.batch.conf.ignore.list | comma-separated values are not supported |
| kyuubi.frontend.protocols | comma-separated values are not supported |
| kyuubi.frontend.thrift.binary.ssl.disallowed.protocols | The value(REST) is an existing keyword in Beeline |
Copy link
Member

Choose a reason for hiding this comment

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

let's use word "Kyuubi Beeline" to distinguish with Hive Beeline

Suggested change
| kyuubi.frontend.thrift.binary.ssl.disallowed.protocols | The value(REST) is an existing keyword in Beeline |
| kyuubi.frontend.thrift.binary.ssl.disallowed.protocols | The value(REST) is an existing keyword in Kyuubi Beeline |

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. Thanks.

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.

[TASK][MEDIUM] kyuubi-beeline auto constructs JDBC URL from kyuubi-defaults.conf
4 participants