Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Youngwb committed Oct 14, 2024
1 parent 8897f0c commit fa8455b
Showing 1 changed file with 11 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ public Statistics getTableStatistics(OptimizerContext session, Table table, Map<
dbName, table, predicate);
}

if (session.getSessionVariable().enableDeltaLakeColumnStatistics()) {
try (Timer ignored = Tracers.watchScope(EXTERNAL, "DELTA_LAKE.getTableStatistics" + key)) {
String traceLabel = session.getSessionVariable().enableDeltaLakeColumnStatistics() ?
"DELTA_LAKE.getTableStatistics" + key : "DELTA_LAKE.getCardinalityStats" + key;

Check failure on line 177 in fe/fe-core/src/main/java/com/starrocks/connector/delta/DeltaLakeMetadata.java

View workflow job for this annotation

GitHub Actions / FE Code Style Check

[checkstyle] reported by reviewdog 🐶 '"DELTA_LAKE.getTableStatistics"' has incorrect indentation level 12, expected level should be 16. Raw Output: /github/workspace/./fe/fe-core/src/main/java/com/starrocks/connector/delta/DeltaLakeMetadata.java:177:13: error: '"DELTA_LAKE.getTableStatistics"' has incorrect indentation level 12, expected level should be 16. (com.puppycrawl.tools.checkstyle.checks.indentation.IndentationCheck)
try (Timer ignored = Tracers.watchScope(EXTERNAL, traceLabel)) {
if (session.getSessionVariable().enableDeltaLakeColumnStatistics()) {
return statisticProvider.getTableStatistics(schema, key, columns);
}
} else {
try (Timer ignored = Tracers.watchScope(EXTERNAL, "DELTA_LAKE.getCardinalityStats" + key)) {
} else {
return statisticProvider.getCardinalityStats(schema, key, columns);
}
}
Expand Down Expand Up @@ -315,22 +315,17 @@ private void collectDeltaLakePlanFiles(PredicateSearchKey key, Table table, Scal

List<FileScanTask> files = Lists.newArrayList();
boolean enableCollectColumnStats = enableCollectColumnStatistics(connectContext);
String traceLabel = enableCollectColumnStats ? "DELTA_LAKE.updateDeltaLakeFileStats" :
"DELTA_LAKE.updateDeltaLakeCardinality";

Iterator<Pair<FileScanTask, DeltaLakeAddFileStatsSerDe>> iterator =
buildFileScanTaskIterator(table, operator, enableCollectColumnStats);
while (iterator.hasNext()) {
Pair<FileScanTask, DeltaLakeAddFileStatsSerDe> pair = iterator.next();
files.add(pair.first);

if (enableCollectColumnStats) {
try (Timer ignored = Tracers.watchScope(EXTERNAL, "DELTA_LAKE.updateDeltaLakeFileStats")) {
statisticProvider.updateFileStats(deltaLakeTable, key, pair.first, pair.second,
nonPartitionPrimitiveColumns, partitionPrimitiveColumns);
}
} else {
try (Timer ignored = Tracers.watchScope(EXTERNAL, "DELTA_LAKE.updateDeltaLakeCardinality")) {
statisticProvider.updateFileStats(deltaLakeTable, key, pair.first, pair.second,
nonPartitionPrimitiveColumns, partitionPrimitiveColumns);
}
try (Timer ignored = Tracers.watchScope(EXTERNAL, traceLabel)) {
statisticProvider.updateFileStats(deltaLakeTable, key, pair.first, pair.second,
nonPartitionPrimitiveColumns, partitionPrimitiveColumns);
}
}
splitTasks.put(key, files);
Expand Down

0 comments on commit fa8455b

Please sign in to comment.