StarRocks / starrocks

The world's fastest open query engine for sub-second analytics both on and off the data lakehouse. With the flexibility to support nearly any scenario, StarRocks provides best-in-class performance for multi-dimensional analytics, real-time analytics, and ad-hoc queries. A Linux Foundation project.
https://starrocks.io
Apache License 2.0
9.06k stars 1.82k forks source link

[Refactor] remove HiveMetaStoreTable concept and add `getDbName` in `Table` #53020

Closed dirtysalt closed 1 day ago

dirtysalt commented 2 days ago

Why I'm doing:

There are so many overlapped concepts and interfaces on tables

What I'm doing:

This PR is to:


And in the future, we can keep simplifying code like following code

  GlobalStateMgr.getCurrentState().getAnalyzeMgr().removeExternalBasicStatsMeta(table.getCatalogName(),
          table.getDbName(), table.getName());
  GlobalStateMgr.getCurrentState().getAnalyzeMgr().dropAnalyzeJob(table.getCatalogName(),
          table.getDbName(), table.getName());

Can be rewritten as table as parameters which is more elegant and clear

  GlobalStateMgr.getCurrentState().getAnalyzeMgr().removeExternalBasicStatsMeta(table);
  GlobalStateMgr.getCurrentState().getAnalyzeMgr().dropAnalyzeJob(table);

Fixes #issue

What type of PR is this:

Does this PR entail a change in behavior?

If yes, please specify the type of change:

Checklist:

Bugfix cherry-pick branch check:

sonarcloud[bot] commented 2 days ago

Quality Gate Failed Quality Gate failed

Failed conditions
4.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

github-actions[bot] commented 2 days ago

[Java-Extensions Incremental Coverage Report]

:white_check_mark: pass : 0 / 0 (0%)

github-actions[bot] commented 2 days ago

[FE Incremental Coverage Report]

:x: fail : 130 / 191 (68.06%)

file detail

path covered_line new_line coverage not_covered_line_detail
:large_blue_circle: com/starrocks/common/proc/HMSTablePartitionsProcDir.java 0 3 00.00% [42, 54, 58]
:large_blue_circle: com/starrocks/sql/optimizer/rule/transformation/materialization/compensation/OptCompensator.java 0 1 00.00% [138]
:large_blue_circle: com/starrocks/server/GlobalStateMgr.java 0 2 00.00% [2458, 2459]
:large_blue_circle: com/starrocks/planner/OdpsScanNode.java 0 3 00.00% [98, 158, 180]
:large_blue_circle: com/starrocks/connector/hive/ConnectorTableMetadataProcessor.java 0 1 00.00% [199]
:large_blue_circle: com/starrocks/common/proc/TableProcDir.java 0 2 00.00% [105, 106]
:large_blue_circle: com/starrocks/connector/hudi/HudiMetadata.java 0 5 00.00% [145, 146, 155, 243, 245]
:large_blue_circle: com/starrocks/connector/delta/DeltaLakeMetadata.java 0 2 00.00% [126, 157]
:large_blue_circle: com/starrocks/sql/common/DebugOperatorTracer.java 0 6 00.00% [127, 137, 146, 347, 357, 366]
:large_blue_circle: com/starrocks/sql/Explain.java 0 3 00.00% [230, 247, 262]
:large_blue_circle: com/starrocks/sql/optimizer/rule/transformation/materialization/OptExpressionDuplicator.java 0 1 00.00% [238]
:large_blue_circle: com/starrocks/catalog/Table.java 1 5 20.00% [264, 280, 482, 755]
:large_blue_circle: com/starrocks/connector/hive/HiveMetadata.java 3 10 30.00% [175, 177, 236, 295, 296, 460, 474]
:large_blue_circle: com/starrocks/connector/iceberg/IcebergPartitionUtils.java 1 3 33.33% [121, 224]
:large_blue_circle: com/starrocks/connector/hive/HiveCacheUpdateProcessor.java 5 13 38.46% [109, 112, 121, 122, 146, 199, 200, 222]
:large_blue_circle: com/starrocks/sql/analyzer/AstToStringBuilder.java 3 6 50.00% [1799, 1808, 1809]
:large_blue_circle: com/starrocks/connector/hive/HiveStatisticsProvider.java 4 6 66.67% [74, 140]
:large_blue_circle: com/starrocks/connector/iceberg/IcebergMetadata.java 16 20 80.00% [551, 612, 613, 1096]
:large_blue_circle: com/starrocks/planner/IcebergScanNode.java 6 7 85.71% [122]
:large_blue_circle: com/starrocks/connector/hive/HiveCommitter.java 6 7 85.71% [448]
:large_blue_circle: com/starrocks/sql/optimizer/transformer/RelationTransformer.java 1 1 100.00% []
:large_blue_circle: com/starrocks/connector/hive/HiveMetastore.java 5 5 100.00% []
:large_blue_circle: com/starrocks/catalog/IcebergTable.java 5 5 100.00% []
:large_blue_circle: com/starrocks/server/IcebergTableFactory.java 2 2 100.00% []
:large_blue_circle: com/starrocks/sql/analyzer/QueryAnalyzer.java 2 2 100.00% []
:large_blue_circle: com/starrocks/connector/iceberg/cost/IcebergStatisticProvider.java 1 1 100.00% []
:large_blue_circle: com/starrocks/connector/hive/HiveMetastoreOperations.java 8 8 100.00% []
:large_blue_circle: com/starrocks/connector/delta/DeltaLakeCacheUpdateProcessor.java 1 1 100.00% []
:large_blue_circle: com/starrocks/connector/hive/HiveConnectorScanRangeSource.java 3 3 100.00% []
:large_blue_circle: com/starrocks/server/HiveTableFactory.java 1 1 100.00% []
:large_blue_circle: com/starrocks/sql/analyzer/MaterializedViewAnalyzer.java 8 8 100.00% []
:large_blue_circle: com/starrocks/sql/optimizer/rule/transformation/IcebergEqualityDeleteRewriteRule.java 12 12 100.00% []
:large_blue_circle: com/starrocks/connector/hive/HiveMetastoreApiConverter.java 2 2 100.00% []
:large_blue_circle: com/starrocks/sql/optimizer/rewrite/OptExternalPartitionPruner.java 10 10 100.00% []
:large_blue_circle: com/starrocks/sql/optimizer/statistics/StatisticsCalculator.java 1 1 100.00% []
:large_blue_circle: com/starrocks/statistic/StatisticUtils.java 7 7 100.00% []
:large_blue_circle: com/starrocks/sql/analyzer/AnalyzerUtils.java 5 5 100.00% []
:large_blue_circle: com/starrocks/scheduler/mv/MVTraceUtils.java 1 1 100.00% []
:large_blue_circle: com/starrocks/connector/odps/OdpsMetadata.java 3 3 100.00% []
:large_blue_circle: com/starrocks/server/HudiTableFactory.java 1 1 100.00% []
:large_blue_circle: com/starrocks/planner/DeltaLakeScanNode.java 1 1 100.00% []
:large_blue_circle: com/starrocks/connector/hive/CachingHiveMetastore.java 4 4 100.00% []
:large_blue_circle: com/starrocks/connector/ConnectorPartitionTraits.java 1 1 100.00% []
github-actions[bot] commented 2 days ago

[BE Incremental Coverage Report]

:white_check_mark: pass : 0 / 0 (0%)