lyfeyaj / jaql

Automatically exported from code.google.com/p/jaql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

del() should exploit field order in schema

GoogleCodeExporter opened this issue · comments

The del() function used to read delimited files currently takes two options
that describe how JSON records are to be produced from the input: "fields"
and "convert". The fields options describes the order of the fields in the
file, while convert describes the data types of each field. For example,
the command

read(del("file", { fields: [ "a", "b" ], convert: schema { a: long, b:
string } })

reads a file with two columns and puts the result into a record. The aboce
command is clumsy because field names have to be repeated. This issue
proposed to modify del() so that it takes just one argument named "schema":

read(del("file", { schema: schema { a: long, b: string } })

The order of the fields in the file is taken from the schema (possible due
to Issue 72). To read a file without conversion, simply use

read(del("file", { schema: schema { a, b } })).

Note that this change makes the del() function consistent with other file
descriptor functions, which also use a "schema" field.

Original issue reported on code.google.com by Rainer.G...@gmx.de on 1 Feb 2010 at 11:34

Committed r481.

Original comment by Rainer.G...@gmx.de on 1 Feb 2010 at 11:57

  • Changed state: Fixed