kite-sdk / kite

Kite SDK
http://kitesdk.org/docs/current/
Apache License 2.0
394 stars 263 forks source link

Kite CLI csv-import reads in only null values when --no-header flag not set #445

Open chaosmail opened 8 years ago

chaosmail commented 8 years ago

When importing a csv file without a header and without specifying the --no-header flag, kite gives no error message but imports only null values instead of the correct values.

$ ./kite-dataset csv-import path/to/sample.csv sample
> Added 3255 records to sample
$ ./kite-dataset show sample --num-records 5
> {"key0": null, "key1": null, "key2": null, "key3": null, "key4": null, "key5": null},
  {"key0": null, "key1": null, "key2": null, "key3": null, "key4": null, "key5": null},
  {"key0": null, "key1": null, "key2": null, "key3": null, "key4": null, "key5": null},
  {"key0": null, "key1": null, "key2": null, "key3": null, "key4": null, "key5": null},
  {"key0": null, "key1": null, "key2": null, "key3": null, "key4": null, "key5": null}

The avro specification was generated with kite and looks sth like this:

  ...
  fields: {
    [
        {
            "name": "key0",
            "type": ["null", "string"]
        }, ...
     ]
  }

I am using Kite version 1.1.0

Best, Christoph