Cca 175 avro schema extraction from multiple avro files

how to get avsc schema file if we are given multiple avro files
if one avro is given we can use avro-tools getschema and redirect the output to a file
how to handle if multiple avro files are available and output has to be only one avsc file

Step1: Copy just one partition of avro data file (as in /departments/part-m-00000.avro ) to local.

Step2: avro-tools getschema part-m-00000.avro > departments.avsc

Hope that helps!


Avro schema will be associated within every files. You can use any file to extract schema.

1 Like

To get schema for multiple avro files with command is not possible,cause it prints the schema. Better to write a script file.