confluentinc / confluentinc/ksql

Type float does not work with schema inference by id

Open
#9,740 1 comment 0 reactions 0 assignees View on GitHub
avro bug P1 pluggable-schemas schema-registry-integration streaming-engine
Dominant language
Java
Stars
315
Forks
1k
Avg merge
1d 7h
Merged PRs (30d)
36

Description

**Describe the bug**
If the avro schema contains a type float schema inference by id fails.

**To Reproduce**
Steps to reproduce the behavior, include:
1. Register the following schema
`{
"doc": "Sample schema to help you get started.",
"fields": [
{
"doc": "The int type is a 32-bit signed integer.",
"name": "my_field1",
"type": "int"
},
{
"doc": "The double type is a double precision (64-bit) IEEE 754 floating-point number.",
"name": "my_field2",
"type": "float"
},
{
"doc": "The string is a unicode character sequence.",
"name": "my_field3",
"type": "string"
}
],
"name": "sampleRecord",
"namespace": "com.mycorp.mynamespace",
"type": "record"
}`
2. create stream using schema inference with id
`create stream Test3str with(kafka_topic='Test3',partitions=1, value_format='avro',value_schema_id=40);
Value format does not support schema.
format: AVRO
schema: Persistence{columns=[`my_field1` INTEGER, `my_field2` DOUBLE, `my_field3` STRING], features=[]}
reason: Unexpected schema type: Schema{FLOAT32}
`

**Expected behavior**
Stream should be created.

**Actual behaviour**
Error with Type
`Value format does not support schema.
format: AVRO
schema: Persistence{columns=[`my_field1` INTEGER, `my_field2` DOUBLE, `my_field3` STRING], features=[]}
reason: Unexpected schema type: Schema{FLOAT32}`

**Additional context**

Contributor guide

Open the contributing guide

Research direction

Start by reproducing schema inference by id with the provided Avro schema containing a float field, then trace the create stream path that reports the unexpected FLOAT32 schema type. Done means the stream is created successfully with the float field inferred as DOUBLE, with coverage for this reproduction if the relevant test area is found.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kafka
Domain
stream-processing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.