chore: bump clickhouse-sql-parser to v1.1.1, Go 1.27, ClickHouse 26.8 - #251
Merged
Merged
Conversation
Parser v1.1.x fixes the two upstream bugs that blocked the 26.8 move: a repeated SETTINGS clause no longer overwrites the engine's (orian/clickhouse-sql-parser#35), and TimeSeries RECENT SAMPLES targets parse (#36). The parser requires Go 1.27, so go.mod and the Dockerfile builder move to 1.27. Kafka with a trailing query-level SETTINGS clause (#250) now round-trips all kafka_* settings; the interim fail-loudly guard is removed, the resolver still rejects a Kafka engine with no configuration. ClickHouse 26.8 (docker-compose server and keeper): - single-column ORDER BY / PRIMARY KEY are emitted bare, since 26.8 stores the parenthesised form verbatim; - TimeSeries gains a recent_samples target; inner target tables now keep ttl, settings and full column definitions (introspection used to drop the settings and keep only column name/type), and inner ttl is canonicalized like a table TTL; - a TimeSeries table's SETTINGS are emitted before its target clauses; after them they are query-level and ClickHouse rejects engine settings such as recent_samples_ttl_seconds; - TimeSeries target comparison ignores the inner engine's HCL body, which made every loaded inner target differ from its introspected twin. Closes #250.
The v2.12.2 prebuilt binary is built with go1.26 and refuses to lint a go 1.27 module. v2.14.0 is built with go1.27.0 and reports no issues.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github.com/orian/clickhouse-sql-parserv1.0.2 → v1.1.1 (major breaking release); it requires Go 1.27, sogo.modisgo 1.27and the Dockerfile builder isgolang:1.27-alpineSETTINGSclause now keeps allkafka_*settings (parser#35 fixed); the interim fail-loudly guard is removedRECENT SAMPLEStarget (new in 26.8, on by default) asrecent_samples {}; every TimeSeries table failed to introspect on 26.8 without itttl,settingsand full column definitions (codec/default); innerttlis canonicalized like a table TTL. Without the TTL, a recreated recent-samples table never expires its dataSETTINGSbefore its target clauses (after them they are query-level, and ClickHouse rejectsrecent_samples_ttl_seconds)inner {}target always differed from its introspected twinORDER BY/PRIMARY KEYemitted bare (26.8 stores(id)verbatim)The parser's other breaking changes (new
ASTVisitormethods, nilTableIndex.Granularity, position changes) needed no code changes here.Follow-ups (not in this PR, recorded in the plan doc)
engine "time_series" {}never compares clean against the live table (synthesized columns,.inner_id.*tables, and on 26.8 the fully spelled-out default targets)sql2hcldrops a query-levelSETTINGS flatten_nested = 0Tests
timeseries_recent_samples_test.go: 26.8 default DDL introspect → sqlgen → re-introspect round trip, dump → load with no drift, inner TTL canonicalizationSETTINGSround-trip test replaces the fail-loudly testgo test ./...go test -race ./internal/... ./cmd/...go test ./test ./internal/loader/hcl -clickhouseagainst ClickHouse 26.8.11.7go vet ./...Closes #250.