Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql_insert decimal type with clickhouse #3009

Open
artemklevtsov opened this issue Nov 15, 2024 · 0 comments
Open

sql_insert decimal type with clickhouse #3009

artemklevtsov opened this issue Nov 15, 2024 · 0 comments

Comments

@artemklevtsov
Copy link

Hi,

Is there a way to insert decimal type to clickhouse?

My test config:

input:
  generate:
    count: 1
    mapping: |
      root.id = 1
      root.x = 3.14

output:
  sql_insert:
    driver: clickhouse
    dsn: clickhouse://127.0.0.1:9000/test
    table: test
    columns:
      - id
      - x
    args_mapping: |
      root = [
        this.id,
        this.x,
      ]
    init_statement: |
      create table if not exists test.test(id UInt64, x Decimal64(2)) order by id;

Log output:

INFO Running main config from specified file       @service=redpanda-connect benthos_version=4.39.0 path=tmp/config.yaml
INFO Listening for HTTP requests at: http://0.0.0.0:4195  @service=redpanda-connect
INFO Input type generate is now active             @service=redpanda-connect label="" path=root.input
INFO Launching a Redpanda Connect instance, use CTRL+C to close  @service=redpanda-connect
INFO Output type sql_insert is now active          @service=redpanda-connect label="" path=root.output
ERRO Failed to send message to sql_insert: clickhouse [AppendRow]: x clickhouse [AppendRow]: converting float64 to Decimal(18, 2) is unsupported  @service=redpanda-connect label="" path=root.output
ERRO Failed to send message to sql_insert: clickhouse [AppendRow]: x clickhouse [AppendRow]: converting float64 to Decimal(18, 2) is unsupported  @service=redpanda-connect label="" path=root.output
ERRO Failed to send message to sql_insert: clickhouse [AppendRow]: x clickhouse [AppendRow]: converting float64 to Decimal(18, 2) is unsupported  @service=redpanda-connect label="" path=root.output

I tried x.string() without success.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant