Feature: validate typed scalar expression inputs (#57)#58
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.
Summary
This PR implements InQL issue #57 by making scalar helper contracts typed, schema-aware, and source-driven. Public helpers now declare precise
ValueOrColumninputs and typed expression results where InQL knows the contract; Prism carries row-schema facts forward; Substrait lowering rejects schema-incompatible column references before backend execution. It also updates the cast family to use Incan primitive type-token targets such ascast(col("amount_text"), float)andtry_cast(col("status"), int)while keeping explicit string targets for compatibility spellings.Type of change
docs/rfcs/*)Area(s)
Select the primary areas touched (labels sync from checked lines when the triage workflow runs):
Key details
gt(col("qty"), 2),substring(col("sku"), 1, 3),make_date(2026, 5, 30), andcast(col("amount_text"), float)are the intended shapes. Broadlit(...)remains a structural escape hatch, not a way to bypass typed helper contracts.castandtry_castnow support primitive type-token overloads forbool,int,float, andstr;safe_castis an Incan alias oftry_castplus registry compatibility alias metadata. String target spellings remain for compatibility aliases such asint64andfloat64.0.3.0-rc47. CI is temporarily pinned tofeature/750-primitive-type-tokens; after #751 lands onrelease/v0.3, this should be switched back torelease/v0.3with the same expected rc or final0.3version..agents/state/review-report.incan-source-quality.mdlocally and snapshotted in/tmp/incan-review-findings/2026-06-03-branch-feature-57-typed-scalar-validation-incan-source-quality-followup.md.Testing / verification
make fmt INCAN=<rc47 compiler>-> 0 files changedmake fmt-check INCAN=<rc47 compiler>-> 276src, 20tests, 8examplesalready formattedmake test-style-> passedmake registry-metadata INCAN=<rc47 compiler>-> 199 helpersmake build INCAN=<rc47 compiler>-> passedmake test INCAN=<rc47 compiler>-> 216 passedmake build-locked INCAN=<rc47 compiler>-> passedmake test-locked INCAN=<rc47 compiler>-> 216 passedmake smoke-consumer INCAN=<rc47 compiler>-> passed after allowing Cargo network accessgit diff --checkFocused verification during the review/fix loop:
incan test tests/test_session_filters.incn-> 6 passedincan test tests/test_session_projection.incn-> 17 passedincan test tests/test_substrait_plan.incn-> 50 passedincan test tests/test_function_registry.incn-> 19 passedincan test tests/test_core_scalar_functions.incn-> 5 passedincan test tests/test_common_scalar_functions.incn-> 5 passedincan test tests/test_nested_data_functions.incn-> 3 passedDocs impact
If docs updated:
README.md,docs/language/reference/functions/index.md, builder/reference docs, nested function reference docs, anddocs/release_notes/v0_1.md.Checklist
Closes #57