You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the field name doesn't match the specs, it's impossible to generate an Avro schema using that name. So this is a case of that more general issue. We can call this something like 'Kite CSV schema inference errors when headers don't obey Avro specs'.
One solution would be to slightly change the inferSchema and inferNullableSchema methods that currently take the Set<String> requiredFields parameter. We could make this Map<String, String> requiredFieldMappings to let the user specify Avro-safe names for all the required fields. Then inferSchemaInternal uses the mappings to generate the schema.
We are often have files with just text in the header row, containing spaces, cyrillic letters etc, so field names inferred also doesn't match Avro's specification.
Our team proposal is to do some automatic transformation on such field names, like base32 encoding, plus generate schema doc using original column value.
I tried kite sdk to create avro schema out of csv file using below command:
kite-dataset csv-schema test.CSV --class Sample
It fails (when column header has spaces):
"field 1","field 2","field 3"
"Agwam","Agwam, MA","25007"
with following error:
Success example:
"field1","field2","field3"
"Agwam","Agwam, MA","25007"
Not sure if there is a way to handle it.
The text was updated successfully, but these errors were encountered: