Conversation
sidemantic-rs: Rust implementation using sqlparser-rs - Core types: Model, Dimension, Metric, Relationship, Segment - SemanticGraph with BFS join path discovery - SQL generation and query rewriting - YAML config loading (native + Cube.js formats) - C FFI bindings for DuckDB integration - 29 passing tests sidemantic-duckdb: DuckDB extension wrapping Rust library - Parser extension: SEMANTIC keyword triggers query rewriting - Table functions: sidemantic_load(), sidemantic_models() - Scalar function: sidemantic_rewrite_sql() - Links static Rust library via C FFI
…ension Rust library enhancements: - Add cumulative metrics (running totals, period-to-date MTD/YTD) - Add time comparison metrics (YoY, MoM, WoW growth) - Add fill_nulls_with and format options to metrics - Improve error messages with available options (model/dimension/metric/segment not found) - Add helper functions for creating typed errors DuckDB extension: - Add sidemantic_load_file(path) table function to load YAML from files or directories
- Auto-generate LEFT JOINs when querying across related models
- Detect fan-out risk when joining one-to-many and add SQL warning
- Support custom join conditions via Relationship.sql field
- Add {from}/{to} placeholders for custom join SQL
- Wire custom conditions through SemanticGraph adjacency list
- Add tests for fan-out detection, custom joins, and cross-model queries
…README
- Add Cross-Model Queries section with auto-JOIN example
- Document sidemantic_load_file() function for file/directory loading
- Add relationship types table with fan-out risk indicators
- Document custom join conditions with {from}/{to} placeholders
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0a8040c to
6c42a41
Compare
- Add separate Rust CI job for sidemantic-rs (fmt, clippy, test) - Rename Python job for clarity - Fix all clippy warnings (uninlined format args, type complexity, etc.) - Add type alias for adjacency edges to reduce complexity - Add module-level allow for FFI raw pointer derefs - Delete unused NEXT_README.md template boilerplate
- Add TableCalculation struct with types: running_total, percent_of_total, percent_of_previous, rank, dense_rank, row_number, moving_average, difference, lead, lag, formula - Generate SQL window functions instead of post-processing (more efficient) - Support partition_by, order_by, window_size, offset parameters - Add to SemanticQuery with with_table_calculations() builder - Wire into SqlGenerator to include in SELECT clause
…tion parser Features: - Model inheritance: extends field, resolve_model_inheritance() - Symmetric aggregates: auto-applied in generator for fan-out prevention - Relative dates: expand 'last 7 days', 'this month', etc. in filters - SQL definition parser using nom for MODEL/DIMENSION/METRIC/SEGMENT syntax Wiring: - Symmetric aggregates used automatically when fan-out detected (no more warning) - Inheritance resolved during YAML loading - Relative date expressions expanded in filter processing - SQL parser available via parse_sql_model() and parse_sql_definitions()
New features: - Simple SQL-like syntax: METRIC revenue AS SUM(amount) - SEMANTIC MODEL command to switch active model context - model.metric prefix syntax for explicit model targeting - Fix COUNT(*) metric generation (was COUNT(metric_name)) Parser improvements: - Added sqlparser-rs integration for expression parsing - Support multiple syntax variants in alt() combinator - Handle METRIC/DIMENSION model.name (props) syntax
82811f9 to
4b7158e
Compare
4b7158e to
cf1a905
Compare
The workflows in sidemantic-duckdb/.github/ never ran since GitHub only checks the root .github/ directory. Added a new duckdb-extension job to the main CI that builds Rust first, then builds and tests the DuckDB extension.
New syntax requires CREATE keyword: - SEMANTIC CREATE METRIC revenue AS SUM(amount) - SEMANTIC CREATE OR REPLACE METRIC revenue AS SUM(amount) - SEMANTIC CREATE DIMENSION status AS status The OR REPLACE flag is parsed but not yet implemented in Rust.
- Add SEMANTIC CREATE OR REPLACE METRIC/DIMENSION/SEGMENT syntax - Add model.name dot notation for explicit model targeting in AS syntax - Add Expression aggregation type for complex expressions like SUM(amount) * 2 - Update sidemantic_add_definition FFI to accept is_replace parameter - Implement replace logic using retain() to remove existing items by name
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.
No description provided.