[Pulsar SQL] Query data with empty schema version for no-bytes schema type
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
**Describe the bug**
If we query data on Pulsar SQL, if the data has an empty schema version, the query will encounter `java.nio.BufferUnderflowException` exception.
Normally, if we use the producer to publish messages with bytes schema, the message will maintain an empty schema version, it's an empty array bytes.
We could handle this case in Pulsar SQL.
But if the topic has a no-bytes schema, such as `String, JSON, Avro`, and users publish messages with the bytes schema, then the messages couldn't be queried in Pulsar SQL.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a producer with a no-bytes schema, such as String.
2. Use a bytes schema producer to publish messages to the topic.
3. Query the topic on Pulsar SQL.
4. See the `java.nio.BufferUnderflowException` exception.
**Expected behavior**
We need to handle this case to avoid `java.nio.BufferUnderflowException` exception. But it's strange to publish a bytes message to no-bytes schema topic.
Contributor guide
Research direction
Start in Pulsar SQL by following the reproduction steps: create a no-bytes-schema producer, publish with a bytes-schema producer, and query the topic. Trace handling of the empty schema version that leads to java.nio.BufferUnderflowException; done means the query handles this case without that exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100