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 #5315][FLINK] Propagate HIVE_CONF_DIR on launching Flink engine #5316

Closed
wants to merge 1 commit into from

Conversation

hadoopkandy
Copy link
Contributor

@hadoopkandy hadoopkandy commented Sep 20, 2023

Why are the changes needed?

create a Hive catalog in Flink SQL Client as follows:

CREATE CATALOG myhive WITH (
  'type' = 'hive', 
  'hive-conf-dir' = '/opt/hive-conf'
)

we should propagate hive-conf-dir and pass HIVE_CONF_DIR as an env variable to the AppMaster

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

Was this patch authored or co-authored using generative AI tooling?

No.

@hadoopkandy hadoopkandy changed the title [KYUUBI #5315] [Improvement] Propagate HIVE_CONF_DIR on launching Fli… [KYUUBI #5315] [Improvement] Propagate HIVE_CONF_DIR on launching Flink Sep 20, 2023
@pan3793
Copy link
Member

pan3793 commented Sep 20, 2023

Also, cc @YesOrNo828

@pan3793 pan3793 changed the title [KYUUBI #5315] [Improvement] Propagate HIVE_CONF_DIR on launching Flink [KYUUBI #5315][FLINK] Propagate HIVE_CONF_DIR on launching Flink engine Sep 20, 2023
@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2023

Codecov Report

Merging #5316 (2aec430) into master (cd325b4) will not change coverage.
Report is 1 commits behind head on master.
The diff coverage is 0.00%.

@@          Coverage Diff           @@
##           master   #5316   +/-   ##
======================================
  Coverage    0.00%   0.00%           
======================================
  Files         590     590           
  Lines       33429   33436    +7     
  Branches     4423    4423           
======================================
- Misses      33429   33436    +7     
Files Changed Coverage Δ
...ache/kyuubi/engine/flink/FlinkProcessBuilder.scala 0.00% <0.00%> (ø)

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

Copy link
Contributor

@YesOrNo828 YesOrNo828 left a comment

Choose a reason for hiding this comment

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

@hadoopkandy I left a minor comment, please take a look.

@@ -104,13 +104,23 @@ class FlinkProcessBuilder(
val userJars = conf.get(ENGINE_FLINK_APPLICATION_JARS)
userJars.foreach(jars => flinkExtraJars ++= jars.split(","))

val hiveConfDirOpt = env.get("HIVE_CONF_DIR")
hiveConfDirOpt.foreach { hiveConfDir =>
val hiveConf = s"${hiveConfDir}${File.separator}hive-site.xml"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be better to check if the hive-site.xml file exists here and throw an exception if it doesn't? @hadoopkandy WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i agree

Copy link
Contributor

@YesOrNo828 YesOrNo828 left a comment

Choose a reason for hiding this comment

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

LGTM

@pan3793 pan3793 added this to the v1.8.0 milestone Sep 21, 2023
@pan3793 pan3793 closed this in ffebc64 Sep 21, 2023
pan3793 pushed a commit that referenced this pull request Sep 21, 2023
### _Why are the changes needed?_

create a Hive catalog in Flink SQL Client as follows:

```
CREATE CATALOG myhive WITH (
  'type' = 'hive',
  'hive-conf-dir' = '/opt/hive-conf'
)
```
we should propagate `hive-conf-dir` and pass `HIVE_CONF_DIR` as an env variable to the AppMaster

### _How was this patch tested?_
- [x] 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/contributing/code/testing.html#running-tests) locally before make a pull request

### _Was this patch authored or co-authored using generative AI tooling?_
No.

Closes #5316 from hadoopkandy/KYUUBI-5315.

Closes #5315

3f12acb [kandy01.wang] [KYUUBI #5315] [Improvement] Propagate HIVE_CONF_DIR on launching Flink engine

Authored-by: kandy01.wang <kandy01.wang@vipshop.com>
Signed-off-by: Cheng Pan <chengpan@apache.org>
(cherry picked from commit ffebc64)
Signed-off-by: Cheng Pan <chengpan@apache.org>
@pan3793
Copy link
Member

pan3793 commented Sep 21, 2023

Thanks, merged to master/1.8

@pan3793
Copy link
Member

pan3793 commented Sep 21, 2023

@hadoopkandy would you mind linking your email kandy01.wang@vipshop.com to GitHub account? otherwise, your contribution won't be counted by GitHub

Copy link
Contributor

@link3280 link3280 left a comment

Choose a reason for hiding this comment

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

@hadoopkandy I left some comments. PTAL. We could make follow-up PR if necessary.

val builder = new FlinkProcessBuilder("paullam", applicationModeConf) {
override def env: Map[String, String] = envDefault
override def env: Map[String, String] = envWithAllHadoop
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be better to add a new test with hive conf env, leaving this test with default env as a negative case to ensure compatibility with the simplest default setup.

@hadoopkandy
Copy link
Contributor Author

@hadoopkandy would you mind linking your email kandy01.wang@vipshop.com to GitHub account? otherwise, your contribution won't be counted by GitHub

Never mind

@hadoopkandy hadoopkandy deleted the KYUUBI-5315 branch November 1, 2023 12:12
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