-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: master
Are you sure you want to change the base?
Conversation
import com.fasterxml.jackson.databind.node.ArrayNode; | ||
import com.fasterxml.jackson.databind.node.ObjectNode; | ||
|
||
/** @author Qin* */ |
There was a problem hiding this comment.
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
...asource/linkis-metadata/src/main/java/org/apache/linkis/metadata/util/HiveService2Utils.java
Outdated
Show resolved
Hide resolved
if (StringUtils.isNotBlank(hiveServer2Username)) { | ||
username = hiveServer2Username; | ||
} | ||
conn = DriverManager.getConnection(url, username, hiveServer2Password); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.*; |
There was a problem hiding this comment.
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.*; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
There was a problem hiding this 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"; |
There was a problem hiding this comment.
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 ?
Please handle the third dependency check problem. |
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/