Skip to content

Commit 3d26aa5

Browse files
authored
Merge pull request #407 from duyet/feat/table-not-found-message
feat: add helpful notes when tables are missing due to clickhouse misconfiguration
2 parents fe41af6 + f427220 commit 3d26aa5

20 files changed

+131
-29
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
branches:
66
- main
77
pull_request:
8+
branches:
9+
- main
10+
- 'docs/**'
811
workflow_dispatch:
912

1013
permissions:

app/[host]/[query]/merges/merge-performance.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { PART_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const mergePerformanceConfig: QueryConfig = {
56
name: 'merge-performance',
67
description: 'Merge performance over day, avg duration, avg rows read',
8+
docs: PART_LOG,
79
sql: `
810
SELECT
911
event_date,

app/[host]/[query]/more/backups.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { BACKUP_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const backupsConfig: QueryConfig = {
56
name: 'backups',
67
description: `To restore a backup:
78
RESTORE TABLE data_lake.events AS data_lake.events_restore FROM Disk('s3_backup', 'data_lake.events_20231212')`,
9+
docs: BACKUP_LOG,
810
sql: `
911
SELECT *,
1012
formatReadableSize(total_size) as readable_total_size,

app/[host]/[query]/more/count-across-replicas.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { QUERY_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const countAcrossReplicasConfig: QueryConfig = {
56
name: 'count-across-replicas',
67
description: 'All table count across replicas',
8+
docs: QUERY_LOG,
79
sql: `
810
SELECT
911
hostName(),

app/[host]/[query]/more/top-usage-columns.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { QUERY_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const topUsageColumnsConfig: QueryConfig = {
56
name: 'top-usage-columns',
67
description: 'Most usage columns of table based on system.query_log',
8+
docs: QUERY_LOG,
79
sql: `
810
SELECT
911
columns as column,

app/[host]/[query]/more/top-usage-tables.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { QUERY_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const topUsageTablesConfig: QueryConfig = {
56
name: 'top-usage-tables',
67
description:
78
'Most usage tables, ignore system tables, based on system.query_log (top 50). Click on table name to see top usage columns.',
9+
docs: QUERY_LOG,
810
sql: `
911
SELECT
1012
tables as table,

app/[host]/[query]/more/zookeeper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
import { ZOOKEEPER } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const zookeeperConfig: QueryConfig = {
56
name: 'zookeeper',
67
description:
78
'Exposes data from the Keeper cluster defined in the config. https://clickhouse.com/docs/en/operations/system-tables/zookeeper',
9+
docs: ZOOKEEPER,
810
sql: `
911
SELECT
1012
replaceOne(format('{}/{}', path, name), '//', '/') AS _path,

app/[host]/[query]/queries/expensive-queries-by-memory.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { QUERY_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const expensiveQueriesByMemoryConfig: QueryConfig = {
56
name: 'expensive-queries-by-memory',
67
description: 'Most expensive queries by memory finished over last 24 hours',
8+
docs: QUERY_LOG,
79
sql: `
810
SELECT
911
query,

app/[host]/[query]/queries/expensive-queries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { QUERY_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const expensiveQueriesConfig: QueryConfig = {
56
name: 'expensive-queries',
67
description: 'Most expensive queries finished over last 24 hours',
8+
docs: QUERY_LOG,
79
sql: `
810
WITH base_metrics AS (
911
SELECT

app/[host]/[query]/queries/failed-queries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import { QUERY_LOG } from '@/lib/table-notes'
12
import { ColumnFormat } from '@/types/column-format'
23
import { type QueryConfig } from '@/types/query-config'
34

45
export const failedQueriesConfig: QueryConfig = {
56
name: 'failed-queries',
67
description: "type IN ['ExceptionBeforeStart', 'ExceptionWhileProcessing']",
8+
docs: QUERY_LOG,
79
sql: `
810
SELECT
911
type,

0 commit comments

Comments
 (0)