This is an automated email from the ASF dual-hosted git repository. alsuliman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/asterixdb.git
commit b36d637df6b901a2843fcae3fa15e0128918d88f Author: Ritik Raj <[email protected]> AuthorDate: Thu Sep 5 20:07:29 2024 +0530 [ASTERIXDB-3499][STO] Updating range filter while compacting columns - user model changes: no - storage format changes: no - interface changes: no - Added missing filterWriter for BooleanColumnValuesWriter Ext-ref: MB-63415 Change-Id: I1fd5620869c12f957457b154207aba7c7adee9bc Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18790 Reviewed-by: Murtadha Hubail <[email protected]> Tested-by: Murtadha Hubail <[email protected]> --- .../ASTERIXDB-3499/ASTERIXDB-3499.001.ddl.sqlpp | 30 ++++++++++++++++++++ .../ASTERIXDB-3499/ASTERIXDB-3499.002.update.sqlpp | 33 ++++++++++++++++++++++ .../ASTERIXDB-3499/ASTERIXDB-3499.003.update.sqlpp | 33 ++++++++++++++++++++++ .../ASTERIXDB-3499/ASTERIXDB-3499.004.ddl.sqlpp | 23 +++++++++++++++ .../ASTERIXDB-3499/ASTERIXDB-3499.005.query.sqlpp | 25 ++++++++++++++++ .../filter/ASTERIXDB-3499/ASTERIXDB-3499.005.adm | 2 ++ .../src/test/resources/runtimets/sqlpp_queries.xml | 5 ++++ .../values/writer/BooleanColumnValuesWriter.java | 1 + 8 files changed, 152 insertions(+) diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.001.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.001.ddl.sqlpp new file mode 100644 index 0000000000..f215b9fe73 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.001.ddl.sqlpp @@ -0,0 +1,30 @@ +/* + * 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. + */ + +DROP DATAVERSE test IF EXISTS; +CREATE DATAVERSE test; + +USE test; + +CREATE collection sample_collection PRIMARY KEY (primary_key_id: string) +WITH { + "storage-format": { + "format": "column" + } +}; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.002.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.002.update.sqlpp new file mode 100644 index 0000000000..5a2e922dc0 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.002.update.sqlpp @@ -0,0 +1,33 @@ +/* + * 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. + */ + +USE test; +insert into sample_collection ( +[ + { + "primary_key_id": "1", + "int_field1": 69114320, + "decimal_field1": 9610, + "datetime_field1": "2005-11-08 00:00:00", + "bool_field1": False, + "varchar_field1": "BPBlasoTZq", + "char_field1": "C" + } +] +); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.003.update.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.003.update.sqlpp new file mode 100644 index 0000000000..04490d21fd --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.003.update.sqlpp @@ -0,0 +1,33 @@ +/* + * 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. + */ + +USE test; +insert into sample_collection ( +[ + { + "primary_key_id": "189", + "int_field1": 89463144, + "decimal_field1": 3490, + "datetime_field1": "2012-12-19 00:00:00", + "bool_field1": False, + "varchar_field1": "nfQdaGVYjH", + "char_field1": "C" + } +] +); \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.004.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.004.ddl.sqlpp new file mode 100644 index 0000000000..3ad191a99a --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.004.ddl.sqlpp @@ -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. + */ + + +USE test; + +compact collection sample_collection; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.005.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.005.query.sqlpp new file mode 100644 index 0000000000..ffb466ae6d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.005.query.sqlpp @@ -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. + */ + + +USE test; + +select int_field1 +from sample_collection +where bool_field1 = false; \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.005.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.005.adm new file mode 100644 index 0000000000..ac56dc7ecc --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/column/filter/ASTERIXDB-3499/ASTERIXDB-3499.005.adm @@ -0,0 +1,2 @@ +{ "int_field1": 69114320 } +{ "int_field1": 89463144 } \ No newline at end of file diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml index 235582ef9e..6abfddc6d2 100644 --- a/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml +++ b/asterixdb/asterix-app/src/test/resources/runtimets/sqlpp_queries.xml @@ -16328,6 +16328,11 @@ <output-dir compare="Text">assembly/ASTERIXDB-3491-7</output-dir> </compilation-unit> </test-case> + <test-case FilePath="column"> + <compilation-unit name="filter/ASTERIXDB-3499"> + <output-dir compare="Text">filter/ASTERIXDB-3499</output-dir> + </compilation-unit> + </test-case> <test-case FilePath="column"> <compilation-unit name="delete/001"> <output-dir compare="Text">delete/001</output-dir> diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/BooleanColumnValuesWriter.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/BooleanColumnValuesWriter.java index 4bd6e2711f..7d50cb16e1 100644 --- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/BooleanColumnValuesWriter.java +++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/BooleanColumnValuesWriter.java @@ -72,6 +72,7 @@ public final class BooleanColumnValuesWriter extends AbstractColumnValuesWriter protected void addValue(IColumnValuesReader reader) throws IOException { int value = reader.getBoolean() ? 1 : 0; booleanWriter.writeInt(value); + filterWriter.addLong(value); } @Override
