Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ class ConfigurableIndexesTest extends Specification with TestWithFeatureType {
foreach(z3Tables)(t => ds.client.tableOperations().exists(t) must beTrue)
}

"support attribute level configuration" >> {
val typeName = this.sft.getTypeName + "_attr"
ds.createSchema(SimpleFeatureTypes.createType(typeName, "name:String,dtg:Date,*geom:Point:srid=4326:index=z3;id.index.enabled=false"))
val sft = ds.getSchema(typeName)
val indices = ds.manager.indices(sft)
indices must haveLength(1)
indices.head.name mustEqual Z3Index.name
val z3Tables = indices.head.getTableNames()
z3Tables must not(beEmpty)
foreach(z3Tables)(t => ds.client.tableOperations().exists(t) must beTrue)
}

"be able to use z3 for spatial queries" >> {
val filter = "BBOX(geom,40,50,50,60)"
val query = new Query(sftName, ECQL.toFilter(filter))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.junit.runner.RunWith
import org.locationtech.geomesa.accumulo.TestWithFeatureType
import org.locationtech.geomesa.features.ScalaSimpleFeature
import org.locationtech.geomesa.index.conf.QueryHints.{BIN_BATCH_SIZE, BIN_LABEL, BIN_SORT, BIN_TRACK, SAMPLE_BY, SAMPLING}
import org.locationtech.geomesa.index.index.s2.S2Index
import org.locationtech.geomesa.utils.bin.BinaryOutputEncoder
import org.locationtech.geomesa.utils.bin.BinaryOutputEncoder.BIN_ATTRIBUTE_INDEX
import org.locationtech.geomesa.utils.collection.CloseableIterator
Expand All @@ -26,7 +27,7 @@ import java.util.Date
@RunWith(classOf[JUnitRunner])
class S2IndexTest extends TestWithFeatureType {

override val spec = "name:String,track:String,dtg:Date,*geom:Point:srid=4326;geomesa.indices.enabled=s2:geom"
override val spec = "name:String,track:String,dtg:Date,*geom:Point:srid=4326:index=s2;id.index.enabled=false"

val features =
(0 until 10).map { i =>
Expand All @@ -53,6 +54,12 @@ class S2IndexTest extends TestWithFeatureType {
}

"S2Index" should {
"only create the s2 index" >> {
val indices = ds.manager.indices(sft)
indices must haveLength(1)
indices.head.name mustEqual S2Index.name
}

"return all features for inclusive filter" >> {
val filter = "bbox(geom, 35, 55, 45, 75)" +
" AND dtg between '2010-05-07T00:00:00.000Z' and '2010-05-08T00:00:00.000Z'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.locationtech.geomesa.accumulo.TestWithFeatureType
import org.locationtech.geomesa.features.ScalaSimpleFeature
import org.locationtech.geomesa.index.conf.QueryHints.{BIN_BATCH_SIZE, BIN_LABEL, BIN_SORT, BIN_TRACK, SAMPLE_BY, SAMPLING}
import org.locationtech.geomesa.index.conf.QueryProperties
import org.locationtech.geomesa.index.index.s3.S3Index
import org.locationtech.geomesa.utils.bin.BinaryOutputEncoder
import org.locationtech.geomesa.utils.bin.BinaryOutputEncoder.BIN_ATTRIBUTE_INDEX
import org.locationtech.geomesa.utils.collection.CloseableIterator
Expand All @@ -26,7 +27,7 @@ import java.util.Date
@RunWith(classOf[JUnitRunner])
class S3IndexTest extends TestWithFeatureType {

override val spec = "name:String,track:String,dtg:Date,*geom:Point:srid=4326;geomesa.indices.enabled=s3:geom:dtg"
override val spec = "name:String,track:String,dtg:Date,*geom:Point:srid=4326:index=s3;id.index.enabled=false"

val features =
(0 until 10).map { i =>
Expand All @@ -48,6 +49,12 @@ class S3IndexTest extends TestWithFeatureType {
execute(new Query(sft.getTypeName, ECQL.toFilter(ecql), transforms.orNull: _*))

"S3Index" should {
"only create the s3 index" >> {
val indices = ds.manager.indices(sft)
indices must haveLength(1)
indices.head.name mustEqual S3Index.name
}

"return all features for inclusive filter" >> {
val filter = "bbox(geom, 38, 59, 51, 61)" +
" AND dtg between '2010-05-07T00:00:00.000Z' and '2010-05-08T00:00:00.000Z'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class GeoMesaDataStoreTest extends Specification {
}
"block queries which would cause a full table scan" in {
val sft = SimpleFeatureTypes.createType("61b44359ddb84822983587389d6a28a4",
"name:String,age:Int,dtg:Date,*geom:Point:srid=4326;geomesa.indices.enabled='id,z3,attr:name'")
"name:String:index=true,age:Int,dtg:Date,*geom:Point:srid=4326:index=z3")
sft.getUserData.put("geomesa.query.interceptors",
"org.locationtech.geomesa.index.planning.guard.FullTableScanQueryGuard")

Expand Down Expand Up @@ -165,7 +165,7 @@ class GeoMesaDataStoreTest extends Specification {
}
"block queries which would cause a full table scan via sys props" in {
val sft = SimpleFeatureTypes.createType("test",
"name:String,age:Int,dtg:Date,*geom:Point:srid=4326;geomesa.indices.enabled='id,z3,attr:name'")
"name:String:index=true,age:Int,dtg:Date,*geom:Point:srid=4326:index=z3")

val ds = new TestGeoMesaDataStore(true)
ds.createSchema(sft)
Expand Down
Loading
Loading