wuwenchi commented on code in PR #36289: URL: https://github.com/apache/doris/pull/36289#discussion_r1641606315
########## fe/fe-core/src/main/java/org/apache/doris/common/info/SimpleTableInfo.java: ########## @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +// This file is copied from +// https://github.com/apache/impala/blob/branch-2.9.0/fe/src/main/java/org/apache/impala/AnalysisException.java +// and modified by Doris + +package org.apache.doris.common.info; + +import java.util.Objects; + +public class SimpleTableInfo { Review Comment: 1. Generally, when you override the `equal` method, you also need to override the `hashCode` method. 2. If you just want to express database and table, you can refactor this class: `DatabaseTableName` ########## fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergTransaction.java: ########## @@ -59,140 +66,114 @@ public void updateIcebergCommitData(List<TIcebergCommitData> commitDataList) { } } - public void beginInsert(String dbName, String tbName) { - Table icebergTable = ops.getCatalog().loadTable(TableIdentifier.of(dbName, tbName)); - transaction = icebergTable.newTransaction(); + public void pendingCommit(SimpleTableInfo tableInfo) { Review Comment: If possible, we try to keep all table insertions using the same function name, including hive, iceberg, and paimon, hudi, etc. that may be supported later. ########## fe/fe-core/src/main/java/org/apache/doris/datasource/statistics/CommonStatistics.java: ########## @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.datasource.statistics; + +public class CommonStatistics { Review Comment: Can this class be considered to be merged with `HivePartitionStatistics`? ########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/insert/IcebergInsertExecutor.java: ########## @@ -51,21 +52,27 @@ public void setCollectCommitInfoFunc() { coordinator.setIcebergCommitDataFunc(transaction::updateIcebergCommitData); } + @Override + protected void beforeExec() { + String dbName = ((IcebergExternalTable) table).getDbName(); + String tbName = table.getName(); + SimpleTableInfo tableInfo = new SimpleTableInfo(dbName, tbName); + IcebergTransaction transaction = (IcebergTransaction) transactionManager.getTransaction(txnId); + transaction.pendingCommit(tableInfo); + } + @Override protected void doBeforeCommit() throws UserException { + String dbName = ((IcebergExternalTable) table).getDbName(); + String tbName = table.getName(); + SimpleTableInfo tableInfo = new SimpleTableInfo(dbName, tbName); IcebergTransaction transaction = (IcebergTransaction) transactionManager.getTransaction(txnId); - loadedRows = transaction.getUpdateCnt(); Review Comment: Why is the update count not showing now? ########## fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergUtils.java: ########## @@ -583,29 +590,34 @@ public static long getIcebergRowCount(ExternalCatalog catalog, String dbName, St return -1; } - public static String getFileFormat(Table table) { - Map<String, String> properties = table.properties(); - if (properties.containsKey(WRITE_FORMAT)) { - return properties.get(WRITE_FORMAT); - } - if (properties.containsKey(TableProperties.DEFAULT_FILE_FORMAT)) { - return properties.get(TableProperties.DEFAULT_FILE_FORMAT); + + public static FileFormat getFileFormat(Table icebergTable) { + Map<String, String> properties = icebergTable.properties(); + String fileFormatName = properties.getOrDefault(TableProperties.DEFAULT_FILE_FORMAT, "parquet"); Review Comment: Why should we delete `WRITE_FORMAT` and `DEFAULT_FILE_FORMAT` here? -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org