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

Null values on streaming ingestion of proto2 messages #16207

Open
layoaster opened this issue Mar 26, 2024 · 0 comments
Open

Null values on streaming ingestion of proto2 messages #16207

layoaster opened this issue Mar 26, 2024 · 0 comments

Comments

@layoaster
Copy link

Affected Version

28.0.1

Description

After upgrading from Druid 27 and keeping the SQl compatible mode on Druid 28 we've noticed that fields with Null values started popping up on our datasources filled with our streaming ingestion tasks (Kafka Supervisor) reading protobuff (proto2) messages.

Sample:
image

As you can see the field RecivedFromNodeId (string) has a Null value.

This field is defined at proto schema like an optional string:

  optional string receive_from_node_id = 7;

According to proto2 documentation, an optional string field will have a default value or, in its absence, a type-default value (empty string for Strings).

When a message is parsed, if the encoded message does not contain an optional element, accessing the corresponding field in the parsed object returns the default value for that field.

Regardless of the proto version, Null values are not allowed/supported in the Protobuff spec. Not set fields should always return the default value (proto2 only) or the type-specific default (proto2 and proto3).

So my question/issue is why is the protobuf-extension not honoring this behavior?

For more context, the proto messages are created/sent from a Golang backend.

@layoaster layoaster changed the title Null Values handling for Kafka ingestion of proto2 messages Null values on streaming ingestion of proto2 messages Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant