aesop icon indicating copy to clipboard operation
aesop copied to clipboard

binary type seems not supported by avro

Open yanky80 opened this issue 9 years ago • 2 comments

Hi,

I'm using your avro schema tool to generate avro schema file, and using linkedin databus as code base to build relay, client and bootstap binaries to run. And I get error when testing mysql varbinary column. Here is the stack trace. So how do you process binary type when loading avro schema?

org.apache.avro.SchemaParseException: Undefined name: "binary" at org.apache.avro.Schema.parse(Schema.java:935) at org.apache.avro.Schema.parse(Schema.java:1042) at org.apache.avro.Schema.parse(Schema.java:977) at org.apache.avro.Schema.parse(Schema.java:880) at com.linkedin.databus2.schemas.FileSystemVersionedSchemaSetProvider.loadSchemas(FileSystemVersionedSchemaSetProvider.java:105) at com.linkedin.databus2.schemas.FileSystemVersionedSchemaSetProvider.loadSchemas(FileSystemVersionedSchemaSetProvider.java:91) at com.linkedin.databus2.schemas.FileSystemVersionedSchemaSetProvider.loadSchemas(FileSystemVersionedSchemaSetProvider.java:70) at com.linkedin.databus2.schemas.FileSystemSchemaRegistryService.refreshSchemaSet(FileSystemSchemaRegistryService.java:156) at com.linkedin.databus2.schemas.FileSystemSchemaRegistryService.initializeSchemaSet(FileSystemSchemaRegistryService.java:135) at com.linkedin.databus2.schemas.FileSystemSchemaRegistryService.build(FileSystemSchemaRegistryService.java:57) at com.linkedin.databus2.schemas.StandardSchemaRegistryFactory.createSchemaRegistry(StandardSchemaRegistryFactory.java:50) at com.linkedin.databus.container.netty.HttpRelay.(HttpRelay.java:132) at com.linkedin.databus2.relay.DatabusRelayMain.(DatabusRelayMain.java:100) at com.linkedin.databus.relay.example.PersonRelayServer.main(PersonRelayServer.java:74)

yanky80 avatar Jul 23 '15 11:07 yanky80

@jagadeesh-huliyar @regunathb We need to pick this up. Lets plan for it.

aryaKetan avatar Aug 12 '15 10:08 aryaKetan

@yanky80 Right now, we are not supporting binary type columns. We will look to support this, but as of now, cant commit on time-frame.

A hackish solution for your current problem : Create a column as varchar and in your application code, serialize the column in your application code to byte[] and then upsert the byte[] into your varchar column.

Now, in your aesop code, where-ever you are reading the column, use the same logic to de-serialize it into the object of your choice.

aryaKetan avatar Aug 12 '15 11:08 aryaKetan