Skip to content

Allow concat types to omit primary instants in some main tables - #682

Merged
azahnen merged 2 commits into
masterfrom
primary-instants
Oct 30, 2026
Merged

azahnen merged 2 commits into
masterfrom
primary-instants

Conversation

@azahnen

@azahnen azahnen commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Problem

A feature type can be built from several main tables ("concat"). Until now, every one of those tables had to have a primary instant (or primary interval), otherwise the schema failed validation. In practice some tables simply have no date/time, so such types could not be configured.

Separately, filters on a concat type looked up columns by the plain property name, but the SQL mapping keys them with a table-index prefix (e.g. 0_name), so the right column was not always found.

Solution

Tables without a primary instant or interval are now allowed. When a filter uses that property, it is treated as null in those tables:

  • IS NULL matches.
  • Every other predicate on it (e.g. T_INTERSECTS, >) matches nothing.
  • Negations are pushed down to the predicates first, so NOT (datetime > ...) also matches nothing, following SQL's unknown semantics.

Details:

  • Removed the check in FeatureSchema that required the number of primary instants/intervals to equal the number of concatenated objects. The check that they share the same property path stays.
  • New CqlAbsentPropertiesMapper and Cql.mapAbsentProperties() rewrite a filter so given properties behave as null, resolving predicates to boolean literals.
  • FilterEncoderSql detects, per main-table mapping, which primary instant/interval properties are missing and applies the mapper before encoding.
  • SqlQueryMapping now resolves concat-prefixed property keys (e.g. 0_name) when looking up tables, columns and schemas for a plain property name.

Testing

  • Added CqlAbsentPropertiesMapperSpec covering unchanged filters, IS NULL/IS NOT NULL, negation push-down, and mixed AND/OR branches.
  • Added FilterEncoderSqlConcatPrimaryInstantSpec covering SQL output for a concat type with one table with and one without a primary instant (1=0, 1=1, (1=0 OR A.id = 1)).
  • Added FilterEncoderSqlColumnNameSpec covering column lookup for single and concat main tables with differing column names.

@azahnen
azahnen merged commit 09718aa into master Oct 30, 2026
3 checks passed
@azahnen
azahnen deleted the primary-instants branch October 30, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant