Fix JSON flatten docs, add link to path expression tester (#3105)

This commit is contained in:
Jonathan Wei 2016-06-07 14:39:57 -07:00 committed by Fangjin Yang
parent 4ab675e863
commit c5dbf364e3
1 changed files with 4 additions and 3 deletions

View File

@ -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",
@ -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.