Closed haf closed 3 years ago
@haf I tried to reproduce this in the latest master branch, but I got the following error:
ksql> CREATE STREAM mystream with (kafka_topic = 'analytics_event2', value_format = 'json_sr');
>
>
Unable to verify if the value schema for topic analytics_event2 is compatible with ksqlDB.
Reason: Unsupported criterion allOf for {"title":"EventMessage","description":"A Logary event message","$id":"https://app.logary.tech/schemas/event-message.schema.json","$schema":"http://json-schema.org/draft-07/schema#","allOf":[{"$ref":"https://app.logary.tech/schemas/logary-message-base.schema.json"}],"type":"object","required":["type","event"],"properties":{"monetaryValue":{"$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/money","description":"How much was lost or gained as a result of this event happening?"},"type":{"description":"Discriminator","const":"event","type":"string"},"event":{"type":"string","maxLength":1024,"description":"What happened?","examples":["User clicked \"{cssSelector}\"","User {user.name} logged in","Application error: {error.message}","Unhandled JS error","Cart checkout"]},"error":{"$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/error-info","description":"Optional error associated with this event."}}}
Please see https://github.com/confluentinc/ksql/issues/ to see if this particular reason is already known.
If not, please log a new issue, including this full error message.
Schema:{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://app.logary.tech/schemas/event-message.schema.json","allOf":[{"$ref":"https://app.logary.tech/schemas/logary-message-base.schema.json"}],"title":"EventMessage","description":"A Logary event message","type":"object","properties":{"type":{"description":"Discriminator","type":"string","const":"event"},"event":{"description":"What happened?","type":"string","maxLength":1024,"examples":["User clicked \"{cssSelector}\"","User {user.name} logged in","Application error: {error.message}","Unhandled JS error","Cart checkout"]},"monetaryValue":{"description":"How much was lost or gained as a result of this event happening?","$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/money"},"error":{"description":"Optional error associated with this event.","$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/error-info"}},"required":["type","event"]}
Could you try with the latest release if you get the same error? or is there something I'm missing in the schema?
Hi,
The schema is very valid- I spent a lot of time on it so it would work well with Kafka and validated it as part of that.
It’s hard to know what ksqldb doesn’t like about it. It’s just a discriminated union of five types of messages.
At least you found another bug then (or missing feature?).
Henrik
On Thursday, May 06, 2021 at 10:48 PM, Sergio Peña @. @.)> wrote:
@haf (https://github.com/haf) I tried to reproduce this in the latest master branch, but I got the following error:
ksql> CREATE STREAM mystream with (kafka_topic = 'analytics_event2', value_format = 'json_sr'); > > Unable to verify if the value schema for topic analytics_event2 is compatible with ksqlDB. Reason: Unsupported criterion allOf for {"title":"EventMessage","description":"A Logary event message","$id":"https://app.logary.tech/schemas/event-message.schema.json","$schema":"http://json-schema.org/draft-07/schema#","allOf":[{"$ref":"https://app.logary.tech/schemas/logary-message-base.schema.json"}],"type":"object","required":["type","event"],"properties":{"monetaryValue":{"$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/money","description":"How much was lost or gained as a result of this event happening?"},"type":{"description":"Discriminator","const":"event","type":"string"},"event":{"type":"string","maxLength":1024,"description":"What happened?","examples":["User clicked \"{cssSelector}\"","User {user.name} logged in","Application error: {error.message}","Unhandled JS error","Cart checkout"]},"error":{"$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/error-info","description":"Optional error associated with this event."}}} Please see https://github.com/confluentinc/ksql/issues/ to see if this particular reason is already known. If not, please log a new issue, including this full error message. Schema:{"$schema":"http://json-schema.org/draft-07/schema#","$id":"https://app.logary.tech/schemas/event-message.schema.json","allOf":[{"$ref":"https://app.logary.tech/schemas/logary-message-base.schema.json"}],"title":"EventMessage","description":"A Logary event message","type":"object","properties":{"type":{"description":"Discriminator","type":"string","const":"event"},"event":{"description":"What happened?","type":"string","maxLength":1024,"examples":["User clicked \"{cssSelector}\"","User {user.name} logged in","Application error: {error.message}","Unhandled JS error","Cart checkout"]},"monetaryValue":{"description":"How much was lost or gained as a result of this event happening?","$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/money"},"error":{"description":"Optional error associated with this event.","$ref":"https://app.logary.tech/schemas/definitions.schema.json#/definitions/error-info"}},"required":["type","event"]}
Could you try with the latest release if you get the same error? or is there something I'm missing in the schema?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/confluentinc/ksql/issues/7392#issuecomment-833854845), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AABPEW2R26T23T43SEBILA3TML6DTANCNFSM43EMTTAA).
@haf I saw you reported a similar issue with the allOf() problem here https://github.com/confluentinc/ksql/issues/6521
Nevermind, I see that https://github.com/confluentinc/ksql/issues/6521 is related to not having the allOf() in the schema. This issue is because it has the allOf() and it is not supported. I just try to reproduce it in 0.15 and CP 6.0 and I don't see the stackoverflow.
I'll close this issue as not reproducible. It may be fixed once allOf() is supported in https://github.com/confluentinc/ksql/issues/6521
Describe the bug
ksqlDB crashes for simple JSON schemas.
Create a topic. Associate it with the JSON schema from https://app.logary.tech/schemas/event-message.schema.json via Schema Registry. Produce JSON to that topic using that schema. All fine so far.
Now create a ksqlDB stream using that topic:
CREATE STREAM mystream with (kafka_topic = 'analytics_event', value_format = 'json_sr');
Log output:
Output from the request:
Expected behavior
Additional context