jackdaw

dakra 2021-10-04T15:40:46.008700Z

@cddr I want to switch from the jackdaw included avro serde to yours https://github.com/cddr/edn-avro as I had errors with nested lists/maps in jackdaw. But with union types I always have to specify the union-path when I want to convert from edn to avro. So I have {:yolo "yolo"} but need {:yolo {:string "yolo"}} for the example in your code. How do you do it? Always "manually" or do you have some code/helper that you can share. I validate the output with malli so I'm thinking of writing a custom malli transformer but wondering how you handle it and what's the simplest way.

2021-10-04T15:44:23.010600Z

Fortunately I never had to migrate any code from one to the other and the new code I wrote that used edn-avro just used the latter explicitly but I can see how migrating existing code would be annoying

2021-10-04T15:47:11.012400Z

Also, you should probably know I don't actually use this anywhere in production. It was more of an itch I wanted to scratch but haven't yet had the opportunity to use it in a production system.

dakra 2021-10-04T15:50:59.015300Z

Hmm, OK. Thanks. I want to write a relatively simple kstreams app that takes messages from one topic and splits them up (depending on some json field) to X other topics. Input is only json, output is avro as I want the data with the s3-connector to end up as parquet in S3. For some avro schemas with nested map in a list in map, jackdaw errors and I was looking for a simpler way than fixing jackdaw and reading your readme made me think that it's maybe better to not use it at all.

2021-10-04T15:53:02.015800Z

I think you should be able to do that with jackdaw as it is currently no?

2021-10-04T15:53:41.016200Z

Oh sorry I get it.

2021-10-04T15:54:23.016800Z

But yeah the bug you've run into is exactly the reason I wrote edn-avro.

dakra 2021-10-04T15:55:00.017300Z

I simply get

java.lang.IllegalArgumentException: No implementation of method: :clj->avro of protocol: #'jackdaw.serdes.avro/SchemaCoercion found for class: nil

dakra 2021-10-04T15:56:11.018300Z

oh. thanks. Since I have malli schemas for it, shouldn't be hard to transform the output to the json format avro needs. I'll try that.

2021-10-04T15:59:23.020400Z

Would be interesting to see what you come up with if you're permitted to share it. I'll happily add a docs section to the edn-avro project to document stuff like this because that's what people want to see 🙂 "ok you're project's great but how do I use it with...."

dakra 2021-10-04T16:00:30.021100Z

Sure. I'll message you/open a PR if I have something useful.