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

scriptis left database menu bar supports hiveserver2 to get library table fields #4909

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

Conversation

MrFengqin
Copy link
Contributor

@MrFengqin MrFengqin commented Sep 21, 2023

What is the purpose of the change

The left database menu bar of scriptis supports hiveserver2 to get library table fields, which is off by default
Related parameters:
To enable this function, you need to add the following configuration in the linkis-ps-publicservice. properties file
Enable hiveserver2 access: linkis.hive.server2.enable=true
Configuration hiveserver2 address: linkis.hive.server2.address=jdbc:hive2://127.0.0.1:10000/

@MrFengqin MrFengqin changed the title scriptis 左侧数据库菜单栏支持hiveserver2获取库表字段 scriptis left database menu bar supports hiveserver2 to get library table fields Sep 21, 2023
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;

/** @author Qin* */
Copy link
Contributor

Choose a reason for hiding this comment

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

need to remove author info

if (StringUtils.isNotBlank(hiveServer2Username)) {
username = hiveServer2Username;
}
conn = DriverManager.getConnection(url, username, hiveServer2Password);
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to use connection pool?


private static final String defaultDb = "default";
private static Connection conn = null;
private static Statement stat = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

It should not be defined as a property, otherwise there will be concurrency problems


import org.apache.commons.lang.StringUtils;

import java.sql.*;
Copy link
Member

Choose a reason for hiding this comment

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

It's better not to import * ,just import the necessary ones.


import java.sql.*;
import java.text.SimpleDateFormat;
import java.util.*;
Copy link
Member

Choose a reason for hiding this comment

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

same here

Copy link
Contributor

@peacewong peacewong left a comment

Choose a reason for hiding this comment

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

LGTM.

private static final String driverName = "org.apache.hive.jdbc.HiveDriver";

private static final String defaultDb = "default";
private static final String defaultPassword = "123456";
Copy link
Contributor

Choose a reason for hiding this comment

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

need to be set defaultPassword ?

@aiceflower
Copy link
Contributor

Please handle the third dependency check problem.
You can refer to this guide to repair it. https://linkis.apache.org/zh-CN/docs/latest/development/development-specification/license

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants