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

Kafka Connect Deserialized object without properties #309

Open
adrien-brunelat-sb opened this issue Nov 8, 2023 · 0 comments
Open

Kafka Connect Deserialized object without properties #309

adrien-brunelat-sb opened this issue Nov 8, 2023 · 0 comments

Comments

@adrien-brunelat-sb
Copy link

adrien-brunelat-sb commented Nov 8, 2023

Hello there, I'm trying to deserialize this event with a Glue schema through Kafka Connect:

{
  "EventName": "test_name",
  "ClientTimestamp": "2023-11-08T17:19:40.317Z",
  "Payload": {
    "IsSuccessful": "true",
    "LoginDuration": "1.950996",
    "LoginType": "XSX",
    "SecondsSinceLaunch": "33.477",
    "SessionID": "EF2E41A645707B10A11973B1378861D4",
    "UserEmailAddress": "[email protected]",
    "UserID": "3560342d4ca25c99a8f92562575acc27"
  },
  "EventTimestamp": "2023-11-08T17:19:40.317Z"
}

This is my schema definition:

{
	"$id": "https://example.com/schema.json",
	"$schema": "http://json-schema.org/draft-07/schema#",
	"title": "AnalyticsEvent",
	"type": "object",
	"properties": {
		"EventName": {
			"type": "string",
			"description": "EventName"
		},
		"EventTimestamp": {
			"type": "string",
			"description": "EventTimestamp"
		},
		"ClientTimestamp": {
			"type": "string",
			"description": "ClientTimestamp"
		},
		"Payload": {
			"type": "object",
			"description": "Payload"
		}
	}
}

Then Kafka Connect sends everything to Snowflake via a Snowpipe. I've left Payload without properties because they can vary and I want it to be deserialized as a Snowflake semi-structured "variant" column. Unfortunately, on Snowflake's side, the payload column is always {}, meaning empty object, all other fields are ok.

Would this be coming from the deserializer? How could I fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant