Files
datastore/utils/auto-bisect/tests/test_262_table_fail.sh
Nikita Fomichev a78bcc708e utils: add auto-bisect script for ClickHouse regression bisection
Adds `utils/auto-bisect/` — a shell-based bisection framework that
downloads pre-built CI binaries and runs a user-supplied test script
to find the first bad commit.

Key features:
- Downloads public CI binaries from S3 by default; private CloudFront
  builds with `--private` (credentials via `CH_CI_BASIC_AUTH` env var,
  `CH_CI_USER`/`CH_CI_PASSWORD`, or `/etc/netrc`)
- Three environment modes: `single` (one server), `replicateddb` (two
  nodes + Keeper, Replicated database), `sharedcatalog` (two nodes +
  Keeper, SharedCatalog)
- Uses `git bisect --no-checkout` by default so the work tree is not
  modified during bisection
- Walker mode (`--walker`) for linear commit-by-commit testing
- Example test scripts in `tests/`

Tested locally: `--env nothing`, `--env single`, and `--env replicateddb`
all verified working.
2026-03-28 10:39:03 +01:00

48 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "$PWD"
CH_PATH=${CH_PATH:=clickhouse}
$CH_PATH client -mn -q "
SELECT version();
set enable_positional_arguments_for_projections=1;
drop table if exists experimentation_102; CREATE TABLE experimentation_102
(
logged_at DateTime COMMENT 'Time at which the event was logged.',
occurred_at DateTime COMMENT 'Time at which the event was occurred.',
user_id UInt64,
experiment String,
variant String,
recorded DateTime COMMENT 'Time at which the row was last recorded.',
PROJECTION prj_exp_health
(
SELECT max(occurred_at)
GROUP BY toYYYYMMDD(occurred_at)
),
PROJECTION prj_query_optimization
(
SELECT
CAST(user_id, 'String') AS user_id,
experiment,
variant,
1000 * toUnixTimestamp(min(occurred_at)) AS first_occurred_at,
1000 * toUnixTimestamp(max(occurred_at)) AS last_occurred_at
GROUP BY
user_id,
experiment,
variant
)
)
ENGINE = MergeTree
PARTITION BY toYYYYMMDD(occurred_at)
PRIMARY KEY (user_id, toYYYYMMDD(occurred_at))
ORDER BY (user_id, toYYYYMMDD(occurred_at))
TTL occurred_at + toIntervalDay(30)
SETTINGS index_granularity = 8192;
"