Repository navigation
Allow concat types to omit primary instants in some main tables - #682
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 NULLmatches.T_INTERSECTS,>) matches nothing.NOT (datetime > ...)also matches nothing, following SQL's unknown semantics.Details:
FeatureSchemathat required the number of primary instants/intervals to equal the number of concatenated objects. The check that they share the same property path stays.CqlAbsentPropertiesMapperandCql.mapAbsentProperties()rewrite a filter so given properties behave as null, resolving predicates to boolean literals.FilterEncoderSqldetects, per main-table mapping, which primary instant/interval properties are missing and applies the mapper before encoding.SqlQueryMappingnow resolves concat-prefixed property keys (e.g.0_name) when looking up tables, columns and schemas for a plain property name.Testing
CqlAbsentPropertiesMapperSpeccovering unchanged filters,IS NULL/IS NOT NULL, negation push-down, and mixed AND/OR branches.FilterEncoderSqlConcatPrimaryInstantSpeccovering 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)).FilterEncoderSqlColumnNameSpeccovering column lookup for single and concat main tables with differing column names.