Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 42F90200C72 for ; Fri, 12 May 2017 22:04:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 41790160BB8; Fri, 12 May 2017 20:04:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5ECA7160BA8 for ; Fri, 12 May 2017 22:04:39 +0200 (CEST) Received: (qmail 82542 invoked by uid 500); 12 May 2017 20:04:38 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 82533 invoked by uid 99); 12 May 2017 20:04:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 May 2017 20:04:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 35184C0145 for ; Fri, 12 May 2017 20:04:38 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.92 X-Spam-Level: X-Spam-Status: No, score=0.92 tagged_above=-999 required=6.31 tests=[SPF_FAIL=0.919, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 8L3_c4q2yk8E for ; Fri, 12 May 2017 20:04:36 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 766D25FB40 for ; Fri, 12 May 2017 20:04:35 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id DE094242159; Fri, 12 May 2017 13:04:34 -0700 (PDT) Date: Fri, 12 May 2017 13:04:34 -0700 From: "Ian Maxon (Code Review)" Message-ID: Reply-To: imaxon@apache.org X-Gerrit-MessageType: newchange Subject: Change in asterixdb[master]: ASTERIXDB-1905: Incorrect filter for post-load sidx X-Gerrit-Change-Id: Iea158ad4c29ad4421020a28a72e68637bc538560 X-Gerrit-ChangeURL: X-Gerrit-Commit: 194461768c5e7512a92f0485a677e3453bbc3d46 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 To: undisclosed-recipients:; archived-at: Fri, 12 May 2017 20:04:40 -0000 Ian Maxon has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/1743 Change subject: ASTERIXDB-1905: Incorrect filter for post-load sidx ...................................................................... ASTERIXDB-1905: Incorrect filter for post-load sidx The issue seems to be limited to RTrees. The MBR evaluators were not accounting for the point MBR optimization as they were in the compiled load pidx+sidx case Change-Id: Iea158ad4c29ad4421020a28a72e68637bc538560 --- A asterixdb/asterix-app/src/test/resources/runtimets/queries/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.aql A asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.sqlpp A asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-rtree/load-with-secondary-rtree.2.adm M asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java M asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/base/IDataFormat.java M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/formats/NonTaggedDataFormat.java 6 files changed, 58 insertions(+), 4 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/43/1743/1 diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.aql new file mode 100644 index 0000000..0a02b14 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.aql @@ -0,0 +1,27 @@ +/* + * 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 dataverse test; + +for $m in dataset('FacebookMessages') +where spatial-intersect($m.sender-location, create-polygon([40.0,79.87,30.0,75.0,50.0,80.0,10.0,10.0])) +and $m.send-time > datetime("2012-11-20T10:10:00.000Z") +order by $m.send-time +return $m + + diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.sqlpp new file mode 100644 index 0000000..c082af4 --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/filters/load-with-secondary-rtree/load-with-secondary-rtree.6.query.sqlpp @@ -0,0 +1,26 @@ +/* + * 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 element m +from FacebookMessages as m +where (test.`spatial-intersect`(m.`sender-location`,test.`create-polygon`([40.0,79.87,30.0,75.0,50.0,80.0,10.0,10.0])) and (m.`send-time` > test.datetime('2012-11-20T10:10:00.000Z'))) +order by m.`send-time` +; diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-rtree/load-with-secondary-rtree.2.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-rtree/load-with-secondary-rtree.2.adm new file mode 100644 index 0000000..f87754d --- /dev/null +++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/filters/load-with-secondary-rtree/load-with-secondary-rtree.2.adm @@ -0,0 +1 @@ +{ "message-id": 12, "author-id": 10, "in-response-to": 6, "sender-location": point("42.26,77.76"), "message": " can't stand t-mobile its voicemail-service is OMG:(", "send-time": datetime("2012-12-20T10:10:00.000Z") } \ No newline at end of file diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java index 352bc6a..7f2572d 100644 --- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java +++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/utils/SecondaryRTreeOperationsHelper.java @@ -176,7 +176,7 @@ int recordColumn = dataset.getDatasetType() == DatasetType.INTERNAL ? numPrimaryKeys : 0; secondaryFieldAccessEvalFactories = metadataProvider.getFormat().createMBRFactory(isEnforcingKeyTypes ? enforcedItemType : itemType, - secondaryKeyFields.get(0), recordColumn, numDimensions, filterFieldName); + secondaryKeyFields.get(0), recordColumn, numDimensions, filterFieldName, isPointMBR); secondaryComparatorFactories = new IBinaryComparatorFactory[numNestedSecondaryKeyFields]; valueProviderFactories = new IPrimitiveValueProviderFactory[numNestedSecondaryKeyFields]; ISerializerDeserializer[] secondaryRecFields = diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/base/IDataFormat.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/base/IDataFormat.java index 3c31f00..53c24cf 100644 --- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/base/IDataFormat.java +++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/formats/base/IDataFormat.java @@ -82,7 +82,7 @@ public IScalarEvaluatorFactory getConstantEvalFactory(IAlgebricksConstantValue value) throws AlgebricksException; public IScalarEvaluatorFactory[] createMBRFactory(ARecordType recType, List fldName, int recordColumn, - int dimension, List filterFieldName) throws AlgebricksException; + int dimension, List filterFieldName, boolean isPointMBR) throws AlgebricksException; public IExpressionEvalSizeComputer getExpressionEvalSizeComputer(); diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/formats/NonTaggedDataFormat.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/formats/NonTaggedDataFormat.java index 01aff1a..8991989 100644 --- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/formats/NonTaggedDataFormat.java +++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/formats/NonTaggedDataFormat.java @@ -242,9 +242,9 @@ @SuppressWarnings("unchecked") @Override public IScalarEvaluatorFactory[] createMBRFactory(ARecordType recType, List fldName, int recordColumn, - int dimension, List filterFieldName) throws AlgebricksException { + int dimension, List filterFieldName, boolean isPointMBR) throws AlgebricksException { IScalarEvaluatorFactory evalFactory = getFieldAccessEvaluatorFactory(recType, fldName, recordColumn); - int numOfFields = dimension * 2; + int numOfFields = isPointMBR ? dimension : dimension * 2; IScalarEvaluatorFactory[] evalFactories = new IScalarEvaluatorFactory[numOfFields + (filterFieldName == null ? 0 : 1)]; -- To view, visit https://asterix-gerrit.ics.uci.edu/1743 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea158ad4c29ad4421020a28a72e68637bc538560 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Ian Maxon