Skip to content

Commit

Permalink
xx
Browse files Browse the repository at this point in the history
Signed-off-by: Seaven <[email protected]>
  • Loading branch information
Seaven committed Nov 29, 2024
1 parent 538caef commit 124d98e
Showing 1 changed file with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,17 @@
import com.starrocks.analysis.TableName;
import com.starrocks.catalog.Database;
import com.starrocks.catalog.Table;
import com.starrocks.connector.statistics.ConnectorTableColumnStats;
import com.starrocks.journal.JournalEntity;
import com.starrocks.persist.OperationType;
import com.starrocks.qe.ConnectContext;
import com.starrocks.server.GlobalStateMgr;
import com.starrocks.sql.common.MetaUtils;
import com.starrocks.sql.optimizer.statistics.CachedStatisticStorage;
import com.starrocks.sql.optimizer.statistics.ColumnStatistic;
import com.starrocks.sql.plan.ConnectorPlanTestBase;
import com.starrocks.thrift.TUniqueId;
import com.starrocks.transaction.InsertTxnCommitAttachment;
import com.starrocks.transaction.TransactionState;
import com.starrocks.utframe.UtFrameUtils;
import mockit.Expectations;
import mockit.Mock;
import mockit.MockUp;
import mockit.Mocked;
Expand Down Expand Up @@ -68,31 +65,10 @@ public static void teardown() throws Exception {
@Test
public void testRefreshConnectorTableBasicStatisticsCache(@Mocked CachedStatisticStorage cachedStatisticStorage) {
Table table = connectContext.getGlobalStateMgr().getMetadataMgr().getTable("hive0", "partitioned_db", "t1");
new Expectations() {
{
cachedStatisticStorage.getConnectorTableStatistics(table, ImmutableList.of("c1", "c2"));
result = ImmutableList.of(
new ConnectorTableColumnStats(new ColumnStatistic(0, 10, 0, 20, 5), 5, ""),
new ConnectorTableColumnStats(new ColumnStatistic(0, 100, 0, 200, 50), 50, "")
);
minTimes = 1;
}
};

AnalyzeMgr analyzeMgr = new AnalyzeMgr();
analyzeMgr.refreshConnectorTableBasicStatisticsCache("hive0", "partitioned_db", "t1",
ImmutableList.of("c1", "c2"), true);

new Expectations() {
{
cachedStatisticStorage.getConnectorTableStatisticsSync(table, ImmutableList.of("c1", "c2"));
result = ImmutableList.of(
new ConnectorTableColumnStats(new ColumnStatistic(0, 10, 0, 20, 5), 5, ""),
new ConnectorTableColumnStats(new ColumnStatistic(0, 100, 0, 200, 50), 50, "")
);
minTimes = 1;
}
};
analyzeMgr.refreshConnectorTableBasicStatisticsCache("hive0", "partitioned_db", "t1",
ImmutableList.of("c1", "c2"), false);

Expand Down

0 comments on commit 124d98e

Please sign in to comment.