Yingyi Bu has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/908
Change subject: ASTERIXDB-1212: fixes and test cases. ...................................................................... ASTERIXDB-1212: fixes and test cases. Change-Id: I0b5fc5c09dfffa11ff8debb69e85ead894b4a597 --- A asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.query.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.query.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.query.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.query.aql A asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.adm A asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.adm M asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml M asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ANullableFieldPrinterFactory.java 10 files changed, 121 insertions(+), 1 deletion(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/08/908/1 diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.query.aql new file mode 100644 index 0000000..3e37ac2 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.query.aql @@ -0,0 +1,24 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 at + * + * 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. + */ + +let $all := [ { "ka":"a1", "kb":"b1"}, + { "ka":2, "kb":"b2"}] +for $x in $all +group by $k := $x.kb with $x +return { "g": $k, "s1": $x[1].ka} diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.query.aql new file mode 100644 index 0000000..e12cb9f --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.query.aql @@ -0,0 +1,25 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 at + * + * 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. + */ + +let $all := [ { "ka":"a1", "kb":"b1"}, + { "ka":"a2", "kb":"b2"}] +for $x in $all +group by $k := $x.kb with $x +return { "g": $k, "s1": $x[1].ka} + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.query.aql new file mode 100644 index 0000000..52ee35d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.query.aql @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 at + * + * 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. + */ + +let $all := [ { "ka":"a1", "kb":"b1"}, + { "ka":2, "kb":"b2"}] +return $all[3].ka; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.query.aql new file mode 100644 index 0000000..bf8b026 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.query.aql @@ -0,0 +1,23 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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 at + * + * 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. + */ + +let $all := [ { "ka":"a1", "kb":"b1"}, + { "ka":"a1", "kb":"b2"}] +return $all[3]; + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.adm new file mode 100644 index 0000000..1652c38 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2-open/query-ASTERIXDB-1212-2-open.1.adm @@ -0,0 +1,2 @@ +{ "g": "b1" } +{ "g": "b2" } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.adm new file mode 100644 index 0000000..1652c38 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-2/query-ASTERIXDB-1212-2.1.adm @@ -0,0 +1,2 @@ +{ "g": "b1" } +{ "g": "b2" } diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.adm new file mode 100644 index 0000000..19765bd --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212-open/query-ASTERIXDB-1212-open.1.adm @@ -0,0 +1 @@ +null diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.adm new file mode 100644 index 0000000..19765bd --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/list/query-ASTERIXDB-1212/query-ASTERIXDB-1212.1.adm @@ -0,0 +1 @@ +null diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml index adbf40f..3d12573 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml @@ -3039,6 +3039,26 @@ <output-dir compare="Text">query-ASTERIXDB-1131-2</output-dir> </compilation-unit> </test-case> + <test-case FilePath="list"> + <compilation-unit name="query-ASTERIXDB-1212"> + <output-dir compare="Text">query-ASTERIXDB-1212</output-dir> + </compilation-unit> + </test-case> + <test-case FilePath="list"> + <compilation-unit name="query-ASTERIXDB-1212-open"> + <output-dir compare="Text">query-ASTERIXDB-1212-open</output-dir> + </compilation-unit> + </test-case> + <test-case FilePath="list"> + <compilation-unit name="query-ASTERIXDB-1212-2"> + <output-dir compare="Text">query-ASTERIXDB-1212-2</output-dir> + </compilation-unit> + </test-case> + <test-case FilePath="list"> + <compilation-unit name="query-ASTERIXDB-1212-2-open"> + <output-dir compare="Text">query-ASTERIXDB-1212-2-open</output-dir> + </compilation-unit> + </test-case> </test-group> <test-group name="meta"> <test-case FilePath="meta"> diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ANullableFieldPrinterFactory.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ANullableFieldPrinterFactory.java index 784bd0b..2f90498 100644 --- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ANullableFieldPrinterFactory.java +++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ANullableFieldPrinterFactory.java @@ -55,7 +55,7 @@ @Override public void print(byte[] b, int s, int l, PrintStream ps) throws HyracksDataException { fieldPrinter.init(); - if (b[s] == ATypeTag.SERIALIZED_NULL_TYPE_TAG) { + if (b[s] == ATypeTag.SERIALIZED_NULL_TYPE_TAG || b[s] == ATypeTag.SERIALIZED_MISSING_TYPE_TAG) { nullPrinter.print(b, s, l, ps); } else { fieldPrinter.print(b, s, l, ps); -- To view, visit https://asterix-gerrit.ics.uci.edu/908 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b5fc5c09dfffa11ff8debb69e85ead894b4a597 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Yingyi Bu <[email protected]>
