diff --git a/packages/context/src/ingest/adapters/historic-sql/bigquery-query-history-reader.test.ts b/packages/context/src/ingest/adapters/historic-sql/bigquery-query-history-reader.test.ts index cac20cd5..25b11ecd 100644 --- a/packages/context/src/ingest/adapters/historic-sql/bigquery-query-history-reader.test.ts +++ b/packages/context/src/ingest/adapters/historic-sql/bigquery-query-history-reader.test.ts @@ -219,7 +219,7 @@ describe('BigQueryHistoricSqlQueryHistoryReader', () => { for await (const row of reader.fetchAggregated( client, { start: new Date('2026-02-10T00:00:00.000Z'), end: new Date('2026-05-11T00:00:00.000Z') }, - { dialect: 'bigquery', minExecutions: 5, windowDays: 90, concurrency: 12, filters: {}, redactionPatterns: [], staleArchiveAfterDays: 90 }, + { dialect: 'bigquery', minExecutions: 5, windowDays: 90, concurrency: 12, filters: { dropTrivialProbes: true }, redactionPatterns: [], staleArchiveAfterDays: 90 }, )) { rows.push(row); } diff --git a/packages/context/src/ingest/adapters/historic-sql/postgres-pgss-reader.test.ts b/packages/context/src/ingest/adapters/historic-sql/postgres-pgss-reader.test.ts index a1b710b6..95bade90 100644 --- a/packages/context/src/ingest/adapters/historic-sql/postgres-pgss-reader.test.ts +++ b/packages/context/src/ingest/adapters/historic-sql/postgres-pgss-reader.test.ts @@ -31,7 +31,7 @@ describe('PostgresPgssReader aggregate path', () => { for await (const row of reader.fetchAggregated( { executeQuery }, { start: new Date('2026-02-10T00:00:00.000Z'), end: new Date('2026-05-11T00:00:00.000Z') }, - { dialect: 'postgres', minExecutions: 5, windowDays: 90, concurrency: 12, filters: {}, redactionPatterns: [], staleArchiveAfterDays: 90 }, + { dialect: 'postgres', minExecutions: 5, windowDays: 90, concurrency: 12, filters: { dropTrivialProbes: true }, redactionPatterns: [], staleArchiveAfterDays: 90 }, )) { rows.push(row); } diff --git a/packages/context/src/ingest/adapters/historic-sql/snowflake-query-history-reader.test.ts b/packages/context/src/ingest/adapters/historic-sql/snowflake-query-history-reader.test.ts index 416a6ae4..e68e4b49 100644 --- a/packages/context/src/ingest/adapters/historic-sql/snowflake-query-history-reader.test.ts +++ b/packages/context/src/ingest/adapters/historic-sql/snowflake-query-history-reader.test.ts @@ -221,7 +221,7 @@ describe('SnowflakeHistoricSqlQueryHistoryReader', () => { for await (const row of reader.fetchAggregated( client, { start: new Date('2026-02-10T00:00:00.000Z'), end: new Date('2026-05-11T00:00:00.000Z') }, - { dialect: 'snowflake', minExecutions: 5, windowDays: 90, concurrency: 12, filters: {}, redactionPatterns: [], staleArchiveAfterDays: 90 }, + { dialect: 'snowflake', minExecutions: 5, windowDays: 90, concurrency: 12, filters: { dropTrivialProbes: true }, redactionPatterns: [], staleArchiveAfterDays: 90 }, )) { rows.push(row); } diff --git a/packages/context/src/ingest/adapters/historic-sql/stage-unified.ts b/packages/context/src/ingest/adapters/historic-sql/stage-unified.ts index ee9f04f6..c07fb10d 100644 --- a/packages/context/src/ingest/adapters/historic-sql/stage-unified.ts +++ b/packages/context/src/ingest/adapters/historic-sql/stage-unified.ts @@ -152,14 +152,14 @@ function addTemplate(acc: TableAccumulator, parsed: ParsedTemplate): void { function toStagedTable(acc: TableAccumulator, now: Date): StagedTableInput { const errorRate = acc.executions > 0 ? acc.errorRateNumerator / acc.executions : 0; - const columnsByClause = Object.fromEntries( + const columnsByClause: Record> = Object.fromEntries( [...acc.columnsByClause.entries()] .sort(([left], [right]) => left.localeCompare(right)) .map(([clause, counts]) => [ clause, [...counts.entries()] .sort((left, right) => right[1] - left[1] || left[0].localeCompare(right[0])) - .map(([column, count]) => [column, bucketFrequency(count, acc.executions)]), + .map(([column, count]) => [column, bucketFrequency(count, acc.executions)] as [string, string]), ]), ); const observedJoins = [...acc.observedJoins.entries()] diff --git a/packages/context/src/ingest/adapters/historic-sql/types.ts b/packages/context/src/ingest/adapters/historic-sql/types.ts index 2d83e15b..8dec732a 100644 --- a/packages/context/src/ingest/adapters/historic-sql/types.ts +++ b/packages/context/src/ingest/adapters/historic-sql/types.ts @@ -50,7 +50,7 @@ export const historicSqlUnifiedPullConfigSchema = z.preprocess((value) => { errorRate: z.number().min(0).max(1), executions: z.number().int().nonnegative(), }).optional(), - }).default({}), + }).default({ dropTrivialProbes: true }), redactionPatterns: z.array(z.string()).default([]), staleArchiveAfterDays: z.number().int().positive().default(90), })); diff --git a/packages/context/src/ingest/index.ts b/packages/context/src/ingest/index.ts index 556ba485..352281d3 100644 --- a/packages/context/src/ingest/index.ts +++ b/packages/context/src/ingest/index.ts @@ -367,7 +367,6 @@ export type { KtxPostgresQueryClient, PostgresPgssAggregateRow, PostgresPgssProbeResult, - PostgresPgssReader, PostgresPgssRow, PostgresPgssSnapshot, StagedManifest,