.avro datatype is not compatible with the 2021 Alteryx version hence the file can be converted to .csv format using the below python code-
import fastavro
import csv
def convert_avro_to_csv(avro_file, csv_file):
# Read the Avro file using fastavro library
with open(avro_file, 'rb') as avro_data:
avro_reader = fastavro.reader(avro_data)
avro_schema = avro_reader.writer_schema
avro_records = list(avro_reader)
# Extract the Avro field names from the schema
field_names = [field['name'] for field in avro_schema['fields']]
# Write the Avro records to a CSV file
with open(csv_file, 'w', newline='', encoding="utf-8") as csv_data:
writer = csv.DictWriter(csv_data, fieldnames=field_names)
writer.writeheader()
writer.writerows(avro_records)
# Example usage
convert_avro_to_csv(avro_file, csv_file)
Post conversion the csv file can be read in alteryx as normal.
I believe that Alteryx is natively compatable with Avro. 2021.4 is at least.
User | Count |
---|---|
106 | |
85 | |
76 | |
54 | |
40 |