wg1026688210 commented on code in PR #887:
URL: https://github.com/apache/incubator-paimon/pull/887#discussion_r1174520739
##########
paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java:
##########
@@ -97,18 +100,31 @@ public class HiveCatalog extends AbstractCatalog {
private final String clientClassName;
private final IMetaStoreClient client;
+ private LocationHelper locationHelper;
+
public HiveCatalog(FileIO fileIO, HiveConf hiveConf, String
clientClassName) {
- super(fileIO);
- this.hiveConf = hiveConf;
- this.clientClassName = clientClassName;
- this.client = createClient(hiveConf, clientClassName);
+ this(fileIO, hiveConf, clientClassName, Collections.emptyMap());
}
public HiveCatalog(
FileIO fileIO, HiveConf hiveConf, String clientClassName,
Map<String, String> options) {
super(fileIO, options);
this.hiveConf = hiveConf;
this.clientClassName = clientClassName;
+
+ boolean needLocationInProperties =
+ hiveConf.getBoolean(
+ LOCATION_IN_PROPERTIES.key(),
LOCATION_IN_PROPERTIES.defaultValue());
+ if (needLocationInProperties) {
+ locationHelper = new TBPropertiesLocationHelper(hiveConf);
+ } else {
+ // set the warehouse location to the hiveConf
+ String warehouse = hiveConf.get(CatalogOptions.WAREHOUSE.key());
+ hiveConf.set(HiveConf.ConfVars.METASTOREWAREHOUSE.varname,
warehouse);
+
+ locationHelper = new StorageLocationHelper(hiveConf);
Review Comment:
if we pass warehouse to `HiveCatalog` at the above conversation , we can
specify the warehouse directly .So that we don't need pass `hiveConf` to
`LocationHelper` at the both `LocationHelper` separately . Shall we retain
`hiveConf.set(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, warehouse)`
outside the `LocationHelper`.
--
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]