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
7 changes: 7 additions & 0 deletions docs/user/upgrade/6.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ Kafka Zookeeper Deprecation
As Kafka 4+ no longer supports Zookeeper, GeoMesa has deprecated support for using Zookeeper with the Kafka data store. See
:ref:`no_zookeeper` for details on migrating.

Default Secondary Attribute Index Changes
-----------------------------------------

When creating attribute indices, the default secondary index will now be a date-only index, instead of a spatio-temporal index
(e.g. ``attr:foo:dtg`` instead of ``attr:foo:geom:dtg``). The old behavior can still be achieved by configuring secondary
attributes - see :ref:`specifying_indices` for details.

Dependency Version Upgrades
---------------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class AccumuloDataStoreAtomicWriteTest extends Specification with TestWithMultip
ConditionalWriteStatus("id", "insert", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("z2:geom", "insert", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("z3:geom:dtg", "insert", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("attr:name:geom:dtg", "insert", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("attr:name:dtg", "insert", ConditionalWriter.Status.REJECTED),
)
)
}
Expand Down Expand Up @@ -160,7 +160,7 @@ class AccumuloDataStoreAtomicWriteTest extends Specification with TestWithMultip
ConditionalWriteStatus("id", "update", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("z2:geom", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("z3:geom:dtg", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("attr:name:geom:dtg", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("attr:name:dtg", "delete", ConditionalWriter.Status.REJECTED),
)
)
}
Expand Down Expand Up @@ -198,7 +198,7 @@ class AccumuloDataStoreAtomicWriteTest extends Specification with TestWithMultip
ConditionalWriteStatus("id", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("z2:geom", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("z3:geom:dtg", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("attr:name:geom:dtg", "delete", ConditionalWriter.Status.REJECTED),
ConditionalWriteStatus("attr:name:dtg", "delete", ConditionalWriter.Status.REJECTED),
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.locationtech.geomesa.index.utils.{ExplainNull, Explainer}
import org.locationtech.geomesa.index.view.MergedDataStoreViewFactory
import org.locationtech.geomesa.utils.bin.BinaryOutputEncoder
import org.locationtech.geomesa.utils.collection.CloseableIterator
import org.locationtech.geomesa.utils.geotools.{CRS_EPSG_4326, FeatureUtils, SimpleFeatureTypes}
import org.locationtech.geomesa.utils.geotools.{CRS_EPSG_4326, FeatureUtils, SchemaBuilder, SimpleFeatureTypes}
import org.locationtech.geomesa.utils.index.IndexMode
import org.locationtech.geomesa.utils.io.WithClose
import org.locationtech.geomesa.utils.text.WKTUtils
Expand All @@ -51,10 +51,22 @@ import scala.collection.JavaConverters._
@RunWith(classOf[JUnitRunner])
class AttributeIndexStrategyTest extends Specification with TestWithFeatureType with LazyLogging {

override val spec = "name:String:index=full,age:Integer:index=join,count:Long:index=join," +
"weight:Double:index=join,height:Float:index=join,admin:Boolean:index=join," +
"*geom:Point:srid=4326,dtg:Date,indexedDtg:Date:index=join,fingers:List[String]:index=join," +
"toes:List[Double]:index=join,track:String,geom2:Point:srid=4326;geomesa.indexes.enabled='attr,id'"
override val spec =
SchemaBuilder.builder()
.addString("name").withIndex("attr:geom:dtg")
.addInt("age").withIndex("join:geom:dtg")
.addLong("count").withIndex("join:geom:dtg")
.addDouble("weight").withIndex("join:geom:dtg")
.addFloat("height").withIndex("join:geom:dtg")
.addBoolean("admin").withIndex("join:geom:dtg")
.addPoint("geom", default = true).withIndex("none")
.addDate("dtg", default = true)
.addDate("indexedDtg").withIndex("join:geom:dtg")
.addList[String]("fingers").withIndex("join:geom:dtg")
.addList[Double]("toes").withIndex("join:geom:dtg")
.addString("track")
.addPoint("geom2").withIndex("none")
.spec

val aliceGeom = WKTUtils.read("POINT(45.0 49.0)")
val billGeom = WKTUtils.read("POINT(46.0 49.0)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ object AttributeIndex extends ConfiguredIndex {
}

private def defaultTiers(sft: SimpleFeatureType, primary: AttributeDescriptor): Seq[String] =
Seq(primary.getLocalName) ++ Seq(sft.getGeomField).filter(_ != null) ++ sft.getDtgField.filter(_ != primary.getLocalName)
Seq(primary.getLocalName) ++ sft.getDtgField.filter(_ != primary.getLocalName).orElse(Option(sft.getGeomField))

/**
* Checks if the given field is attribute indexed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
// creates a default attribute index on name and an implicit default z3 and z2 index on geom
ds.createSchema(SimpleFeatureTypes.createType("test1", "name:String:index=true,dtg:Date,*geom:Point:srid=4326"))
// creates an attribute index on name (with a secondary date index), and a z3 index on geom and dtg
ds.createSchema(SimpleFeatureTypes.createType("test2", "name:String:index='attr:dtg',dtg:Date,*geom:Point:srid=4326:index='z3:dtg'"))
ds.createSchema(SimpleFeatureTypes.createType("test2", "name:String:index='attr:geom:dtg',dtg:Date,*geom:Point:srid=4326:index='z3:dtg'"))
// creates an attribute index on name (with a secondary date index), and a z3 index on geom and dtg and disables the ID index
ds.createSchema(SimpleFeatureTypes.createType("test3", "name:String:index='attr:dtg',dtg:Date,*geom:Point:srid=4326:index='z3:dtg';id.index.enabled=false"))
getIndexConfig(ds.getSchema("test1")) mustEqual Seq("attr=name:geom:dtg", "id=", "z2=geom", "z3=geom:dtg")
getIndexConfig(ds.getSchema("test2")) mustEqual Seq("attr=name:dtg", "id=", "z3=geom:dtg")
getIndexConfig(ds.getSchema("test1")) mustEqual Seq("attr=name:dtg", "id=", "z2=geom", "z3=geom:dtg")
getIndexConfig(ds.getSchema("test2")) mustEqual Seq("attr=name:geom:dtg", "id=", "z3=geom:dtg")
getIndexConfig(ds.getSchema("test3")) mustEqual Seq("attr=name:dtg", "z3=geom:dtg")
}
}

"support configurable indices with SchemaBuilder" in {
val sft =
SchemaBuilder.builder()
.addString("name").withIndex("attr:dtg") // creates an attribute index on name, with a secondary date index
.addString("name").withIndex("attr:geom:dtg") // creates an attribute index on name, with a secondary date index
.addInt("age").withIndex() // creates an attribute index on age, with a default secondary index
.addDate("dtg") // not a primary index
.addPoint("geom", default = true).withIndices("z3:dtg", "z2") // creates a z3 index with dtg, and a z2 index
Expand All @@ -56,7 +56,7 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
.build("test1")
WithClose(new TestGeoMesaDataStore(true)) { ds =>
ds.createSchema(sft)
getIndexConfig(ds.getSchema("test1")) mustEqual Seq("attr=age:geom:dtg", "attr=name:dtg", "z2=geom", "z3=geom:dtg")
getIndexConfig(ds.getSchema("test1")) mustEqual Seq("attr=age:dtg", "attr=name:geom:dtg", "z2=geom", "z3=geom:dtg")
}
}

Expand All @@ -65,7 +65,7 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
s"""{
| type-name = test1
| attributes = [
| { name = "name", type = "String", index = "attr:dtg" } // creates an attribute index on name, with a secondary date index
| { name = "name", type = "String", index = "attr:geom:dtg" } // creates an attribute index on name, with a secondary date index
| { name = "age", type = "Int", index = "true" } // creates an attribute index on age, with a default secondary index
| { name = "dtg", type = "Date" } // not a primary index
| { name = "geom", type = "Point", srid = "4326", index = "z3:dtg,z2" } // creates a z3 index with dtg, and a z2 index
Expand All @@ -78,7 +78,7 @@ class ConfigurableIndicesTest extends Specification with LazyLogging {
val sft = SimpleFeatureTypes.createType(ConfigFactory.parseString(config), path = None)
WithClose(new TestGeoMesaDataStore(true)) { ds =>
ds.createSchema(sft)
getIndexConfig(ds.getSchema("test1")) mustEqual Seq("attr=age:geom:dtg", "attr=name:dtg", "z2=geom", "z3=geom:dtg")
getIndexConfig(ds.getSchema("test1")) mustEqual Seq("attr=age:dtg", "attr=name:geom:dtg", "z2=geom", "z3=geom:dtg")
}
}
}
Expand Down
Loading