fix ripple effect of DRILL-3134
Project: http://git-wip-us.apache.org/repos/asf/drill/repo Commit: http://git-wip-us.apache.org/repos/asf/drill/commit/3b79623a Tree: http://git-wip-us.apache.org/repos/asf/drill/tree/3b79623a Diff: http://git-wip-us.apache.org/repos/asf/drill/diff/3b79623a Branch: refs/heads/gh-pages Commit: 3b79623ae1a90f2a35e59ca9db7e6e45e1b9f491 Parents: 72c054b Author: Kristine Hahn <kh...@maprtech.com> Authored: Wed May 20 10:39:33 2015 -0700 Committer: Kristine Hahn <kh...@maprtech.com> Committed: Wed May 20 10:39:33 2015 -0700 ---------------------------------------------------------------------- _docs/data-sources-and-file-formats/050-json-data-model.md | 4 +++- _docs/sql-reference/data-types/010-supported-data-types.md | 6 +++++- .../data-types/030-handling-different-data-types.md | 4 +--- 3 files changed, 9 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/drill/blob/3b79623a/_docs/data-sources-and-file-formats/050-json-data-model.md ---------------------------------------------------------------------- diff --git a/_docs/data-sources-and-file-formats/050-json-data-model.md b/_docs/data-sources-and-file-formats/050-json-data-model.md index 183ea17..70ccf94 100644 --- a/_docs/data-sources-and-file-formats/050-json-data-model.md +++ b/_docs/data-sources-and-file-formats/050-json-data-model.md @@ -56,7 +56,9 @@ When you set this option, Drill reads all numbers from the JSON files as DOUBLE. * Cast JSON values to [SQL types]({{ site.baseurl }}/docs/json-data-model/#data-type-mapping), such as BIGINT, FLOAT, and INTEGER. * Cast JSON strings to [Drill Date/Time Data Type Formats]({{ site.baseurl }}/docs/date-time-and-timestamp). -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. +[âQuery Complex Dataâ]({{ site.baseurl }}/docs/querying-complex-data-introduction) show how to use [composite types]({{site.baseurl}}/docs/supported-data-types/#composite-types) to access nested arrays. + +Drill uses these types internally for reading complex and nested data structures from data sources such as JSON. ## Reading JSON To read JSON data using Drill, use a [file system storage plugin]({{ site.baseurl }}/docs/file-system-storage-plugin/) that defines the JSON format. You can use the `dfs` storage plugin, which includes the definition. http://git-wip-us.apache.org/repos/asf/drill/blob/3b79623a/_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 e0fa02e..8008f76 100644 --- a/_docs/sql-reference/data-types/010-supported-data-types.md +++ b/_docs/sql-reference/data-types/010-supported-data-types.md @@ -46,6 +46,10 @@ Drill supports the following composite types: * Array * Map +A map is a set of name/value pairs. A value in a map can be a scalar type, such as string or int, or a complex type, such as an array or another map. An array is a repeated list of values. A value in an array can be a scalar type, such as string or int, or an array can be a complex type, such as a map or another array. + +Drill uses map and array data types internally for reading complex and nested data structures from data sources. For more information, see examples of [handling JSON maps and arrays]({{ site.baseurl }}/docs/handling-different-data-types/#handling-json-and-parquet-data). + 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]` @@ -54,7 +58,7 @@ 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. +The section [âQuery Complex Dataâ]({{ site.baseurl }}/docs/querying-complex-data-introduction) show how to use [composite types]({{site.baseurl}}/docs/supported-data-types/#composite-types) 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/). http://git-wip-us.apache.org/repos/asf/drill/blob/3b79623a/_docs/sql-reference/data-types/030-handling-different-data-types.md ---------------------------------------------------------------------- diff --git a/_docs/sql-reference/data-types/030-handling-different-data-types.md b/_docs/sql-reference/data-types/030-handling-different-data-types.md index ca72082..c14e795 100644 --- a/_docs/sql-reference/data-types/030-handling-different-data-types.md +++ b/_docs/sql-reference/data-types/030-handling-different-data-types.md @@ -9,9 +9,7 @@ To query HBase data in Drill, convert every column of an HBase table to/from byt In a textual file, such as CSV, Drill interprets every field as a VARCHAR, as previously mentioned. In addition to using the CAST function, you can also use TO_CHAR, TO_DATE, TO_NUMBER, and TO_TIMESTAMP. If the SELECT statement includes a WHERE clause that compares a column of an unknown data type, cast both the value of the column and the comparison value in the WHERE clause. ## Handling JSON and Parquet Data -Complex and nested data structures in JSON and Parquet files are of map and array types. - -A map is a set of name/value pairs. A value in a map can be a scalar type, such as string or int, or a complex type, such as an array or another map. An array is a repeated list of values. A value in an array can be a scalar type, such as string or int, or an array can be a complex type, such as a map or another array. +Complex and nested data structures in JSON and Parquet files are [composite types](({{site.baseurl}}/docs/supported-data-types/#composite-types)): map and array. Drill reads/writes maps and arrays from/to JSON and Parquet files. In Drill, you do not cast a map or array to another type.