csv2avro

command module
v0.0.0-...-5fb928b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

koron/csv2avro

PkgGoDev Actions/Go

Convert CSV/TSV file to AVRO file.

How to install

$ go install github.com/koron/csv2avro@latest

Features

  • Detect CSV or TSV by extension of file name
  • Auto detect a header row

Usage

$ csv2avro -schema {SCHEMA} [-input {INPUT}] [-output {OUTPUT}] [OPTIONS]
  • SCHEMA: AVRO schema, mandatory
  • INPUT: optional, default is STDIN It will be treated as TSV when a file name ends with ".tsv". Otherwise it is treated as CSV.
  • OUTPUT: optional, default is STDOUT

Other options:

  • -tsv Force input as TSV.

Example:

$ csv2avro -schema my_shcema.avsc < input.csv > output.avro

$ csv2avro -schema my_shcema.avsc -tsv < input.tsv > output.avro

Supported Avro's types

  • string
  • int
  • long
  • float
  • double
  • boolean
  • null - always null.

Misc for development

Test command:

$ go build
$ ./csv2avro -schema testdata/sample1.avsc -input testdata/sample1.csv -output testdata/sample1.avro

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址