Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A86D7200B9E for ; Sat, 24 Sep 2016 02:33:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A6EDA160AD6; Sat, 24 Sep 2016 00:33:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 3863D160AD0 for ; Sat, 24 Sep 2016 02:33:51 +0200 (CEST) Received: (qmail 37465 invoked by uid 500); 24 Sep 2016 00:33:50 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 37456 invoked by uid 99); 24 Sep 2016 00:33:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Sep 2016 00:33:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EDF9C18059B for ; Sat, 24 Sep 2016 00:33:49 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.919 X-Spam-Level: X-Spam-Status: No, score=0.919 tagged_above=-999 required=6.31 tests=[SPF_FAIL=0.919] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id mr695g4K2DVf for ; Sat, 24 Sep 2016 00:33:45 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 819025F47C for ; Sat, 24 Sep 2016 00:33:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id 2222A2420AC; Fri, 23 Sep 2016 17:33:45 -0700 (PDT) Date: Fri, 23 Sep 2016 17:33:45 -0700 From: "Yingyi Bu (Code Review)" Message-ID: Reply-To: buyingyi@gmail.com X-Gerrit-MessageType: newchange Subject: Change in asterixdb[master]: Revise the data model document. X-Gerrit-Change-Id: I9c51f4f14ce7c16c98ea67503488e69e19d9195d X-Gerrit-ChangeURL: X-Gerrit-Commit: 3e559f6b386841c9d3a03f259a58d881349ffafc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.8.4 To: undisclosed-recipients:; archived-at: Sat, 24 Sep 2016 00:33:52 -0000 Yingyi Bu has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/1206 Change subject: Revise the data model document. ...................................................................... Revise the data model document. Change-Id: I9c51f4f14ce7c16c98ea67503488e69e19d9195d --- M asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md M asterixdb/asterix-doc/src/site/markdown/aql/datamodel.md M asterixdb/asterix-doc/src/site/markdown/index.md M asterixdb/asterix-doc/src/site/site.xml 4 files changed, 140 insertions(+), 110 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/06/1206/1 diff --git a/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md b/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md index c9e2acf..cb75d76 100644 --- a/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md +++ b/asterixdb/asterix-doc/src/main/markdown/sqlpp/0_toc.md @@ -53,7 +53,6 @@ * [WITH clauses](#With_clauses) * [LET clauses](#Let_clauses) * [UNION ALL](#Union_all) - * [MISSING in query results](#Missing_in_query_results) * [SQL++ Vs. SQL-92](#Vs_SQL-92) * [4. DDL and DML statements](#DDL_and_DML_statements) * [Declarations](#Declarations) diff --git a/asterixdb/asterix-doc/src/site/markdown/aql/datamodel.md b/asterixdb/asterix-doc/src/site/markdown/aql/datamodel.md index 09d9177..705f1fd 100644 --- a/asterixdb/asterix-doc/src/site/markdown/aql/datamodel.md +++ b/asterixdb/asterix-doc/src/site/markdown/aql/datamodel.md @@ -17,15 +17,15 @@ ! under the License. !--> -# Asterix Data Model (ADM) # +# The Asterix Data Model (ADM) # ## Table of Contents ## * [Primitive Types](#PrimitiveTypes) * [Boolean](#PrimitiveTypesBoolean) - * [Int8 / Int16 / Int32 / Int64](#PrimitiveTypesInt) + * [Tinyint / Smallint / Integer (Int) / Bigint](#PrimitiveTypesInt) * [Float](#PrimitiveTypesFloat) - * [Double](#PrimitiveTypesDouble) + * [Double (Double Precision)](#PrimitiveTypesDouble) * [String](#PrimitiveTypesString) * [Binary](#PrimitiveTypesBinary) * [Point](#PrimitiveTypesPoint) @@ -35,27 +35,32 @@ * [Polygon](#PrimitiveTypesPolygon) * [Date](#PrimitiveTypesDate) * [Time](#PrimitiveTypesTime) - * [Datetime](#PrimitiveTypesDateTime) - * [Duration/Year-month-duration/Day-time-duration](#PrimitiveTypesDuration) + * [Datetime (Timestamp)](#PrimitiveTypesDateTime) + * [Duration/Year_month_duration/Day_time_duration](#PrimitiveTypesDuration) * [Interval](#PrimitiveTypesInterval) * [UUID](#PrimitiveTypesUUID) +* [Special Types] (#SpecialTypes) + * [Null](#SpecialTypesNull) + * [Missing](#SpecialTypesMissing) * [Derived Types](#DerivedTypes) * [Record](#DerivedTypesRecord) - * [OrderedList](#DerivedTypesOrderedList) - * [UnorderedList](#DerivedTypesUnorderedList) + * [Array](#DerivedTypesArray) + * [Multiset](#DerivedTypesMultiset) -An instance of Asterix data model (ADM) can be a _*primitive type*_ (`int32`, `int64`, `string`, `float`, `double`, `date`, `time`, `datetime`, etc. or `null`) or a _*derived type*_. +An instance of Asterix data model (ADM) can be a _*primitive type*_ (`boolean`, +`tinyint`, `smallint`, `integer`, `bigint`, `string`, `float`, `double`, `date`, +`time`, `datetime`, etc.), a _*special type*_ (`null` or `missing`), or a _*derived type*_. -## Primitive Types [Back to TOC] ## +The type names are case-insensitive, e.g., both `BIGINT` and `bigint` are acceptable. -### Boolean[Back to TOC] ### +## Primitive Types## + +### Boolean ### `boolean` data type can have one of the two values: _*true*_ or _*false*_. * Example: - let $t := true - let $f := false - return { "true": $t, "false": $f } + { "true": true, "false": false }; * The expected result is: @@ -64,70 +69,61 @@ -### Int8 / Int16 / Int32 / Int64 [Back to TOC] ### +### Tinyint / Smallint / Integer (Int) / Bigint ### Integer types using 8, 16, 32, or 64 bits. The ranges of these types are: -- `int8`: -127 to 127 -- `int16`: -32767 to 32767 -- `int32`: -2147483647 to 2147483647 -- `int64`: -9223372036854775808 to 9223372036854775807 +- `tinyint`: -127 to 127 +- `smallint`: -32767 to 32767 +- `integer`: -2147483647 to 2147483647 +- `bigint`: -9223372036854775808 to 9223372036854775807 + +`int` is an abbreviated alias for integer. * Example: - let $v8 := int8("125") - let $v16 := int16("32765") - let $v32 := 294967295 - let $v64 := int64("1700000000000000000") - return { "int8": $v8, "int16": $v16, "int32": $v32, "int64": $v64} + { "tinyint": tiny("125"), "smallint": smallint("32765"), "integer": 294967295, "bigint": bigint("1700000000000000000")}; * The expected result is: - { "int8": 125i8, "int16": 32765i16, "int32": 294967295, "int64": 1700000000000000000i64 } + { "tinyint": 125, "smallint": 32765, "integer": 294967295, "bigint": 17000000 } -### Float [Back to TOC] ### -`float` represents approximate numeric data values using 4 bytes. The range of a float value can be from 2^(-149) to (2-2^(-23)·2^(127) for both positive and negative. Beyond these ranges will get `INF` or `-INF`. +### Float ### +`float` represents approximate numeric data values using 4 bytes. The range of a float value can be +from 2^(-149) to (2-2^(-23)·2^(127) for both positive and negative. Beyond these ranges will get `INF` or `-INF`. * Example: - let $v1 := float("NaN") - let $v2 := float("INF") - let $v3 := float("-INF") - let $v4 := float("-2013.5") - return { "v1": $v1, "v2": $v2, "v3": $v3, "v4": $v4 } + { "v1": float("NaN"), "v2": float("INF"), "v3": float("-INF"), "v4": float("-2013.5") }; * The expected result is: - { "v1": NaNf, "v2": Infinityf, "v3": -Infinityf, "v4": -2013.5f } + { "v1": NaN, "v2": Infinity, "v3": -Infinity, "v4": -2013.5 } -### Double [Back to TOC] ### -`double` represents approximate numeric data values using 8 bytes. The range of a double value can be from (2^(-1022)) to (2-2^(-52))·2^(1023) for both positive and negative. Beyond these ranges will get `INF` or `-INF`. +### Double (double precision) ### +`double` represents approximate numeric data values using 8 bytes. The range of a double value can be from (2^(-1022)) to (2-2^(-52))·2^(1023) +for both positive and negative. Beyond these ranges will get `INF` or `-INF`. * Example: - let $v1 := double("NaN") - let $v2 := double("INF") - let $v3 := double("-INF") - let $v4 := double("-2013.593823748327284") - return { "v1": $v1, "v2": $v2, "v3": $v3, "v4": $v4 } + { "v1": double("NaN"), "v2": double("INF"), "v3": double("-INF"), "v4": double("-2013.593823748327284") }; * The expected result is: - { "v1": NaNd, "v2": Infinityd, "v3": -Infinityd, "v4": -2013.5938237483274d } + { "v1": NaN, "v2": Infinity, "v3": -Infinity, "v4": -2013.5938237483274 } +`Double precision` is an alias of `double`. -### String [Back to TOC] ### +### String ### `string` represents a sequence of characters. The total length of the sequence can be up to 2,147,483,648. * Example: - let $v1 := string("This is a string.") - let $v2 := string("\"This is a quoted string\"") - return { "v1": $v1, "v2": $v2 } + { "v1": string("This is a string."), "v2": string("\"This is a quoted string\"") }; * The expected result is: @@ -135,34 +131,35 @@ { "v1": "This is a string.", "v2": "\"This is a quoted string\"" } -### Binary [Back to TOC] ### +### Binary ### `binary` represents a sequence of bytes. It can be constructed from a `hex` or a `base64` string sequence. The total length of the byte sequence can be up to 2,147,483,648. * Example: - let $hex1 := hex("ABCDEF0123456789") - let $hex2 := hex("abcdef0123456789") - let $base64_1 := base64("0123456789qwertyui+/") - let $base64_2 := base64('QXN0ZXJpeA==') - return { "hex1" : $hex1, "hex2": $hex2, "base64_1" : $base64_1, "base64_2" : $base64_2} + { + "hex1" : hex("ABCDEF0123456789"), + "hex2": hex("abcdef0123456789"), + "base64_1" : base64("0123456789qwertyui+/"), + "base64_2" : base64('QXN0ZXJpeA==') + }; * The default output format is in `hex` format. Thus, the expected result is: - { "hex1": hex("ABCDEF0123456789"), - "hex2": hex("ABCDEF0123456789"), - "base64_1": hex("D35DB7E39EBBF3DAB07ABB72BA2FBF"), - "base64_2": hex("41737465726978") } + { + "hex1": hex("ABCDEF0123456789"), + "hex2": hex("ABCDEF0123456789"), + "base64_1": hex("D35DB7E39EBBF3DAB07ABB72BA2FBF"), + "base64_2": hex("41737465726978") + } -### Point [Back to TOC] ### +### Point ### `point` is the fundamental two-dimensional building block for spatial types. It consists of two `double` coordinates x and y. * Example: - let $v1 := point("80.10d, -10E5") - let $v2 := point("5.10E-10d, -10E5") - return { "v1": $v1, "v2": $v2 } + { "v1": point("80.10d, -10E5"), "v2": point("5.10E-10d, -10E5") }; * The expected result is: @@ -170,14 +167,12 @@ { "v1": point("80.1,-1000000.0"), "v2": point("5.1E-10,-1000000.0") } -### Line [Back to TOC] ### +### Line ### `line` consists of two points that represent the start and the end points of a line segment. * Example: - let $v1 := line("10.1234,11.1e-1 +10.2E-2,-11.22") - let $v2 := line("0.1234,-1.00e-10 +10.5E-2,-01.02") - return { "v1": $v1, "v2": $v2 } + { "v1": line("10.1234,11.1e-1 +10.2E-2,-11.22"), "v2": line("0.1234,-1.00e-10 +10.5E-2,-01.02") }; * The expected result is: @@ -185,14 +180,12 @@ { "v1": line("10.1234,1.11 0.102,-11.22"), "v2": line("0.1234,-1.0E-10 0.105,-1.02") } -### Rectangle[Back to TOC] ### +### Rectangle### `rectangle` consists of two points that represent the _*bottom left*_ and _*upper right*_ corners of a rectangle. * Example: - let $v1 := rectangle("5.1,11.8 87.6,15.6548") - let $v2 := rectangle("0.1234,-1.00e-10 5.5487,0.48765") - return { "v1": $v1, "v2": $v2 } + { "v1": rectangle("5.1,11.8 87.6,15.6548"), "v2": rectangle("0.1234,-1.00e-10 5.5487,0.48765") }; * The expected result is: @@ -200,14 +193,12 @@ { "v1": rectangle("5.1,11.8 87.6,15.6548"), "v2": rectangle("0.1234,-1.0E-10 5.5487,0.48765") } -### Circle[Back to TOC] ### +### Circle ### `circle` consists of one point that represents the center of the circle and a radius of type `double`. * Example: - let $v1 := circle("10.1234,11.1e-1 +10.2E-2") - let $v2 := circle("0.1234,-1.00e-10 +10.5E-2") - return { "v1": $v1, "v2": $v2 } + { "v1": circle("10.1234,11.1e-1 +10.2E-2"), "v2": circle("0.1234,-1.00e-10 +10.5E-2") }; * The expected result is: @@ -215,22 +206,26 @@ { "v1": circle("10.1234,1.11 0.102"), "v2": circle("0.1234,-1.0E-10 0.105") } -### Polygon[Back to TOC] ### +### Polygon ### `polygon` consists of _*n*_ points that represent the vertices of a _*simple closed*_ polygon. * Example: - let $v1 := polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81") - let $v2 := polygon("-1.0,+10.5e2 -02.15E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75") - return { "v1": $v1, "v2": $v2 } + { + "v1": polygon("-1.2,+1.3e2 -2.14E+5,2.15 -3.5e+2,03.6 -4.6E-3,+4.81"), + "v2": polygon("-1.0,+10.5e2 -02.15E+50,2.5 -1.0,+3.3e3 -2.50E+05,20.15 +3.5e+2,03.6 -4.60E-3,+4.75 -2,+1.0e2 -2.00E+5,20.10 30.5,03.25 -4.33E-3,+4.75") + }; * The expected result is: - { "v1": polygon("-1.2,130.0 -214000.0,2.15 -350.0,3.6 -0.0046,4.81"), "v2": polygon("-1.0,1050.0 -2.15E50,2.5 -1.0,3300.0 -250000.0,20.15 350.0,3.6 -0.0046,4.75 -2.0,100.0 -200000.0,20.1 30.5,3.25 -0.00433,4.75") } + { + "v1": polygon("-1.2,130.0 -214000.0,2.15 -350.0,3.6 -0.0046,4.81"), + "v2": polygon("-1.0,1050.0 -2.15E50,2.5 -1.0,3300.0 -250000.0,20.15 350.0,3.6 -0.0046,4.75 -2.0,100.0 -200000.0,20.1 30.5,3.25 -0.00433,4.75") } + } -### Date[Back to TOC] ### +### Date ### `date` represents a time point along the Gregorian calendar system specified by the year, month and day. ASTERIX supports the date from `-9999-01-01` to `9999-12-31`. A date value can be represented in two formats, extended format and basic format. @@ -240,9 +235,7 @@ * Example: - let $v1 := date("2013-01-01") - let $v2 := date("-19700101") - return { "v1": $v1, "v2": $v2 } + { "v1": date("2013-01-01"), "v2": date("-19700101") }; * The expected result is: @@ -250,16 +243,14 @@ { "v1": date("2013-01-01"), "v2": date("-1970-01-01") } -### Time[Back to TOC] ### +### Time ### `time` type describes the time within the range of a day. It is represented by three fields: hour, minute and second. Millisecond field is optional as the fraction of the second field. Its extended format is as `hh:mm:ss[.mmm]` and the basic format is `hhmmss[mmm]`. The value domain is from `00:00:00.000` to `23:59:59.999`. Timezone field is optional for a time value. Timezone is represented as `[+|-]hh:mm` for extended format or `[+|-]hhmm` for basic format. Note that the sign designators cannot be omitted. `Z` can also be used to represent the UTC local time. If no timezone information is given, it is UTC by default. * Example: - let $v1 := time("12:12:12.039Z") - let $v2 := time("000000000-0800") - return { "v1": $v1, "v2": $v2 } + { "v1": time("12:12:12.039Z"), "v2": time("000000000-0800") }; * The expected result is: @@ -267,7 +258,7 @@ { "v1": time("12:12:12.039Z"), "v2": time("08:00:00.000Z") } -### Datetime[Back to TOC] ### +### Datetime (Timestamp) ### A `datetime` value is a combination of an `date` and `time`, representing a fixed time point along the Gregorian calendar system. The value is among `-9999-01-01 00:00:00.000` and `9999-12-31 23:59:59.999`. A `datetime` value is represented as a combination of the representation of its `date` part and `time` part, separated by a separator `T`. Either extended or basic format can be used, and the two parts should be the same format. @@ -276,32 +267,33 @@ * Example: - let $v1 := datetime("2013-01-01T12:12:12.039Z") - let $v2 := datetime("-19700101T000000000-0800") - return { "v1": $v1, "v2": $v2 } + { "v1": datetime("2013-01-01T12:12:12.039Z"), "v2": datetime("-19700101T000000000-0800") }; * The expected result is: { "v1": datetime("2013-01-01T12:12:12.039Z"), "v2": datetime("-1970-01-01T08:00:00.000Z") } +`timestamp` is an alias of `datetime`. -### Duration/Year-month-duration/Day-time-duration[Back to TOC] ### +### Duration/Year_month_duration/Day_time_duration ### `duration` represents a duration of time. A duration value is specified by integers on at least one of the following fields: year, month, day, hour, minute, second, and millisecond. A duration value is in the format of `[-]PnYnMnDTnHnMn.mmmS`. The millisecond part (as the fraction of the second field) is optional, and when no millisecond field is used, the decimal point should also be absent. Negative durations are also supported for the arithmetic operations between time instance types (`date`, `time` and `datetime`), and is used to roll the time back for the given duration. For example `date("2012-01-01") + duration("-P3D")` will return `date("2011-12-29")`. -There are also two sub-duration types, namely `year-month-duration` and `day-time-duration`. `year-month-duration` represents only the years and months of a duration, while `day-time-duration` represents only the day to millisecond fields. Different from the `duration` type, both these two subtypes are totally ordered, so they can be used for comparison and index construction. +There are also two sub-duration types, namely `year_month_duration` and `day_time_duration`. +`year_month_duration` represents only the years and months of a duration, +while `day_time_duration` represents only the day to millisecond fields. +Different from the `duration` type, both these two subtypes are totally ordered, so they can be used for comparison and +index construction. Note that a canonical representation of the duration is always returned, regardless whether the duration is in the canonical representation or not from the user's input. More information about canonical representation can be found from [XPath dayTimeDuration Canonical Representation](http://www.w3.org/TR/xpath-functions/#canonical-dayTimeDuration) and [yearMonthDuration Canonical Representation](http://www.w3.org/TR/xpath-functions/#canonical-yearMonthDuration). * Example: - let $v1 := duration("P100Y12MT12M") - let $v2 := duration("-PT20.943S") - return { "v1": $v1, "v2": $v2 } + { "v1": duration("P100Y12MT12M"), "v2": duration("-PT20.943S") }; * The expected result is: @@ -309,38 +301,77 @@ { "v1": duration("P101YT12M"), "v2": duration("-PT20.943S") } -### Interval[Back to TOC] ### +### Interval ### `interval` represents inclusive-exclusive ranges of time. It is defined by two time point values with the same temporal type(`date`, `time` or `datetime`). * Example: - let $v1 := interval(date("2013-01-01"), date("20130505")) - let $v2 := interval(time("00:01:01"), time("213901049+0800")) - let $v3 := interval(datetime("2013-01-01T00:01:01"), datetime("20130505T213901049+0800")) - return { "v1": $v1, "v2": $v2, "v3": $v3 } + { + "v1": interval(date("2013-01-01"), date("20130505")), + "v2": interval(time("00:01:01"), time("213901049+0800")), + "v3": interval(datetime("2013-01-01T00:01:01"), datetime("20130505T213901049+0800")) + }; * The expected result is: - { "v1": interval(date("2013-01-01"), date("2013-05-05")), "v2": interval(time("00:01:01.000Z"), time("13:39:01.049Z")), "v3": interval(datetime("2013-01-01T00:01:01.000Z"), datetime("2013-05-05T13:39:01.049Z")) } + { + "v1": interval(date("2013-01-01"), date("2013-05-05")), + "v2": interval(time("00:01:01.000Z"), time("13:39:01.049Z")), + "v3": interval(datetime("2013-01-01T00:01:01.000Z"), datetime("2013-05-05T13:39:01.049Z")) + } -### UUID[Back to TOC] ### +### UUID ### `uuid` represents a UUID value, which stands for Universally unique identifier. It is defined by a canonical format using hexadecimal text with inserted hyphen characters. (E.g.: 5a28ce1e-6a74-4201-9e8f-683256e5706f). This type is generally used to store auto-generated primary key values. * Example: - let $v1 := uuid("5c848e5c-6b6a-498f-8452-8847a2957421") - return { "v1":$v1 } + return { "v1":uuid("5c848e5c-6b6a-498f-8452-8847a2957421") } * The expected result is: { "v1": uuid("5c848e5c-6b6a-498f-8452-8847a2957421") } +## Special Types## -## Derived Types[Back to TOC] ## +### Null ### +A `null` represent an unknown value. +For example, a user might not be able to know the value of a field and initially set it to `null` +by default until someone enters a value. -### Record[Back to TOC] ### + * Example: + + { "field": null }; + + + * The expected result is: + + { "field": null } + + +### Missing ### +`missing` represents a missing name-value pair in a record. +If the referenced field does not exist, an empty result value is returned by the query. + +Because AsterixDB does not enforce homogeneity for datasets or collections, +items in a dataset or collection can be of heterogeneous types and +so a field can be present in one document and `missing` in another. + + * Example: + + { "field": missing }; + + + * The expected result is: + + { } + +Since a field with value `missing` means the field is absent, we get an empty record. + +## Derived Types ## + +### Record### A `record` contains a set of fields, where each field is described by its name and type. A record type is either open or closed. Open records can contain fields that are not part of the type definition, while closed records cannot. Syntactically, record constructors are surrounded by curly braces "{...}". An example would be @@ -349,8 +380,8 @@ { "id": 213508, "name": "Alice Bob" } -### OrderedList[Back to TOC] ### -An `orderedList` is a sequence of values for which the order is determined by creation or insertion. OrderedList constructors are denoted by brackets: "[...]". +### Array### +An `array` is a container that holds a fixed number of values. Array constructors are denoted by brackets: "[...]". An example would be @@ -358,8 +389,8 @@ ["alice", 123, "bob", null] -### UnorderedList[Back to TOC] ### -An `unorderedList` is an unordered sequence of values, similar to bags in SQL. UnorderedList constructors are denoted by two opening flower braces followed by data and two closing flower braces, like "{{...}}". +### Multiset### +A `multiset` is a generalization of the concept of a set that, unlike a set, allows multiple instances of the multiset's elements. Multiset constructors are denoted by two opening flower braces followed by data and two closing flower braces, like "{{...}}". An example would be diff --git a/asterixdb/asterix-doc/src/site/markdown/index.md b/asterixdb/asterix-doc/src/site/markdown/index.md index f117d93..3455b1b 100644 --- a/asterixdb/asterix-doc/src/site/markdown/index.md +++ b/asterixdb/asterix-doc/src/site/markdown/index.md @@ -26,7 +26,7 @@ * A semistructured NoSQL style data model (ADM) resulting from extending JSON with object database ideas - * An expressive and declarative query language (AQL) that supports a broad + * Two expressive and declarative query languages (SQL++ and AQL) that supports a broad range of queries and analysis over semistructured data * A parallel runtime query execution engine, Apache Hyracks, that has been scale-tested on up to 1000+ cores and 500+ disks diff --git a/asterixdb/asterix-doc/src/site/site.xml b/asterixdb/asterix-doc/src/site/site.xml index 7e6a5cf..6d7a733 100644 --- a/asterixdb/asterix-doc/src/site/site.xml +++ b/asterixdb/asterix-doc/src/site/site.xml @@ -97,7 +97,7 @@ - + -- To view, visit https://asterix-gerrit.ics.uci.edu/1206 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9c51f4f14ce7c16c98ea67503488e69e19d9195d Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Yingyi Bu