DRILL-3134 add map construct example
Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/72c054b5 Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/72c054b5 Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/72c054b5 Branch: refs/heads/gh-pages Commit: 72c054b562161ebfef0b6b48fea2b87fa2757727 Parents: e45f60c Author: Kristine Hahn <kh...@maprtech.com> Authored: Wed May 20 10:09:30 2015 -0700 Committer: Kristine Hahn <kh...@maprtech.com> Committed: Wed May 20 10:09:30 2015 -0700 ---------------------------------------------------------------------- _docs/sql-reference/data-types/010-supported-data-types.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/72c054b5/_docs/sql-reference/data-types/010-supported-data-types.md ---------------------------------------------------------------------- diff --git a/_docs/sql-reference/data-types/010-supported-data-types.md b/_docs/sql-reference/data-types/010-supported-data-types.md index 17fcedb..e0fa02e 100644 --- a/_docs/sql-reference/data-types/010-supported-data-types.md +++ b/_docs/sql-reference/data-types/010-supported-data-types.md @@ -46,13 +46,17 @@ Drill supports the following composite types: * Array * Map -In this release of Drill, you cannot reference a composite type by name in a query, but Drill supports array values coming from data sources. For example, you can use the index syntax to query data and get the value of an array element. +In this release of Drill, you cannot reference a composite type by name in a query, but Drill supports array values coming from data sources. For example, you can use the index syntax to query data and get the value of an array element: `a[1]` +You can refer to the value for a key in a map using this syntax: + +`m['k']` + Drill uses [map and array data types]({{ site.baseurl }}/docs/handling-different-data-types/#handling-json-and-parquet-data) internally for reading complex and nested data structures from data sources such as JSON. You can cast data in a map or array of data to return a value from the structure, as shown in [âCreate a view on a MapR-DB tableâ] ({{ site.baseurl }}/docs/lesson-2-run-queries-with-ansi-sql/#create-a-view-on-a-mapr-db-table). [âQuery Complex Dataâ]({{ site.baseurl }}/docs/querying-complex-data-introduction) shows how to access nested arrays. -For more information about using array and map types, see the sections, [KVGEN]({{site.baseurl}}/docs/kvgen/), and [FLATTEN]({{site.baseurl}}/docs/flatten/). +For more information about using array and map types, see the sections, ["KVGEN"]({{site.baseurl}}/docs/kvgen/) and ["FLATTEN"]({{site.baseurl}}/docs/flatten/). ## Casting and Converting Data Types