go-graphite / graphite-clickhouse

Graphite cluster backend with ClickHouse support
MIT License
213 stars 52 forks source link

Cannot disable index table #177

Open ivan-tkatchev opened 2 years ago

ivan-tkatchev commented 2 years ago

This config

[common]
listen = ":9090"
max-cpu = 8

[clickhouse]
url = "http://192.168.1.1:8123/?readonly=2&database=data"
index-table = ""
data-timeout = "1m0s"
index-timeout = "1m0s"
tagged-table = ""

[[data-table]]
table = "metrics"
reverse = false
rollup-conf = "none"
rollup-default-precision = 60
rollup-default-function = "avg"

[logging]
file = "stdout"
level = "info"

gives an error when graphite-clickhouse tries to select from an empty string:

[2021-12-13T15:30:20.609Z] INFO [http] access {"request_id": "9978c7e58ff3bf4b3a85666200edb1f7", "time": 0.001986003, "method": "GET", "url": "/metrics/find/?local=1&format=pickle&query=scripts.dsp_scripts.rate_updater.%2A&from=1639409120&until=1639409420", "peer": "192.168.1.1:20498", "client": "", "status": 500}
[2021-12-13T15:30:20.616Z] ERROR [metrics-find] query {"request_id": "457e96cd203c42eb27f3e38b8821f864", "query": "SELECT Path FROM  WHERE (Level=4) AND (Path LIKE 'scripts.dsp\\\\_scripts.reporter.%') GROUP BY Path FORMAT TabSeparatedRaw", "read_rows": "0", "read_bytes": "0", "written_rows": "0", "written_bytes": "0", "total_rows_to_read": "0", "error": "clickhouse response status 400: Code: 62. DB::Exception: Syntax error: failed at position 39 ('('): (Path LIKE 'scripts.dsp\\\\_scripts.reporter.%') GROUP BY Path FORMAT TabSeparatedRaw. Expected one of: UNION, LIMIT, SAMPLE, WHERE, WINDOW, INNER, end of query, HAVING, GROUP BY, INTO OUTFILE, EXCEPT, OFFSET, LEFT ARRAY JOIN, PREWHERE, JOIN, ORDER BY, array join, SETTINGS, ARRAY JOIN, INTERSECT, FORMAT, WITH, table, table function, subquery or list of joined tables, FINAL. (SYNTAX_ERROR) (version 21.11.4.14 (official build))\n", "time": 0.00144845}

What is the proper way to disable the index table?

deniszh commented 2 years ago

Hi @ivan-tkatchev

Maybe there's some misunderstanding here, but index table is a must for proper functioning of this tool and you can't just disable it. Maybe you can describe your usecase and explain why do you want to remove it?