Return-Path: X-Original-To: apmail-asterixdb-commits-archive@minotaur.apache.org Delivered-To: apmail-asterixdb-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 408F61810B for ; Sat, 18 Jul 2015 01:40:55 +0000 (UTC) Received: (qmail 35529 invoked by uid 500); 18 Jul 2015 01:40:55 -0000 Delivered-To: apmail-asterixdb-commits-archive@asterixdb.apache.org Received: (qmail 35498 invoked by uid 500); 18 Jul 2015 01:40:55 -0000 Mailing-List: contact commits-help@asterixdb.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.incubator.apache.org Delivered-To: mailing list commits@asterixdb.incubator.apache.org Received: (qmail 35489 invoked by uid 99); 18 Jul 2015 01:40:55 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Jul 2015 01:40:55 +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 7FBD4186207 for ; Sat, 18 Jul 2015 01:40:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id QvsAu4M7XQAA for ; Sat, 18 Jul 2015 01:40:41 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with SMTP id 3906024A29 for ; Sat, 18 Jul 2015 01:40:40 +0000 (UTC) Received: (qmail 35237 invoked by uid 99); 18 Jul 2015 01:40:40 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Jul 2015 01:40:40 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E815BE6828; Sat, 18 Jul 2015 01:40:38 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: imaxon@apache.org To: commits@asterixdb.incubator.apache.org Date: Sat, 18 Jul 2015 01:40:45 -0000 Message-Id: In-Reply-To: <8e98b19e89604459b8cfb7562df6e671@git.apache.org> References: <8e98b19e89604459b8cfb7562df6e671@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [8/9] incubator-asterixdb git commit: Adding introspection for getting record details. Adding introspection for getting record details. Change-Id: Iba15acff0f6830cffbc33d9dac3b5f0c417be844 Reviewed-on: https://asterix-gerrit.ics.uci.edu/313 Tested-by: Jenkins Reviewed-by: Steven Jacobs Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/900bf134 Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/900bf134 Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/900bf134 Branch: refs/heads/master Commit: 900bf1345410264e9b48469da93ccbd831920d2e Parents: 032a178 Author: Preston Carman Authored: Wed Jul 8 23:44:13 2015 -0700 Committer: Steven Jacobs Committed: Mon Jul 13 10:43:48 2015 -0700 ---------------------------------------------------------------------- asterix-app/data/classifications/animals.adm | 4 + asterix-app/pom.xml | 409 ++++++++++--------- .../common/AsterixHyracksIntegrationUtil.java | 86 ++-- .../ics/asterix/test/metadata/MetadataTest.java | 4 +- .../asterix/test/optimizer/OptimizerTest.java | 2 +- .../ics/asterix/test/runtime/ExecutionTest.java | 21 +- .../ics/asterix/test/runtime/RepeatedTest.java | 105 +++++ .../queries/records/RecordsQueries.xml | 127 ++++++ .../access-nested-fields.1.ddl.aql | 60 +++ .../access-nested-fields.10.query.aql | 11 + .../access-nested-fields.11.query.aql | 11 + .../access-nested-fields.12.query.aql | 11 + .../access-nested-fields.2.update.aql | 10 + .../access-nested-fields.3.query.aql | 12 + .../access-nested-fields.4.query.aql | 12 + .../access-nested-fields.5.query.aql | 12 + .../access-nested-fields.6.query.aql | 12 + .../access-nested-fields.7.query.aql | 12 + .../access-nested-fields.8.query.aql | 11 + .../access-nested-fields.9.query.aql | 11 + .../documentation-example.1.query.aql | 10 + .../documentation-example.2.query.aql | 10 + .../documentation-example.3.query.aql | 10 + .../highly-nested-open.1.ddl.aql | 63 +++ .../highly-nested-open.2.update.aql | 9 + .../highly-nested-open.3.query.aql | 11 + .../highly-nested-mixed.1.ddl.aql | 59 +++ .../highly-nested-mixed.2.update.aql | 9 + .../highly-nested-mixed.3.query.aql | 11 + .../highly-nested-open.1.ddl.aql | 54 +++ .../highly-nested-open.2.update.aql | 9 + .../highly-nested-open.3.query.aql | 11 + .../tiny-social-example.1.ddl.aql | 49 +++ .../tiny-social-example.2.ddl.aql | 24 ++ .../tiny-social-example.3.update.aql | 18 + .../tiny-social-example.4.query.aql | 13 + .../documentation-example.1.query.aql | 10 + ...ny-social-example-no-complex-types.1.ddl.aql | 83 ++++ ...ny-social-example-no-complex-types.2.ddl.aql | 38 ++ ...social-example-no-complex-types.3.update.aql | 61 +++ ...-social-example-no-complex-types.4.query.aql | 10 + ...-social-example-no-complex-types.5.query.aql | 10 + ...-social-example-no-complex-types.6.query.aql | 10 + ...-social-example-no-complex-types.7.query.aql | 10 + ...-social-example-no-complex-types.8.query.aql | 10 + ...-social-example-no-complex-types.9.query.aql | 13 + .../tiny-social-example-only-lists.1.ddl.aql | 85 ++++ .../tiny-social-example-only-lists.2.ddl.aql | 38 ++ .../tiny-social-example-only-lists.3.update.aql | 63 +++ .../tiny-social-example-only-lists.4.query.aql | 10 + .../tiny-social-example-only-lists.5.query.aql | 10 + .../tiny-social-example-only-lists.6.query.aql | 10 + .../tiny-social-example-only-lists.7.query.aql | 10 + .../tiny-social-example-only-lists.8.query.aql | 10 + .../tiny-social-example-only-lists.9.query.aql | 13 + .../tiny-social-example-only-records.1.ddl.aql | 85 ++++ .../tiny-social-example-only-records.2.ddl.aql | 38 ++ ...iny-social-example-only-records.3.update.aql | 63 +++ ...tiny-social-example-only-records.4.query.aql | 10 + ...tiny-social-example-only-records.5.query.aql | 10 + ...tiny-social-example-only-records.6.query.aql | 10 + ...tiny-social-example-only-records.7.query.aql | 10 + ...tiny-social-example-only-records.8.query.aql | 10 + ...tiny-social-example-only-records.9.query.aql | 13 + .../tiny-social-example.1.ddl.aql | 47 +++ .../tiny-social-example.2.ddl.aql | 24 ++ .../tiny-social-example.3.update.aql | 18 + .../tiny-social-example.4.query.aql | 10 + .../tiny-social-example.5.query.aql | 10 + .../tiny-social-example.6.query.aql | 10 + .../tiny-social-example.7.query.aql | 10 + .../tiny-social-example.8.query.aql | 10 + .../tiny-social-example.9.query.aql | 13 + .../resources/runtimets/repeatedtestsuite.xml | 31 ++ .../access-nested-fields.10.adm | 5 + .../access-nested-fields.11.adm | 5 + .../access-nested-fields.12.adm | 5 + .../access-nested-fields.3.adm | 5 + .../access-nested-fields.4.adm | 5 + .../access-nested-fields.5.adm | 5 + .../access-nested-fields.6.adm | 5 + .../access-nested-fields.7.adm | 5 + .../access-nested-fields.8.adm | 5 + .../access-nested-fields.9.adm | 5 + .../documentation-example.1.adm | 2 + .../documentation-example.2.adm | 2 + .../documentation-example.3.adm | 2 + .../highly-nested-closed.3.adm | 5 + .../highly-nested-mixed.3.adm | 5 + .../highly-nested-open/highly-nested-open.3.adm | 5 + .../tiny-social-example.4.adm | 25 ++ .../documentation-example.1.adm | 2 + .../tiny-social-example-no-complex-types.4.adm | 2 + .../tiny-social-example-no-complex-types.5.adm | 11 + .../tiny-social-example-no-complex-types.6.adm | 16 + .../tiny-social-example-no-complex-types.7.adm | 5 + .../tiny-social-example-no-complex-types.8.adm | 13 + .../tiny-social-example-no-complex-types.9.adm | 5 + .../tiny-social-example-only-lists.4.adm | 2 + .../tiny-social-example-only-lists.5.adm | 11 + .../tiny-social-example-only-lists.6.adm | 16 + .../tiny-social-example-only-lists.7.adm | 5 + .../tiny-social-example-only-lists.8.adm | 13 + .../tiny-social-example-only-lists.9.adm | 6 + .../tiny-social-example-only-records.4.adm | 2 + .../tiny-social-example-only-records.5.adm | 11 + .../tiny-social-example-only-records.6.adm | 16 + .../tiny-social-example-only-records.7.adm | 5 + .../tiny-social-example-only-records.8.adm | 13 + .../tiny-social-example-only-records.9.adm | 6 + .../tiny-social-example.4.adm | 2 + .../tiny-social-example.5.adm | 11 + .../tiny-social-example.6.adm | 16 + .../tiny-social-example.7.adm | 5 + .../tiny-social-example.8.adm | 13 + .../tiny-social-example.9.adm | 7 + .../src/test/resources/runtimets/testsuite.xml | 65 +-- .../src/main/resources/schema/asterix-conf.xsd | 178 ++++---- .../src/main/resources/schema/yarn_cluster.xsd | 254 ++++++++---- asterix-doc/src/site/markdown/aql/functions.md | 61 +++ .../indexing/input/AbstractHDFSReader.java | 23 +- .../external/library/JavaFunctionHelper.java | 8 +- .../external/library/java/IJListAccessor.java | 4 +- .../external/library/java/IJRecordAccessor.java | 4 +- .../external/library/java/JObjectAccessors.java | 19 +- .../library/java/JObjectPointableVisitor.java | 8 +- .../metadata/declared/PKGeneratingAdapter.java | 6 +- .../asterix/builders/AbvsBuilderFactory.java | 27 ++ .../asterix/builders/ListBuilderFactory.java | 29 ++ .../asterix/builders/RecordBuilderFactory.java | 25 ++ .../data/nontagged/printers/ADatePrinter.java | 8 +- .../nontagged/printers/ADateTimePrinter.java | 10 +- .../printers/ADayTimeDurationPrinter.java | 1 - .../data/nontagged/printers/AObjectPrinter.java | 19 +- .../data/nontagged/printers/ATimePrinter.java | 10 +- .../data/nontagged/printers/PrintTools.java | 5 +- .../nontagged/printers/csv/ADatePrinter.java | 1 - .../printers/csv/ADateTimePrinter.java | 1 - .../printers/csv/AIntervalPrinter.java | 2 - .../nontagged/printers/csv/AObjectPrinter.java | 25 +- .../printers/json/ADayTimeDurationPrinter.java | 1 - .../printers/json/ADurationPrinter.java | 2 +- .../nontagged/printers/json/AObjectPrinter.java | 26 +- .../nontagged/AqlCSVPrinterFactoryProvider.java | 19 +- .../AqlJSONPrinterFactoryProvider.java | 19 +- .../nontagged/AqlPrinterFactoryProvider.java | 21 +- .../om/functions/AsterixBuiltinFunctions.java | 115 ++---- .../asterix/om/pointables/AListPointable.java | 181 -------- .../om/pointables/AListVisitablePointable.java | 181 ++++++++ .../asterix/om/pointables/ARecordPointable.java | 288 ------------- .../pointables/ARecordVisitablePointable.java | 288 +++++++++++++ .../om/pointables/PointableAllocator.java | 4 +- .../om/pointables/cast/ACastVisitor.java | 8 +- .../asterix/om/pointables/cast/AListCaster.java | 4 +- .../om/pointables/cast/ARecordCaster.java | 4 +- .../pointables/nonvisitor/AListPointable.java | 193 +++++++++ .../pointables/nonvisitor/ARecordPointable.java | 335 +++++++++++++++ .../om/pointables/printer/AListPrinter.java | 4 +- .../om/pointables/printer/APrintVisitor.java | 8 +- .../om/pointables/printer/ARecordPrinter.java | 4 +- .../pointables/printer/csv/APrintVisitor.java | 8 +- .../pointables/printer/csv/ARecordPrinter.java | 4 +- .../pointables/printer/json/AListPrinter.java | 4 +- .../pointables/printer/json/APrintVisitor.java | 8 +- .../pointables/printer/json/ARecordPrinter.java | 4 +- .../visitor/IVisitablePointableVisitor.java | 8 +- .../om/typecomputer/impl/AnyTypeComputer.java | 38 ++ .../impl/FieldAccessNestedResultType.java | 23 +- .../impl/SubsetCollectionTypeComputer.java | 71 ++++ .../asterix/om/util/NonTaggedFormatUtil.java | 1 + .../common/FieldAccessByIndexEvalFactory.java | 138 ------- .../common/FieldAccessNestedEvalFactory.java | 231 ----------- .../ClosedRecordConstructorDescriptor.java | 52 +++ .../OpenRecordConstructorDescriptor.java | 113 +++++ .../ClosedRecordConstructorDescriptor.java | 52 --- .../functions/FieldAccessByIndexDescriptor.java | 51 --- .../functions/FieldAccessByNameDescriptor.java | 137 ------- .../functions/FieldAccessNestedDescriptor.java | 55 --- .../OpenRecordConstructorDescriptor.java | 113 ----- .../functions/RecordMergeDescriptor.java | 262 ------------ .../records/FieldAccessByIndexDescriptor.java | 50 +++ .../records/FieldAccessByIndexEvalFactory.java | 138 +++++++ .../records/FieldAccessByNameDescriptor.java | 43 ++ .../records/FieldAccessByNameEvalFactory.java | 111 +++++ .../records/FieldAccessNestedDescriptor.java | 54 +++ .../records/FieldAccessNestedEvalFactory.java | 68 +++ .../functions/records/FieldAccessUtil.java | 194 +++++++++ .../records/GetRecordFieldValueDescriptor.java | 50 +++ .../records/GetRecordFieldValueEvalFactory.java | 98 +++++ .../records/GetRecordFieldsDescriptor.java | 50 +++ .../records/GetRecordFieldsEvalFactory.java | 101 +++++ .../functions/records/RecordFieldsUtil.java | 303 ++++++++++++++ .../records/RecordMergeDescriptor.java | 257 ++++++++++++ .../runtime/formats/NonTaggedDataFormat.java | 51 ++- .../runtime/operators/file/ADMDataParser.java | 70 +--- .../testframework/context/TestCaseContext.java | 1 + pom.xml | 126 +++--- 197 files changed, 5855 insertions(+), 2340 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/data/classifications/animals.adm ---------------------------------------------------------------------- diff --git a/asterix-app/data/classifications/animals.adm b/asterix-app/data/classifications/animals.adm new file mode 100644 index 0000000..953f083 --- /dev/null +++ b/asterix-app/data/classifications/animals.adm @@ -0,0 +1,4 @@ +{ "id": 1, "class": { "id": 1, "fullClassification": { "id": 1, "Kingdom": "Animalia", "lower": { "id": 1, "Phylum": "Chordata", "lower": { "id": 1, "Class": "Mammalia", "lower": { "id": 1, "Order": "Carnivora", "lower": { "id": 1, "Family": "Mustelinae", "lower": { "id": 1, "Genus": "Gulo", "lower": { "id": 1, "Species": "Gulo" } } } } } } } } } +{ "id": 2, "class": { "id": 2, "fullClassification": { "id": 2, "Kingdom": "Animalia", "lower": { "id": 2, "Phylum": "Chordata", "lower": { "id": 2, "Class": "Mammalia", "lower": { "id": 2, "Order": "Artiodactyla", "lower": { "id": 2, "Family": "Giraffidae", "lower": { "id": 2, "Genus": "Okapia", "lower": { "id": 2, "Species": "Johnstoni" } } } } } } } } } +{ "id": 3, "class": { "id": 3, "fullClassification": { "id": 3, "Kingdom": "Animalia", "lower": { "id": 3, "Phylum": "Chordata", "lower": { "id": 3, "Class": "Mammalia", "lower": { "id": 3, "Order": "Atlantogenata", "lower": { "id": 3, "Family": "Afrotheria", "lower": { "id": 3, "Genus": "Paenungulata", "lower": { "id": 3, "Species": "Hyracoidea" } } } } } } } } } +{ "id": 4, "class": { "id": 4, "fullClassification": { "id": 4, "Kingdom": "Animalia", "lower": { "id": 4, "Phylum": "Chordata", "lower": { "id": 4, "Class": "Aves", "lower": { "id": 4, "Order": "Accipitriformes", "lower": { "id": 4, "Family": "Accipitridae", "lower": { "id": 4, "Genus": "Buteo", "lower": { "id": 4, "Species": "Jamaicensis" } } } } } } } } } http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/pom.xml ---------------------------------------------------------------------- diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml index 2db0974..cad13ce 100644 --- a/asterix-app/pom.xml +++ b/asterix-app/pom.xml @@ -7,221 +7,224 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ! See the License for the specific language governing permissions and ! limitations under the License. ! --> - - 4.0.0 - - asterix - edu.uci.ics.asterix - 0.8.7-SNAPSHOT - - asterix-app - - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - A business-friendly OSS license - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 2.3.2 - - 1.7 - 1.7 - true - - - - org.codehaus.mojo - appassembler-maven-plugin - 1.0 - - - - - - edu.uci.ics.asterix.drivers.AsterixWebServer - asterix-web - - - edu.uci.ics.asterix.drivers.AsterixClientDriver - asterix-cmd - - - edu.uci.ics.asterix.drivers.AsterixCLI - asterix-cli - - - flat - lib - - package - - assemble - - - - - - maven-assembly-plugin - 2.2-beta-5 - - - - - src/main/assembly/binary-assembly.xml - - - package - - attached - - - - - - + + 4.0.0 + + asterix + edu.uci.ics.asterix + 0.8.7-SNAPSHOT + + asterix-app - - - javax.servlet - servlet-api - jar - - - org.eclipse.jetty - jetty-server - 8.0.0.M2 - jar - compile - - - org.eclipse.jetty - jetty-servlet - 8.0.0.M2 - jar - compile - - - edu.uci.ics.hyracks - hyracks-control-cc - - - edu.uci.ics.hyracks - hyracks-control-nc - - - edu.uci.ics.hyracks - algebricks-compiler - - - edu.uci.ics.hyracks - hyracks-client - - - edu.uci.ics.asterix - asterix-algebra - 0.8.7-SNAPSHOT - compile - - - edu.uci.ics.asterix - asterix-aql - 0.8.7-SNAPSHOT - jar - compile - - - edu.uci.ics.asterix - asterix-om - 0.8.7-SNAPSHOT - jar - compile - - - edu.uci.ics.asterix - asterix-metadata - 0.8.7-SNAPSHOT - jar - compile - - - edu.uci.ics.asterix - asterix-tools - 0.8.7-SNAPSHOT - jar - compile - - - edu.uci.ics.asterix - asterix-common - 0.8.7-SNAPSHOT - jar - compile - - - edu.uci.ics.asterix - asterix-common - 0.8.7-SNAPSHOT - test-jar - test - + + + Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + A business-friendly OSS license + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.7 + 1.7 + true + + + + org.codehaus.mojo + appassembler-maven-plugin + 1.0 + + + + + + edu.uci.ics.asterix.drivers.AsterixWebServer + asterix-web + + + edu.uci.ics.asterix.drivers.AsterixClientDriver + asterix-cmd + + + edu.uci.ics.asterix.drivers.AsterixCLI + asterix-cli + + + flat + lib + + package + + assemble + + + + + + maven-assembly-plugin + 2.2-beta-5 + + + + + src/main/assembly/binary-assembly.xml + + + package + + attached + + + + + + + + + + javax.servlet + servlet-api + jar + + + org.eclipse.jetty + jetty-server + 8.0.0.M2 + jar + compile + + + org.eclipse.jetty + jetty-servlet + 8.0.0.M2 + jar + compile + + + edu.uci.ics.hyracks + hyracks-control-cc + + + edu.uci.ics.hyracks + hyracks-control-nc + + + edu.uci.ics.hyracks + algebricks-compiler + + + edu.uci.ics.hyracks + hyracks-client + + + edu.uci.ics.asterix + asterix-algebra + 0.8.7-SNAPSHOT + compile + + + edu.uci.ics.asterix + asterix-aql + 0.8.7-SNAPSHOT + jar + compile + + + edu.uci.ics.asterix + asterix-om + 0.8.7-SNAPSHOT + jar + compile + + + edu.uci.ics.asterix + asterix-metadata + 0.8.7-SNAPSHOT + jar + compile + + + edu.uci.ics.asterix + asterix-tools + 0.8.7-SNAPSHOT + jar + compile + + + edu.uci.ics.asterix + asterix-common + 0.8.7-SNAPSHOT + jar + compile + + + edu.uci.ics.asterix + asterix-common + 0.8.7-SNAPSHOT + test-jar + test + - - edu.uci.ics.asterix - asterix-transactions - 0.8.7-SNAPSHOT - compile - - - org.apache.hadoop - hadoop-client - jar - - - org.apache.hadoop - hadoop-hdfs - jar - test - - - xerces - xercesImpl - 2.9.1 - jar - compile - - - xalan - xalan - 2.7.1 - jar - test - - - edu.uci.ics.asterix - asterix-test-framework - 0.8.7-SNAPSHOT - test - + + edu.uci.ics.asterix + asterix-transactions + 0.8.7-SNAPSHOT + compile + + + org.apache.hadoop + hadoop-client + jar + + + org.apache.hadoop + hadoop-hdfs + jar + test + + + xerces + xercesImpl + 2.9.1 + jar + compile + + + xalan + xalan + 2.7.1 + jar + test + + + edu.uci.ics.asterix + asterix-test-framework + 0.8.7-SNAPSHOT + test + org.mockito mockito-all 1.10.19 - com.e-movimento.tinytools + com.e-movimento.tinytools privilegedaccessor 1.2.2 - + http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java ---------------------------------------------------------------------- diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java index a1c5348..91aa897 100644 --- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java +++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java @@ -32,16 +32,15 @@ import edu.uci.ics.hyracks.control.nc.NodeControllerService; public class AsterixHyracksIntegrationUtil { - public static final String[] NC_IDS = { "nc1", "nc2" }; - public static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" }; + public static final int NODES = 2; + public static final int PARTITONS = 2; public static final int DEFAULT_HYRACKS_CC_CLIENT_PORT = 1098; public static final int DEFAULT_HYRACKS_CC_CLUSTER_PORT = 1099; private static ClusterControllerService cc; - private static NodeControllerService nc1; - private static NodeControllerService nc2; + private static NodeControllerService[] ncs = new NodeControllerService[NODES]; private static IHyracksClientConnection hcc; public static void init() throws Exception { @@ -58,48 +57,61 @@ public class AsterixHyracksIntegrationUtil { cc = new ClusterControllerService(ccConfig); cc.start(); - NCConfig ncConfig1 = new NCConfig(); - ncConfig1.ccHost = "localhost"; - ncConfig1.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT; - ncConfig1.clusterNetIPAddress = "127.0.0.1"; - ncConfig1.dataIPAddress = "127.0.0.1"; - ncConfig1.resultIPAddress = "127.0.0.1"; - ncConfig1.nodeId = NC_IDS[0]; - ncConfig1.resultTTL = 30000; - ncConfig1.resultSweepThreshold = 1000; - ncConfig1.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + "nc1/iodevice0" + "," - + System.getProperty("java.io.tmpdir") + File.separator + "nc1/iodevice1"; - ncConfig1.appNCMainClass = NCApplicationEntryPoint.class.getName(); - nc1 = new NodeControllerService(ncConfig1); - nc1.start(); - - NCConfig ncConfig2 = new NCConfig(); - ncConfig2.ccHost = "localhost"; - ncConfig2.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT; - ncConfig2.clusterNetIPAddress = "127.0.0.1"; - ncConfig2.dataIPAddress = "127.0.0.1"; - ncConfig2.resultIPAddress = "127.0.0.1"; - ncConfig2.nodeId = NC_IDS[1]; - ncConfig2.resultTTL = 30000; - ncConfig2.resultSweepThreshold = 1000; - ncConfig2.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + "nc2/iodevice0" + "," - + System.getProperty("java.io.tmpdir") + File.separator + "nc2/iodevice1"; - ncConfig2.appNCMainClass = NCApplicationEntryPoint.class.getName(); - nc2 = new NodeControllerService(ncConfig2); - nc2.start(); + int n = 0; + for (String ncName : getNcNames()) { + NCConfig ncConfig1 = new NCConfig(); + ncConfig1.ccHost = "localhost"; + ncConfig1.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT; + ncConfig1.clusterNetIPAddress = "127.0.0.1"; + ncConfig1.dataIPAddress = "127.0.0.1"; + ncConfig1.resultIPAddress = "127.0.0.1"; + ncConfig1.nodeId = ncName; + ncConfig1.resultTTL = 30000; + ncConfig1.resultSweepThreshold = 1000; + for (int p = 0; p < PARTITONS; ++p) { + if (p == 0) { + ncConfig1.ioDevices = System.getProperty("java.io.tmpdir") + File.separator + ncConfig1.nodeId + + "/iodevice" + p; + } else { + ncConfig1.ioDevices += "," + System.getProperty("java.io.tmpdir") + File.separator + + ncConfig1.nodeId + "/iodevice" + p; + } + } + ncConfig1.appNCMainClass = NCApplicationEntryPoint.class.getName(); + ncs[n] = new NodeControllerService(ncConfig1); + ncs[n].start(); + ++n; + } hcc = new HyracksConnection(cc.getConfig().clientNetIpAddress, cc.getConfig().clientNetPort); } + public static String[] getNcNames() { + String[] names = new String[NODES]; + for (int n = 0; n < NODES; ++n) { + names[n] = "nc" + (n + 1); + } + return names; + } + + public static String[] getDataDirs() { + String[] names = new String[NODES]; + for (int n = 0; n < NODES; ++n) { + names[n] = "nc" + (n + 1) + "data"; + } + return names; + } + public static IHyracksClientConnection getHyracksClientConnection() { return hcc; } public static void deinit() throws Exception { - if (nc2 != null) - nc2.stop(); - if (nc1 != null) - nc1.stop(); + for (int n = 0; n < ncs.length; ++n) { + if (ncs[n] != null) + ncs[n].stop(); + + } if (cc != null) cc.stop(); } http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java index 0197d4a..069c5aa 100644 --- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java +++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java @@ -73,13 +73,13 @@ public class MetadataTest { } // clean up the files written by the ASTERIX storage manager - for (String d : AsterixHyracksIntegrationUtil.ASTERIX_DATA_DIRS) { + for (String d : AsterixHyracksIntegrationUtil.getDataDirs()) { TestsUtils.deleteRec(new File(d)); } } private static void deleteTransactionLogs() throws Exception { - for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) { + for (String ncId : AsterixHyracksIntegrationUtil.getNcNames()) { File log = new File(txnProperties.getLogDirectory(ncId)); if (log.exists()) { FileUtils.deleteDirectory(log); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java index 7171642..58531aa 100644 --- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java +++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java @@ -89,7 +89,7 @@ public class OptimizerTest { } private static void deleteTransactionLogs() throws Exception { - for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) { + for (String ncId : AsterixHyracksIntegrationUtil.getNcNames()) { File log = new File(txnProperties.getLogDirectory(ncId)); if (log.exists()) { FileUtils.deleteDirectory(log); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java index 3e5b734..8547eb0 100644 --- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java +++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/ExecutionTest.java @@ -44,16 +44,15 @@ import edu.uci.ics.asterix.testframework.context.TestCaseContext; @RunWith(Parameterized.class) public class ExecutionTest { - private static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName()); + protected static final Logger LOGGER = Logger.getLogger(ExecutionTest.class.getName()); - private static final String PATH_ACTUAL = "rttest" + File.separator; - private static final String PATH_BASE = StringUtils.join(new String[] { "src", "test", "resources", "runtimets" }, - File.separator); + protected static final String PATH_ACTUAL = "rttest" + File.separator; + protected static final String PATH_BASE = StringUtils.join( + new String[] { "src", "test", "resources", "runtimets" }, File.separator); - private static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml"; - private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" }; + protected static final String TEST_CONFIG_FILE_NAME = "asterix-build-configuration.xml"; - private static AsterixTransactionProperties txnProperties; + protected static AsterixTransactionProperties txnProperties; @BeforeClass public static void setUp() throws Exception { @@ -96,14 +95,14 @@ public class ExecutionTest { outdir.delete(); } // clean up the files written by the ASTERIX storage manager - for (String d : ASTERIX_DATA_DIRS) { + for (String d : AsterixHyracksIntegrationUtil.getDataDirs()) { TestsUtils.deleteRec(new File(d)); } HDFSCluster.getInstance().cleanup(); } private static void deleteTransactionLogs() throws Exception { - for (String ncId : AsterixHyracksIntegrationUtil.NC_IDS) { + for (String ncId : AsterixHyracksIntegrationUtil.getNcNames()) { File log = new File(txnProperties.getLogDirectory(ncId)); if (log.exists()) { FileUtils.deleteDirectory(log); @@ -120,7 +119,7 @@ public class ExecutionTest { return testArgs; } - private static Collection buildTestsInXml(String xmlfile) throws Exception { + protected static Collection buildTestsInXml(String xmlfile) throws Exception { Collection testArgs = new ArrayList(); TestCaseContext.Builder b = new TestCaseContext.Builder(); for (TestCaseContext ctx : b.build(new File(PATH_BASE), xmlfile)) { @@ -130,7 +129,7 @@ public class ExecutionTest { } - private TestCaseContext tcCtx; + protected TestCaseContext tcCtx; public ExecutionTest(TestCaseContext tcCtx) { this.tcCtx = tcCtx; http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java new file mode 100644 index 0000000..faeb688 --- /dev/null +++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RepeatedTest.java @@ -0,0 +1,105 @@ +/* + * Copyright 2009-2013 by The Regents of the University of California + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * you may obtain a copy of the License from + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package edu.uci.ics.asterix.test.runtime; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Collection; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.MethodRule; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.junit.runners.Parameterized.Parameters; +import org.junit.runners.model.FrameworkMethod; +import org.junit.runners.model.Statement; + +import edu.uci.ics.asterix.test.aql.TestsUtils; +import edu.uci.ics.asterix.test.runtime.RepeatRule.Repeat; +import edu.uci.ics.asterix.testframework.context.TestCaseContext; + +/** + * Runs runtime test cases that have been identified in the repeatedtestsuite.xml. + * + * Each test is run 10000 times. + */ +class RepeatRule implements MethodRule { + + @Retention(RetentionPolicy.RUNTIME) + @Target({ java.lang.annotation.ElementType.METHOD }) + public @interface Repeat { + public abstract int times(); + + } + + private static class RepeatStatement extends Statement { + + private final int times; + private final Statement statement; + + private RepeatStatement(int times, Statement statement) { + this.times = times; + this.statement = statement; + } + + @Override + public void evaluate() throws Throwable { + for (int i = 0; i < times; i++) { + statement.evaluate(); + } + } + } + + @Override + public Statement apply(Statement statement, FrameworkMethod method, Object target) { + Statement result = statement; + Repeat repeat = method.getAnnotation(Repeat.class); + if (repeat != null) { + int times = repeat.times(); + result = new RepeatStatement(times, statement); + } + return result; + + } +} + +@RunWith(Parameterized.class) +public class RepeatedTest extends ExecutionTest { + + private int count; + + @Parameters + public static Collection tests() throws Exception { + Collection testArgs = buildTestsInXml(TestCaseContext.DEFAULT_REPEADED_TESTSUITE_XML_NAME); + return testArgs; + } + + public RepeatedTest(TestCaseContext tcCtx) { + super(tcCtx); + count = 0; + } + + @Rule + public RepeatRule repeatRule = new RepeatRule(); + + @Test + @Repeat(times = 10000) + public void test() throws Exception { + System.err.println("***** Test Count: " + (++count) + " ******"); + TestsUtils.executeTest(PATH_ACTUAL, tcCtx, null, false); + } +} http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml b/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml new file mode 100644 index 0000000..283cdea --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/RecordsQueries.xml @@ -0,0 +1,127 @@ + + + + access-nested-fields + + + + + closed-record-constructor_01 + + + + + closed-record-constructor_02 + + + + + closed-record-constructor_03 + + + + + expFieldName + + + + + field-access-by-index_01 + + + + + field-access-on-open-field + + + + + documentation-example + + + + + tiny-social-example + + + + + tiny-social-example-no-complex-types + + + + + tiny-social-example-only-lists + + + + + tiny-social-example-only-records + + + + + documentation-example + + + + + highly-nested-closed + + + + + highly-nested-mixed + + + + + highly-nested-open + + + + + tiny-social-example + + + + + open-record-constructor_01 + + + + + open-record-constructor_02 + + + + + closed-closed-fieldname-conflict_issue173 + edu.uci.ics.asterix.common.exceptions.AsterixException + + + + + open-closed-fieldname-conflict_issue173 + edu.uci.ics.asterix.common.exceptions.AsterixException + + + + + open-open-fieldname-conflict_issue173 + edu.uci.ics.asterix.common.exceptions.AsterixException + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql new file mode 100644 index 0000000..6681a75 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.1.ddl.aql @@ -0,0 +1,60 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type S as open{ + id: int64 +} + +create type GS as closed{ + id: int64, + Genus: string, + lower: S +} + +create type FGS as open{ + id: int64, + Family: string +} + +create type OFGS as closed{ + id: int64, + Order: string, + lower: FGS +} + +create type COFGS as closed{ + id: int64, + Class: string, + lower: OFGS +} + +create type PCOFGS as closed{ + id: int64, + Phylum: string, + lower: COFGS +} + +create type KPCOFGS as open{ + id: int64, + Kingdom: string +} + +create type Classification as closed{ + id: int64, + fullClassification:KPCOFGS +} + +create type Animal as open{ + id: int64 +} + +create dataset Animals(Animal) +primary key id; + http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql new file mode 100644 index 0000000..f7198ce --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.10.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql new file mode 100644 index 0000000..262bee1 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.11.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := $test.class +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql new file mode 100644 index 0000000..2b28594 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.12.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := $test +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql new file mode 100644 index 0000000..73ce6f5 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.2.update.aql @@ -0,0 +1,10 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + +use dataverse test; + +load dataset Animals using localfs +(("path"="nc1://data/classifications/animals.adm"),("format"="adm")); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql new file mode 100644 index 0000000..e92f44e --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.3.query.aql @@ -0,0 +1,12 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower.lower.lower.lower.lower.lower.Species +order by $result +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql new file mode 100644 index 0000000..6e8e9c8 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.4.query.aql @@ -0,0 +1,12 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower.lower.lower.lower.lower.lower +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql new file mode 100644 index 0000000..718129a --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.5.query.aql @@ -0,0 +1,12 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower.lower.lower.lower.lower +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql new file mode 100644 index 0000000..5ee7ad6 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.6.query.aql @@ -0,0 +1,12 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower.lower.lower.lower +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql new file mode 100644 index 0000000..30d6496 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.7.query.aql @@ -0,0 +1,12 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower.lower.lower +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql new file mode 100644 index 0000000..fd9c55d --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.8.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower.lower +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql new file mode 100644 index 0000000..a4fff3d --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/access-nested-fields/access-nested-fields.9.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Access a records nested records at each level. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := $test.class.fullClassification.lower +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql new file mode 100644 index 0000000..2876ebf --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.1.query.aql @@ -0,0 +1,10 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + let $r1 := {"id":1, + "project":"AsterixDB", + "address":{"city":"Irvine", "state":"CA"}, + "related":["Hivestrix", "Preglix", "Apache VXQuery"] } + return get-record-field-value($r1, "project") http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql new file mode 100644 index 0000000..c1d2b5d --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.2.query.aql @@ -0,0 +1,10 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + let $r1 := {"id":1, + "project":"AsterixDB", + "address":{"city":"Irvine", "state":"CA"}, + "related":["Hivestrix", "Preglix", "Apache VXQuery"] } + return get-record-field-value($r1, "address") http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql new file mode 100644 index 0000000..6be3409 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/documentation-example/documentation-example.3.query.aql @@ -0,0 +1,10 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + let $r1 := {"id": 1, + "project": "AsterixDB", + "address": { "city": "Irvine", "state": "CA" }, + "related": [ "Hivestrix", "Preglix", "Apache VXQuery" ] } + return get-record-field-value($r1, "related") http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql new file mode 100644 index 0000000..f36f1bc --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.1.ddl.aql @@ -0,0 +1,63 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type S as closed{ + id: int64, + Species: string +} + +create type GS as closed{ + id: int64, + Genus: string, + lower: S +} + +create type FGS as closed{ + id: int64, + Family: string, + lower:GS +} + +create type OFGS as closed{ + id: int64, + Order: string, + lower: FGS +} + +create type COFGS as closed{ + id: int64, + Class: string, + lower: OFGS +} + +create type PCOFGS as closed{ + id: int64, + Phylum: string, + lower: COFGS +} + +create type KPCOFGS as closed{ + id: int64, + Kingdom: string, + lower: PCOFGS +} + +create type Classification as closed{ + id: int64, + fullClassification:KPCOFGS +} + +create type Animal as closed{ + id: int64, + class: Classification +} + +create dataset Animals(Animal) +primary key id; http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql new file mode 100644 index 0000000..7b270b9 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.2.update.aql @@ -0,0 +1,9 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +load dataset Animals using localfs +(("path"="nc1://data/classifications/animals.adm"),("format"="adm")); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql new file mode 100644 index 0000000..8634bde --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-closed/highly-nested-open.3.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := get-record-field-value($test, "class") +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql new file mode 100644 index 0000000..eff94c8 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.1.ddl.aql @@ -0,0 +1,59 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type S as open{ + id: int64 +} + +create type GS as closed{ + id: int64, + Genus: string, + lower: S +} + +create type FGS as open{ + id: int64, + Family: string +} + +create type OFGS as closed{ + id: int64, + Order: string, + lower: FGS +} + +create type COFGS as open{ + id: int64, + Class: string, + lower: OFGS +} + +create type PCOFGS as closed{ + id: int64, + Phylum: string, + lower: COFGS +} + +create type KPCOFGS as open{ + id: int64, + Kingdom: string +} + +create type Classification as closed{ + id: int64, + fullClassification:KPCOFGS +} + +create type Animal as open{ + id: int64 +} + +create dataset Animals(Animal) +primary key id; http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql new file mode 100644 index 0000000..7b270b9 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.2.update.aql @@ -0,0 +1,9 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +load dataset Animals using localfs +(("path"="nc1://data/classifications/animals.adm"),("format"="adm")); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql new file mode 100644 index 0000000..8634bde --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-mixed/highly-nested-mixed.3.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := get-record-field-value($test, "class") +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql new file mode 100644 index 0000000..32a8aaa --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.1.ddl.aql @@ -0,0 +1,54 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +drop dataverse test if exists; +create dataverse test; + +use dataverse test; + +create type S as open{ + id: int64 +} + +create type GS as open{ + id: int64, + Genus: string +} + +create type FGS as open{ + id: int64, + Family: string +} + +create type OFGS as open{ + id: int64, + Order: string +} + +create type COFGS as open{ + id: int64, + Class: string +} + +create type PCOFGS as open{ + id: int64, + Phylum: string +} + +create type KPCOFGS as open{ + id: int64, + Kingdom: string +} + +create type Classification as open{ + id: int64 +} + +create type Animal as open{ + id: int64 +} + +create dataset Animals(Animal) +primary key id; http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql new file mode 100644 index 0000000..7b270b9 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.2.update.aql @@ -0,0 +1,9 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +load dataset Animals using localfs +(("path"="nc1://data/classifications/animals.adm"),("format"="adm")); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql new file mode 100644 index 0000000..8634bde --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/highly-nested-open/highly-nested-open.3.query.aql @@ -0,0 +1,11 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse test; + +for $test in dataset Animals +let $result := get-record-field-value($test, "class") +order by $result.id +return $result; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql new file mode 100644 index 0000000..b167657 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.1.ddl.aql @@ -0,0 +1,49 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +drop dataverse TinySocial if exists; +create dataverse TinySocial; +use dataverse TinySocial; + +create type TwitterUserType as open { + screen-name: string, + lang: string, + friends_count: int64, + statuses_count: int64, + name: string, + followers_count: int64 +} + +create type TweetMessageType as closed { + tweetid: string, + user: TwitterUserType, + sender-location: point?, + send-time: datetime, + referred-topics: {{ string }}, + message-text: string +} + +create type EmploymentType as open { + organization-name: string, + start-date: date, + end-date: date? +} + +create type FacebookUserType as closed { + id: int64, + alias: string, + name: string, + user-since: datetime, + friend-ids: {{ int64 }}, + employment: [EmploymentType] +} + +create type FacebookMessageType as closed { + message-id: int64, + author-id: int64, + in-response-to: int64?, + sender-location: point?, + message: string +} http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql new file mode 100644 index 0000000..dfc09cc --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.2.ddl.aql @@ -0,0 +1,24 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse TinySocial; + +create dataset FacebookUsers(FacebookUserType) +primary key id; + +create dataset FacebookMessages(FacebookMessageType) +primary key message-id; + +create dataset TwitterUsers(TwitterUserType) +primary key screen-name; + +create dataset TweetMessages(TweetMessageType) +primary key tweetid +hints(cardinality=100); + +create index fbUserSinceIdx on FacebookUsers(user-since); +create index fbAuthorIdx on FacebookMessages(author-id) type btree; +create index fbSenderLocIndex on FacebookMessages(sender-location) type rtree; +create index fbMessageIdx on FacebookMessages(message) type keyword; http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql new file mode 100644 index 0000000..f45cfa7 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.3.update.aql @@ -0,0 +1,18 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse TinySocial; + +load dataset FacebookUsers using localfs +(("path"="nc1://data/tinysocial/fbu.adm"),("format"="adm")); + +load dataset FacebookMessages using localfs +(("path"="nc1://data/tinysocial/fbm.adm"),("format"="adm")); + +load dataset TwitterUsers using localfs +(("path"="nc1://data/tinysocial/twu.adm"),("format"="adm")); + +load dataset TweetMessages using localfs +(("path"="nc1://data/tinysocial/twm.adm"),("format"="adm")); http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql new file mode 100644 index 0000000..1a560e5 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-field-value/tiny-social-example/tiny-social-example.4.query.aql @@ -0,0 +1,13 @@ +/* +* Description : Testing get-record-field-value under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +use dataverse TinySocial; + +for $r in dataset TweetMessages +for $f in get-record-fields($r) +where $f.field-type = "STRING" +let $result := get-record-field-value($r, $f.field-name) +order by $result +return $result http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql new file mode 100644 index 0000000..84df51e --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/documentation-example/documentation-example.1.query.aql @@ -0,0 +1,10 @@ +/* +* Description : Testing get-record-fields under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ + let $r1 := {"id":1, + "project":"AsterixDB", + "address":{"city":"Irvine", "state":"CA"}, + "related":["Hivestrix", "Preglix", "Apache VXQuery"] } + return get-record-fields($r1) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/900bf134/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql ---------------------------------------------------------------------- diff --git a/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql new file mode 100644 index 0000000..4ae62c8 --- /dev/null +++ b/asterix-app/src/test/resources/runtimets/queries/records/get-record-fields/tiny-social-example-no-complex-types/tiny-social-example-no-complex-types.1.ddl.aql @@ -0,0 +1,83 @@ +/* +* Description : Testing get-record-fields under different queries. +* Expected Res : Success +* Date : 04 Jun 2015 +*/ +drop dataverse TinySocial if exists; +create dataverse TinySocial; +use dataverse TinySocial; + +create type TwitterUserType as open { + screen-name: string, + lang: string, + friends_count: int64, + statuses_count: int64 +} + +create type TweetMessageType as closed { + tweetid: string, + user: TwitterUserType, + sender-location: point?, + send-time: datetime, + referred-topics: {{ string }}, + message-text: string +} + +create type EmploymentType as open { + organization-name: string, + start-date: date, + end-date: date? +} + +create type FacebookUserType as closed { + id: int64, + alias: string, + name: string, + user-since: datetime, + friend-ids: {{ int64 }}, + employment: [EmploymentType] +} + +create type FacebookMessageType as closed { + message-id: int64, + author-id: int64, + in-response-to: int64?, + sender-location: point?, + message: string +} + +// Alternate datasets +create type TwitterUserAlternateType as open { + screen-name: string, + lang: string, + friends_count: int64, + statuses_count: int64 +} + +create type TweetMessageAlternateType as closed { + tweetid: string, + sender-location: point?, + send-time: datetime, + message-text: string +} + +create type EmploymentAlternateType as open { + organization-name: string, + start-date: date, + end-date: date? +} + +create type FacebookUserAlternateType as closed { + id: int64, + alias: string, + name: string, + user-since: datetime +} + +create type FacebookMessageAlternateType as closed { + message-id: int64, + author-id: int64, + in-response-to: int64?, + sender-location: point?, + message: string +}