Skip to content

Examples of how to convert yaml complex types to CLI equivalent #2791

@nullhack

Description

@nullhack

Hi, thank you for the awesome tool, I'm really impressed by how much power I have in such small amount of config. But one particular thing that I am struggling is the command line version of the config file.

I tried some combinations, but I could not get it to work. I have a config.yaml (that works) similar to this:

input:
  kafka:
    addresses: ["ADDRESS"]
    topics: ["TOPIC"]
    consumer_group: "CG"
output:
  aws_s3:
    bucket: BUCKET
    path: OUT_PATH
    force_path_style_urls: true
    region: us-east-1
    endpoint: S3_ENDPOINT
    credentials:
      id: CREDENTIAL_ID
      secret: CREDENTIAL_SECRET
    batching:
      count: 1000
      processors:
        - parquet_encode:
            schema:
              - name: NAME
                type: UTF8
              - name: ADDRESS
                type: UTF8

Due to not being able to perform writes in this particular server, I am trying to run the CLI equivalent of the config.

Something like:

connect run \
  -s "input.type=http_server" \
  -s "input.type=kafka" \
  -s "input.kafka.addresses=ADDRESS" \
  -s "input.kafka.topics=TOPIC" \
  -s "input.kafka.consumer_group=CG" \
  -s "output.aws_s3.bucket=BUCKET" \
  -s 'output.aws_s3.path=OUT_PATH' \
  -s "output.aws_s3.force_path_style_urls=true" \
  -s "output.aws_s3.region=us-east-1" \
  -s "output.aws_s3.endpoint=S3_ENDPOINT" \
  -s "output.aws_s3.credentials.id=CREDENTIAL_ID" \
  -s "output.aws_s3.credentials.secret=CREDENTIAL_SECRET" \
  -s "output.aws_s3.batching.count=1000" \
  -s "output.aws_s3.batching.processors ...

My question is: How to set up the processors properly to get the parquet encode to work (or any other complex mapping involving yaml lists and dictionaries) ?

Is it possible to add examples somewhere in the documentation as well?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions