ConeyLiu commented on code in PR #9658:
URL: https://github.com/apache/incubator-doris/pull/9658#discussion_r876780913
##########
fe/fe-core/src/main/java/org/apache/doris/external/iceberg/IcebergCatalogImpl.java:
##########
@@ -14,54 +14,48 @@
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
-
package org.apache.doris.external.iceberg;
+import com.google.common.collect.Maps;
import org.apache.doris.catalog.IcebergProperty;
-
import org.apache.hadoop.conf.Configuration;
+import org.apache.iceberg.CatalogUtil;
import org.apache.iceberg.Table;
+import org.apache.iceberg.catalog.Catalog;
import org.apache.iceberg.catalog.Namespace;
+import org.apache.iceberg.catalog.SupportsNamespaces;
import org.apache.iceberg.catalog.TableIdentifier;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
-import java.util.HashMap;
import java.util.List;
import java.util.Map;
-/**
- * HiveCatalog of Iceberg
- */
-public class HiveCatalog implements IcebergCatalog {
- private static final Logger LOG = LogManager.getLogger(HiveCatalog.class);
+public class IcebergCatalogImpl implements IcebergCatalog {
+ private static final Logger LOG =
LogManager.getLogger(IcebergCatalogImpl.class);
- private org.apache.iceberg.hive.HiveCatalog hiveCatalog;
-
- public HiveCatalog() {
- hiveCatalog = new org.apache.iceberg.hive.HiveCatalog();
- }
+ private String catalogType;
+ private Catalog icebergCatalog;
@Override
public void initialize(IcebergProperty icebergProperty) {
- // set hadoop conf
+ this.catalogType = icebergProperty.getCatalogType();
+ Map<String, String> properties =
Maps.newHashMap(icebergProperty.getExtraProperties());
+ properties.put(CatalogUtil.ICEBERG_CATALOG_TYPE,
icebergProperty.getCatalogType());
+ // Hadoop configuration
Configuration conf = new Configuration();
- hiveCatalog.setConf(conf);
- // initialize hive catalog
- Map<String, String> catalogProperties = new HashMap<>();
- catalogProperties.put("uri", icebergProperty.getHiveMetastoreUris());
- hiveCatalog.initialize("hive", catalogProperties);
+ this.icebergCatalog =
CatalogUtil.buildIcebergCatalog(icebergProperty.getCatalogType(), properties,
conf);
Review Comment:
We could use the `iceberg.catalog.catalog-impl` property to load other
catalogs with the full catalog name.
##########
fe/fe-core/src/main/java/org/apache/doris/planner/IcebergScanNode.java:
##########
@@ -99,9 +98,6 @@ public String getNodeExplainString(String prefix,
TExplainLevel detailLevel) {
StringBuilder output = new StringBuilder();
if (!isLoad()) {
output.append(prefix).append("TABLE:
").append(icebergTable.getName()).append("\n");
- output.append(prefix).append("PATH: ")
Review Comment:
Added
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]