fix: ClickHouse compatibility and database scoping bugs#85
Open
steffen-roemer wants to merge 1 commit intoPostHog:mainfrom
Open
fix: ClickHouse compatibility and database scoping bugs#85steffen-roemer wants to merge 1 commit intoPostHog:mainfrom
steffen-roemer wants to merge 1 commit intoPostHog:mainfrom
Conversation
- Fix TEXT_LOG_SYSTEM_TABLE fallback using non-existent "system.text" instead of "system.text_log" (fixes PostHog#53) - Scope TABLES_SQL, SCHEMA_SQL, and PARTS_SQL to CLICKHOUSE_DATABASE to avoid returning results from all databases - Use TABLES_SQL in the tables endpoint so the schema page gets the fields it expects (name, total_bytes, etc.) - Fix disk usage query filtering on type = 'local' which is now 'Local' in newer ClickHouse versions (case-sensitive mismatch)
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
Fixes several bugs that break HouseWatch on single-node setups and newer ClickHouse versions:
TEXT_LOG_SYSTEM_TABLEfallback used"system.text"instead of"system.text_log"— the table doesn't exist, causing 500 on/api/analyze/logsand/api/analyze/logs_frequencytablesendpoint usedAVAILABLE_TABLES_SQL(returns{database, table}) but the schema page frontend expects{name, total_bytes, ...}fromTABLES_SQL. Switched the endpoint to useTABLES_SQLTABLES_SQL,SCHEMA_SQL, andPARTS_SQLhad noWHERE database = ...filter, returning results from all databases. Now scoped toCLICKHOUSE_DATABASENODE_STORAGE_SQLfiltered ontype = 'local'but newer ClickHouse versions (tested on 26.1.2) use'Local'(capitalized). Changed tolower(type) = 'local'Test plan
/api/analyze/logsreturns log entries instead of 500/api/analyze/logs_frequencyreturns frequency data instead of 500/schemapage loads table list with sizes and row counts/schema/{table}shows column details scoped to configured database