Skip to content

[Bug 2923] Hive JDBC connection parameter ignored#3194

Merged
davidzollo merged 8 commits intoapache:devfrom
CycloneBoy:dev
Jul 13, 2020
Merged

[Bug 2923] Hive JDBC connection parameter ignored#3194
davidzollo merged 8 commits intoapache:devfrom
CycloneBoy:dev

Conversation

@CycloneBoy
Copy link
Copy Markdown
Contributor

fix the bug #2923

Tips

What is the purpose of the pull request

This pull request fix the bug #2923

Corrected the connection string of hive jdbc link string. If the parameter in the link string is the configuration parameter in hive-default.xml, add it before the parameter ?.

see the hive Connection URLs - Connection URL Format
HiveServer2Clients-ConnectionURLs

Connection URLs
Connection URL Format
The HiveServer2 URL is a string with the following syntax:

jdbc:hive2://<host1>:<port1>,<host2>:<port2>/dbName;initFile=<file>;sess_var_list?hive_conf_list#hive_var_list

where

<host1>:<port1>,<host2>:<port2> is a server instance or a comma separated list of server instances to connect to (if dynamic service discovery is enabled). If empty, the embedded server will be used.
dbName is the name of the initial database.
<file> is the path of init script file (Hive 2.2.0 and later). This script file is written with SQL statements which will be executed automatically after connection. This option can be empty. 
sess_var_list is a semicolon separated list of key=value pairs of session variables (e.g., user=foo;password=bar).
hive_conf_list is a semicolon separated list of key=value pairs of Hive configuration variables for this session
hive_var_list is a semicolon separated list of key=value pairs of Hive variables for this session.
Special characters in sess_var_list, hive_conf_list, hive_var_list parameter values should be encoded with URL encoding if needed.

Brief change log

  • Modify the function of org.apache.dolphinscheduler.dao.datasource.HiveDataSource#filterOther
  • Add HiveDataSourceTest.java for the test case of the HiveDataSource#filterOther

Verify this pull request

This change added tests and can be verified as follows:

  • Added HiveDataSourceTest to verify the change.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Merging #3194 into dev will increase coverage by 0.22%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #3194      +/-   ##
============================================
+ Coverage     33.52%   33.74%   +0.22%     
- Complexity     2395     2404       +9     
============================================
  Files           442      442              
  Lines         20613    20626      +13     
  Branches       2525     2528       +3     
============================================
+ Hits           6910     6960      +50     
+ Misses        13044    13005      -39     
- Partials        659      661       +2     
Impacted Files Coverage Δ Complexity Δ
...olphinscheduler/dao/datasource/HiveDataSource.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...he/dolphinscheduler/api/service/LoggerService.java 82.60% <0.00%> (-8.70%) 9.00% <0.00%> (-1.00%)
...dolphinscheduler/api/service/SchedulerService.java 24.78% <0.00%> (+22.26%) 13.00% <0.00%> (+10.00%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aea702e...76d9ac7. Read the comment docs.

@yangyichao-mango
Copy link
Copy Markdown
Contributor

Hi,

Thx a lot for your contribution.
You should put HiveDataSourceTest.java to root pom maven-surefire-plugin to avoiding the sonar 0.0% Coverage.
If you have any question and suggestion, please put forward.

@CycloneBoy
Copy link
Copy Markdown
Contributor Author

CycloneBoy commented Jul 12, 2020 via email

Copy link
Copy Markdown
Contributor

@davidzollo davidzollo left a comment

Choose a reason for hiding this comment

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

+1
good job

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

96.3% 96.3% Coverage
0.0% 0.0% Duplication

@davidzollo davidzollo linked an issue Jul 13, 2020 that may be closed by this pull request
@davidzollo davidzollo merged commit 98fdba6 into apache:dev Jul 13, 2020
@davidzollo
Copy link
Copy Markdown
Contributor

@davidzollo davidzollo added the bug Something isn't working label Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Hive JDBC connection parameter ignored

4 participants