Merge branch 'salsubaiee/asterix_lsm_stabilization_fix_spatial_issues' into asterix_lsm_stabilization
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.1.ddl.aql
new file mode 100644
index 0000000..efde712
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.1.ddl.aql
@@ -0,0 +1,10 @@
+/*
+ * Description : create a rectangle constructor
+ * Expected Res : Success
+ * Date : 18 April 2013
+ * Issue : 272
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.2.update.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.2.update.aql
new file mode 100644
index 0000000..f7e538e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.2.update.aql
@@ -0,0 +1,7 @@
+/*
+ * Description : create a rectangle constructor
+ * Expected Res : Success
+ * Date : 18 April 2013
+ * Issue : 272
+ */
+
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.3.query.aql b/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.3.query.aql
new file mode 100644
index 0000000..696746f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/constructor/rectangle_01/rectangle_01.3.query.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : create a rectangle constructor
+ * Expected Res : Success
+ * Date : 18 April 2013
+ * Issue : 272
+ */
+
+use dataverse test;
+
+let $r1 := rectangle("5.1,11.8 87.6,15.6548")
+let $r2 := rectangle("0.1234,-1.00e-10 5.5487,0.48765")
+return {"rectangle1": $r1,"rectangle2": $r2}
diff --git a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
index d8ab247..381ad3f 100644
--- a/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/failure/delete-rtree/delete-rtree.1.ddl.aql
@@ -14,4 +14,6 @@
create dataset MyData(MyRecord)
primary key id;
+
+create index rtree_index_loc on MyData(loc) type rtree;
diff --git a/asterix-app/src/test/resources/runtimets/results/constructor/rectangle_01/rectangle_01.1.adm b/asterix-app/src/test/resources/runtimets/results/constructor/rectangle_01/rectangle_01.1.adm
new file mode 100644
index 0000000..32f14b3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/constructor/rectangle_01/rectangle_01.1.adm
@@ -0,0 +1 @@
+{ "rectangle1": rectangle("5.1,11.8 87.6,15.6548"), "rectangle2": rectangle("0.1234,-1.0E-10 5.5487,0.48765") }
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.1.adm b/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.1.adm
index e95bac0..25859de 100644
--- a/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.1.adm
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation-with-filtering/cell-aggregation-with-filtering.1.adm
@@ -1,2 +1,2 @@
-{ "cell": rectangle("33.5,-101.5 | 36.5,-98.5"), "count": 1 }
-{ "cell": rectangle("33.5,-98.5 | 36.5,-95.5"), "count": 2 }
\ No newline at end of file
+{ "cell": rectangle("33.5,-101.5 36.5,-98.5"), "count": 1 }
+{ "cell": rectangle("33.5,-98.5 36.5,-95.5"), "count": 2 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation/cell-aggregation.1.adm b/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation/cell-aggregation.1.adm
index 137ed1c..0014d49 100644
--- a/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation/cell-aggregation.1.adm
+++ b/asterix-app/src/test/resources/runtimets/results/spatial/cell-aggregation/cell-aggregation.1.adm
@@ -1,3 +1,3 @@
-{ "cell": rectangle("5.0,5.0 | 10.0,10.0"), "count": 1 }
-{ "cell": rectangle("5.0,0.0 | 10.0,5.0"), "count": 3 }
-{ "cell": rectangle("0.0,0.0 | 5.0,5.0"), "count": 12 }
\ No newline at end of file
+{ "cell": rectangle("5.0,5.0 10.0,10.0"), "count": 1 }
+{ "cell": rectangle("5.0,0.0 10.0,5.0"), "count": 3 }
+{ "cell": rectangle("0.0,0.0 5.0,5.0"), "count": 12 }
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 700f06f..17ec2bb 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -551,6 +551,11 @@
</compilation-unit>
</test-case>
<test-case FilePath="constructor">
+ <compilation-unit name="rectangle_01">
+ <output-dir compare="Text">rectangle_01</output-dir>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="constructor">
<compilation-unit name="point_01">
<output-dir compare="Text">point_01</output-dir>
</compilation-unit>
@@ -4213,5 +4218,4 @@
</compilation-unit>
</test-case>
</test-group>
-</test-suite>
-
+</test-suite>
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java
index 0618f28..f83118b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/ARectanglePrinter.java
@@ -17,9 +17,14 @@
@Override
public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
- ps.print("rectangle(\"" + ADoubleSerializerDeserializer.getDouble(b, s + 1) + ",");
+ ps.print("rectangle(\"");
+ ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+ ps.print(",");
ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
- ps.print(" | " + ADoubleSerializerDeserializer.getDouble(b, s + 17) + ",");
- ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25) + "\")");
+ ps.print(" ");
+ ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+ ps.print(",");
+ ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
+ ps.print("\")");
}
}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
index b5b7303..2e4f72c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
@@ -23,6 +23,7 @@
import edu.uci.ics.asterix.om.base.APoint3D;
import edu.uci.ics.asterix.om.base.APolygon;
import edu.uci.ics.asterix.om.base.ARecord;
+import edu.uci.ics.asterix.om.base.ARectangle;
import edu.uci.ics.asterix.om.base.AString;
import edu.uci.ics.asterix.om.base.ATime;
import edu.uci.ics.asterix.om.base.AUnorderedList;
@@ -97,6 +98,9 @@
case LINE: {
return ALineSerializerDeserializer.INSTANCE.deserialize(in);
}
+ case RECTANGLE: {
+ return ARectangleSerializerDeserializer.INSTANCE.deserialize(in);
+ }
case POLYGON: {
return APolygonSerializerDeserializer.INSTANCE.deserialize(in);
}
@@ -199,6 +203,10 @@
ALineSerializerDeserializer.INSTANCE.serialize((ALine) instance, out);
break;
}
+ case RECTANGLE: {
+ ARectangleSerializerDeserializer.INSTANCE.serialize((ARectangle) instance, out);
+ break;
+ }
case POLYGON: {
APolygonSerializerDeserializer.INSTANCE.serialize((APolygon) instance, out);
break;