Skip to content

Avro Schema Error for Views with Index #6629

Description

@anandbraman

If a view is defined with an index and the avro output format, initialization fails because the Avro schema is generated with an invalid Avro identifier. The index name has a . in it and this is not valid. The pipeline fails on initialization with error:

Operation failed because the pipeline failed to initialize. Error details: invalid controller configuration: invalid format configuration for output endpoint 'test_avro_out.unnamed-0': error generating Avro schema for the SQL index test_avro_out.key: 'test_avro_out.key' is not a valid Avro identifier.

Minimal code to repro below.

create table test_in (
    col1 bigint
);

create materialized view test_avro_out
with(
    'connectors' = '[{
    "index": "col1_index",
    "transport": {
      "name": "kafka_output",
      "config": {
        "bootstrap.servers": "redpanda.kafka-demo.svc.cluster.local:9093",
        "topic": "avro_test",
        "auto.offset.reset": "earliest"
      }
    },
    "format": {
      "name": "avro",
      "config": {
        "update_format": "raw",
        "key_mode": "key_fields"
      }
    }
  }]'
)
 as (
    select distinct col1 from test_in
);
create index col1_index on test_avro_out(col1);

Metadata

Metadata

Assignees

Labels

connectorsIssues related to the adapters/connectors crate

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions