You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configure the SQL output plugin for a ClickHouse database server
Configure an input plugin that has a variable number of fields. In my example the ping plugin will include columns like minimum_response_ms when it received a reply but omit those columns if it didn't receive a reply.
Ensure that the input plugin tries to send fewer columns than it could. In the case of the ping plugin make sure it doesn't get a ping back.
Expected behavior
The columns that are missing from the input plugin are simply not be included in the INSERT, causing the database to use default values (like NULL or 0).
Together with the team of the clickhouse-go database driver I did some troubleshooting and we found out that the clickhouse-go database driver doesn't like the syntax INSERT INTO my_table(col_a, col_b) ..., it expects a space after the table name like this: INSERT INTO my_table (col_a, col_b) .... (ClickHouse/clickhouse-go#1485)
The bug is not entirely trivial to fix because there is some regex parsing involved, so as a quick fix/workaround I propose to add the "missing" space there. All other DBMSs can accept that syntax just as well.
The text was updated successfully, but these errors were encountered:
Relevant telegraf.conf
Logs from Telegraf
System info
Telegraf 1.31.2
Docker
No response
Steps to reproduce
ping
plugin will include columns likeminimum_response_ms
when it received a reply but omit those columns if it didn't receive a reply.ping
plugin make sure it doesn't get a ping back.Expected behavior
The columns that are missing from the input plugin are simply not be included in the INSERT, causing the database to use default values (like NULL or 0).
Actual behavior
You will see an error similar to this in the log:
Additional info
Together with the team of the
clickhouse-go
database driver I did some troubleshooting and we found out that theclickhouse-go
database driver doesn't like the syntaxINSERT INTO my_table(col_a, col_b) ...
, it expects a space after the table name like this:INSERT INTO my_table (col_a, col_b) ...
. (ClickHouse/clickhouse-go#1485)The bug is not entirely trivial to fix because there is some regex parsing involved, so as a quick fix/workaround I propose to add the "missing" space there. All other DBMSs can accept that syntax just as well.
The text was updated successfully, but these errors were encountered: