Skip to content

Commit

Permalink
Fix JSON flatten docs, add link to path expression tester (apache#3105)
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-wei authored and fjy committed Jun 7, 2016
1 parent 4ab675e commit c5dbf36
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/content/ingestion/flatten-json.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ To flatten this JSON, the parseSpec could be defined as follows:
{
"type": "path",
"name": "world-hey",
"expr": "$.world.hey"
"expr": "$.world[0].hey"
},
{
"type": "path",
"name": "worldtree",
"expr": "$.world.tree"
"expr": "$.world[1].tree"
},
{
"type": "path",
Expand Down Expand Up @@ -147,4 +147,5 @@ Note that:
* Enabling 'useFieldDiscovery' will only autodetect fields at the root level with a single value (not a map or list), as well as fields referring to a list of single values. In the example above, "dim1", "dim2", "dim3", "ignore_me", "metrica", and "foo.bar" (at the root) would be automatically detected as columns. The "hello" field is a list of Doubles and will be autodiscovered, but note that the example ingests the individual list members as separate fields. The "world" field must be explicitly defined because its value is a map. The "mixarray" field, while similar to "hello", must also be explicitly defined because its last value is a map.
* Duplicate field definitions are not allowed, an exception will be thrown.
* If auto field discovery is enabled, any discovered field with the same name as one already defined in the field specs will be skipped and not added twice.
* The JSON input must be a JSON object at the root, not an array. e.g., {"valid": "true"} and {"valid":[1,2,3]} are supported but [{"invalid": "true"}] and [1,2,3] are not.
* The JSON input must be a JSON object at the root, not an array. e.g., {"valid": "true"} and {"valid":[1,2,3]} are supported but [{"invalid": "true"}] and [1,2,3] are not.
* [http://jsonpath.herokuapp.com/](http://jsonpath.herokuapp.com/) is useful for testing the path expressions.

0 comments on commit c5dbf36

Please sign in to comment.