[HUDI-2499] Making jdbc-url, user and pass as non-required field for other sync modes (#3732)
This commit is contained in:
@@ -40,13 +40,13 @@ public class HiveSyncConfig implements Serializable {
|
||||
@Parameter(names = {"--base-file-format"}, description = "Format of the base files (PARQUET (or) HFILE)")
|
||||
public String baseFileFormat = "PARQUET";
|
||||
|
||||
@Parameter(names = {"--user"}, description = "Hive username", required = true)
|
||||
@Parameter(names = {"--user"}, description = "Hive username")
|
||||
public String hiveUser;
|
||||
|
||||
@Parameter(names = {"--pass"}, description = "Hive password", required = true)
|
||||
@Parameter(names = {"--pass"}, description = "Hive password")
|
||||
public String hivePass;
|
||||
|
||||
@Parameter(names = {"--jdbc-url"}, description = "Hive jdbc connect url", required = true)
|
||||
@Parameter(names = {"--jdbc-url"}, description = "Hive jdbc connect url")
|
||||
public String jdbcUrl;
|
||||
|
||||
@Parameter(names = {"--base-path"}, description = "Basepath of hoodie table to sync", required = true)
|
||||
|
||||
@@ -33,6 +33,7 @@ import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* This class offers DDL executor backed by the jdbc This class preserves the old useJDBC = true way of doing things.
|
||||
@@ -44,6 +45,9 @@ public class JDBCExecutor extends QueryBasedDDLExecutor {
|
||||
|
||||
public JDBCExecutor(HiveSyncConfig config, FileSystem fs) {
|
||||
super(config, fs);
|
||||
Objects.requireNonNull(config.jdbcUrl, "--jdbc-url option is required for jdbc sync mode");
|
||||
Objects.requireNonNull(config.hiveUser, "--user option is required for jdbc sync mode");
|
||||
Objects.requireNonNull(config.hivePass, "--pass option is required for jdbc sync mode");
|
||||
this.config = config;
|
||||
createHiveConnection(config.jdbcUrl, config.hiveUser, config.hivePass);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user