You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Steven Jacobs (Code Review)" <do...@asterixdb.incubator.apache.org> on 2017/03/08 00:07:06 UTC

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point spatial in...

Steven Jacobs has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/1558

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point spatial intersect
......................................................................

ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point spatial intersect

Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
---
M asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
12 files changed, 190 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/58/1558/1

diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
index e549a92..07daddb 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
@@ -12,6 +12,7 @@
  ! 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.
@@ -28,6 +29,11 @@
     </compilation-unit>
   </test-case>
   <test-case FilePath="comparison">
+    <compilation-unit name="circle-point">
+      <output-dir compare="Text">circle-point</output-dir>
+    </compilation-unit>
+  </test-case>
+  <test-case FilePath="comparison">
     <compilation-unit name="datetime_range">
       <output-dir compare="Text">datetime_range</output-dir>
     </compilation-unit>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
new file mode 100644
index 0000000..05747bb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
@@ -0,0 +1,44 @@
+/*
+ * 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 channels if exists;
+create dataverse channels;
+use dataverse channels;
+
+create type UserLocation as closed {
+  recordId: uuid,
+  location: point,
+  user-id: string,
+  timeoffset: float
+}
+
+create type EmergencyReport as closed {
+  reportId: uuid,
+  severity: int,
+  impactZone: circle,
+  timeoffset: float,
+  duration: float,
+  message: string,
+  emergencyType: string
+}
+
+create dataset UserLocations(UserLocation)
+primary key recordId autogenerated;
+
+create dataset EmergencyReports(EmergencyReport)
+primary key reportId autogenerated;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
new file mode 100644
index 0000000..832940d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
@@ -0,0 +1,28 @@
+/*
+ * 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 channels;
+
+insert into dataset EmergencyReports(
+[{"severity": 1, "impactZone": circle("2500.23697136,1633.68172386 1000.0"), "timeoffset": 544.7287792315149, "duration": 900.0, "message": "earthquake alert!", "emergencyType": "earthquake"},
+{"severity": 1, "impactZone": circle("2501.23697136,1633.68172386 1000.0"), "timeoffset": 552.2465166866674, "duration": 900.0, "message": "earthquake alert!", "emergencyType": "earthquake"}]
+);
+
+insert into dataset UserLocations(
+{"location":point("2500.23697136,1633.68172386"),"user-id":"t124","timeoffset":60.0}
+);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql
new file mode 100644
index 0000000..d289d7a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.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 channels;
+
+count(for $report in dataset EmergencyReports
+for $location in dataset UserLocations
+where spatial-intersect($report.impactZone, $location.location)
+return {
+  "user at":$location.location,
+  "report at":$report.impactZone
+});
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql
new file mode 100644
index 0000000..fc1f55b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.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 channels;
+
+count(for $report in dataset EmergencyReports
+for $location in dataset UserLocations
+where spatial-intersect($location.location,$report.impactZone )
+return {
+  "user at":$location.location,
+  "report at":$report.impactZone
+});
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
new file mode 100644
index 0000000..baca958
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
@@ -0,0 +1,28 @@
+/*
+ * 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 channels;
+
+count(for $report in dataset EmergencyReports
+for $location in dataset UserLocations
+let $circle := create-circle($location.location,.1)
+where spatial-intersect($circle,$report.impactZone)
+return {
+  "user at":$location.location,
+  "report at":$report.impactZone
+});
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql
new file mode 100644
index 0000000..a48e09f
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.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.
+ */
+use dataverse channels;
+
+let $check1 := spatial-intersect(circle("3107.06794511,1079.71664882 1000.0"),point("3513.27543563,978.772476107")) 
+
+let $check2 := spatial-intersect(point("3513.27543563,978.772476107"),circle("3107.06794511,1079.71664882 1000.0")) 
+
+return [ $check1, $check2 ]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
new file mode 100644
index 0000000..8a1d020
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
@@ -0,0 +1 @@
+[ true, true ]
\ No newline at end of file
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
index 98b0f91..6edbf6f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
@@ -997,7 +997,7 @@
                             case CIRCLE:
                                 switch (tag1) {
                                     case POINT:
-                                        res = pointInCircle(bytes0, offset0, bytes1, offset1);
+                                        res = pointInCircle(bytes1, offset1, bytes0, offset0);
                                         break;
                                     case LINE:
                                         res = lineCircleIntersection(bytes1, offset1, bytes0, offset0);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 3:

Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/2117/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 3:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/4584/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 3:

Integration Tests Successful

https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/2117/ : SUCCESS

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Ildar Absalyamov <il...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 3: BAD+1

BAD Compatibility Tests Successful

https://asterix-jenkins.ics.uci.edu/job/asterixbad-compat/737/ : SUCCESS

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Ildar Absalyamov <il...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 2:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/4582/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Steven Jacobs (Code Review)" <do...@asterixdb.incubator.apache.org>.
Steven Jacobs has submitted this change and it was merged.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function

Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1558
Sonar-Qube: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>
BAD: Jenkins <je...@fulliautomatix.ics.uci.edu>
Reviewed-by: Jianfeng Jia <ji...@gmail.com>
---
M asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
12 files changed, 189 insertions(+), 1 deletion(-)

Approvals:
  Jianfeng Jia: Looks good to me, approved
  Jenkins: Verified; No violations found; No violations found



diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
index e549a92..58fd49d 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
@@ -28,6 +28,11 @@
     </compilation-unit>
   </test-case>
   <test-case FilePath="comparison">
+    <compilation-unit name="circle-point">
+      <output-dir compare="Text">circle-point</output-dir>
+    </compilation-unit>
+  </test-case>
+  <test-case FilePath="comparison">
     <compilation-unit name="datetime_range">
       <output-dir compare="Text">datetime_range</output-dir>
     </compilation-unit>
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
new file mode 100644
index 0000000..05747bb
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
@@ -0,0 +1,44 @@
+/*
+ * 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 channels if exists;
+create dataverse channels;
+use dataverse channels;
+
+create type UserLocation as closed {
+  recordId: uuid,
+  location: point,
+  user-id: string,
+  timeoffset: float
+}
+
+create type EmergencyReport as closed {
+  reportId: uuid,
+  severity: int,
+  impactZone: circle,
+  timeoffset: float,
+  duration: float,
+  message: string,
+  emergencyType: string
+}
+
+create dataset UserLocations(UserLocation)
+primary key recordId autogenerated;
+
+create dataset EmergencyReports(EmergencyReport)
+primary key reportId autogenerated;
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
new file mode 100644
index 0000000..832940d
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
@@ -0,0 +1,28 @@
+/*
+ * 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 channels;
+
+insert into dataset EmergencyReports(
+[{"severity": 1, "impactZone": circle("2500.23697136,1633.68172386 1000.0"), "timeoffset": 544.7287792315149, "duration": 900.0, "message": "earthquake alert!", "emergencyType": "earthquake"},
+{"severity": 1, "impactZone": circle("2501.23697136,1633.68172386 1000.0"), "timeoffset": 552.2465166866674, "duration": 900.0, "message": "earthquake alert!", "emergencyType": "earthquake"}]
+);
+
+insert into dataset UserLocations(
+{"location":point("2500.23697136,1633.68172386"),"user-id":"t124","timeoffset":60.0}
+);
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql
new file mode 100644
index 0000000..d289d7a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.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 channels;
+
+count(for $report in dataset EmergencyReports
+for $location in dataset UserLocations
+where spatial-intersect($report.impactZone, $location.location)
+return {
+  "user at":$location.location,
+  "report at":$report.impactZone
+});
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql
new file mode 100644
index 0000000..fc1f55b
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.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 channels;
+
+count(for $report in dataset EmergencyReports
+for $location in dataset UserLocations
+where spatial-intersect($location.location,$report.impactZone )
+return {
+  "user at":$location.location,
+  "report at":$report.impactZone
+});
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
new file mode 100644
index 0000000..baca958
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
@@ -0,0 +1,28 @@
+/*
+ * 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 channels;
+
+count(for $report in dataset EmergencyReports
+for $location in dataset UserLocations
+let $circle := create-circle($location.location,.1)
+where spatial-intersect($circle,$report.impactZone)
+return {
+  "user at":$location.location,
+  "report at":$report.impactZone
+});
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql
new file mode 100644
index 0000000..47fc080
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.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.
+ */
+use dataverse channels;
+
+let $check1 := spatial-intersect(circle("3107.06794511,1079.71664882 1000.0"),point("3513.27543563,978.772476107"))
+
+let $check2 := spatial-intersect(point("3513.27543563,978.772476107"),circle("3107.06794511,1079.71664882 1000.0"))
+
+return [ $check1, $check2 ]
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
new file mode 100644
index 0000000..d8263ee
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
@@ -0,0 +1 @@
+2
\ No newline at end of file
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
new file mode 100644
index 0000000..8a1d020
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
@@ -0,0 +1 @@
+[ true, true ]
\ No newline at end of file
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
index 98b0f91..6edbf6f 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
@@ -997,7 +997,7 @@
                             case CIRCLE:
                                 switch (tag1) {
                                     case POINT:
-                                        res = pointInCircle(bytes0, offset0, bytes1, offset1);
+                                        res = pointInCircle(bytes1, offset1, bytes0, offset0);
                                         break;
                                     case LINE:
                                         res = lineCircleIntersection(bytes1, offset1, bytes0, offset0);

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 4
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Ildar Absalyamov <il...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-Reviewer: Steven Jacobs <sj...@ucr.edu>

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point spatial in...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point spatial intersect
......................................................................


Patch Set 1:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/4579/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 3:

BAD Compatibility Tests Started https://asterix-jenkins.ics.uci.edu/job/asterixbad-compat/737/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 2:

Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/4581/

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Jianfeng Jia (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jianfeng Jia has posted comments on this change.

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................


Patch Set 3: Code-Review+2

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 3
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Ildar Absalyamov <il...@gmail.com>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Jianfeng Jia <ji...@gmail.com>
Gerrit-HasComments: No

Change in asterixdb[master]: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect ...

Posted by "Steven Jacobs (Code Review)" <do...@asterixdb.incubator.apache.org>.
Steven Jacobs has uploaded a new patch set (#2).

Change subject: ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function
......................................................................

ASTERIXDB-1327, ASTERIXDB-1362 Fixed circle-point intersect function

Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
---
M asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/ComparisonQueries.xml
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.1.ddl.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.2.update.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.3.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.4.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.5.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/queries/comparison/circle-point/circle-point.6.query.aql
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.1.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.2.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.3.adm
A asterixdb/asterix-app/src/test/resources/runtimets/results/comparison/circle-point/circle-point.4.adm
M asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/SpatialIntersectDescriptor.java
12 files changed, 189 insertions(+), 1 deletion(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/58/1558/2
-- 
To view, visit https://asterix-gerrit.ics.uci.edu/1558
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I2512c73c9dcd593dc7e6690435da67f8086ff0db
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Steven Jacobs <sj...@ucr.edu>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>