sunrisefromdark commented on code in PR #9012:
URL: https://github.com/apache/inlong/pull/9012#discussion_r1349484205
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/ck/ClickHouseJdbcUtils.java:
##########
@@ -39,34 +39,70 @@
public class ClickHouseJdbcUtils {
private static final String CLICKHOUSE_DRIVER_CLASS =
"ru.yandex.clickhouse.ClickHouseDriver";
- private static final String METADATA_TYPE = "TABLE";
private static final String COLUMN_LABEL = "TABLE_NAME";
private static final String CLICKHOUSE_JDBC_PREFIX = "jdbc:clickhouse";
private static final Logger LOG =
LoggerFactory.getLogger(ClickHouseJdbcUtils.class);
/**
- * Get ClickHouse connection from clickhouse url and user
+ * Get ClickHouse connection from ClickHouse URL and user.
+ *
+ * @param url JDBC URL, such as jdbc:clickhouse://host:port/database
+ * @param user Username for JDBC URL
+ * @param password User password
+ * @return {@link Connection}
+ * @throws Exception on get connection error
*/
public static Connection getConnection(String url, String user, String
password) throws Exception {
- if (StringUtils.isBlank(url) ||
!url.startsWith(CLICKHOUSE_JDBC_PREFIX)) {
- throw new Exception("ClickHouse server URL was invalid, it should
start with jdbc:clickhouse");
+ // Non-empty validation
+ if (StringUtils.isBlank(url) || StringUtils.isBlank(user) ||
StringUtils.isBlank(password)) {
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]