Skip to content

Basic Schema Field Pruning#144

Draft
johannes-wolf wants to merge 3 commits intomainfrom
schema-field-pruning
Draft

Basic Schema Field Pruning#144
johannes-wolf wants to merge 3 commits intomainfrom
schema-field-pruning

Conversation

@johannes-wolf
Copy link
Copy Markdown
Collaborator

@johannes-wolf johannes-wolf commented May 9, 2026

Changes

  • Two new lists bottomUpRewriteRules and topDownRewriteRules holding expression rewrite functions are applied bottom-up and top-down to the AST during- and post compilation
  • A new WildcardFieldExpr replaces PathExpr(WildcardExpr, FieldExpr) and implements candidate pruning by querying the node's schema
  • Some small expression rewrites for redundant expressions (**._ → **, _._ → _, …)
  • Expression IDs are now assigned post compilation
  • Model object- and array-ids now point to an opaque SchemaId (sizeof(SchemaId) == sizeof(StringId))
  • Simfil provides no schema registry but expects the API user to provide a SchemaId -> const Schema* callback to the Environment
  • Added a generic traversal API to Expr in addition to the ExprVisitor API

ToDos

  • Add a basic JSONSchema registry
  • Implement *.field pruning (non-recursive wildcard version)
  • Add more flexible AST rewrites to support pruning in non-trivial queries

Naive test gives $\approx \frac{1}{3}%$ speedup.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Test Results

  1 files  ± 0    1 suites  ±0   7m 18s ⏱️ +6s
101 tests +10  101 ✅ +10  0 💤 ±0  0 ❌ ±0 
106 runs  +10  106 ✅ +10  0 💤 ±0  0 ❌ ±0 

Results for commit 9bbff92. ± Comparison against base commit ee5357c.

♻️ This comment has been updated with latest results.

@johannes-wolf johannes-wolf force-pushed the schema-field-pruning branch from 363f213 to d019d43 Compare May 9, 2026 17:34
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
5.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Package Line Rate Branch Rate Health
include.simfil 24% 10%
include.simfil.model 76% 48%
src 77% 48%
src.model 83% 47%
Summary 47% (8358 / 17677) 28% (5036 / 17757)

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