Skip to content

feature - implement RFC 022 hashing functions (#39)#49

Draft
dannymeijer wants to merge 1 commit into
feature/36-rfc019-window-functionsfrom
feature/39-rfc022-format-functions
Draft

feature - implement RFC 022 hashing functions (#39)#49
dannymeijer wants to merge 1 commit into
feature/36-rfc019-window-functionsfrom
feature/39-rfc022-format-functions

Conversation

@dannymeijer
Copy link
Copy Markdown
Collaborator

Summary

This PR implements the first RFC 022 format-function slice: deterministic string hashing helpers. It adds registry-backed md5, sha224, sha256, sha384, sha512, and sha2 helpers, records stable Substrait extension anchors for the concrete helpers, and keeps sha2(...) as a compatibility rewrite over supported literal bit lengths. RFC 022 remains In Progress because JSON, CSV, URL, and dynamic-value helper semantics are still explicitly future scope.

Type of change

  • Bug fix
  • New feature
  • Refactor / maintenance
  • Documentation
  • CI / tooling
  • RFC (adds/updates docs/rfcs/*)

Area(s)

Select the primary areas touched (labels sync from checked lines when the triage workflow runs):

  • Package & tests
  • Specification (RFCs)
  • Documentation
  • Automation & repo config
  • Other

Key details

  • User-facing behavior: Authors can build lowercase hexadecimal hash expressions with md5(...), concrete SHA-2 helpers, or sha2(expr, 224|256|384|512).
  • Internals: Concrete hash helpers declare registry-owned Substrait extension mappings. sha2(...) is a compatibility helper that rewrites to the matching concrete SHA-2 helper and rejects unsupported digest lengths before backend lowering.
  • Risks: This PR intentionally does not implement JSON/CSV parsers, URL helpers, dynamic-value predicates, or binary hash-output variants. RFC 022 documents that remaining scope.

Testing / verification

  • make fmt
  • incan test tests/test_hashing_functions.incn
  • incan test tests/test_function_registry.incn
  • incan test tests/test_substrait_plan.incn
  • incan test tests/test_session_projection.incn
  • make fmt-check
  • make test-style
  • make registry-metadata
  • make build
  • make test
  • make smoke-consumer
  • make pre-commit
  • Manual verification described below

Manual verification notes:

  • make test and make pre-commit both passed with 146 tests.
  • make registry-metadata passed with 92 helpers.
  • incan.lock is out of date warnings appeared as expected; this PR does not refresh the lock.

Docs impact

  • No docs changes needed
  • Docs updated
  • Docs follow Divio intent (tutorial/how-to/reference/explanation) where applicable

If docs updated:

  • Link(s): docs/language/reference/functions/format.md, docs/language/reference/functions/index.md, docs/release_notes/v0_1.md, docs/rfcs/022_semi_structured_format_functions.md, docs/rfcs/README.md

Checklist

  • I kept public docs user-focused and moved internals to contributing docs when appropriate
  • I avoided duplicating canonical install/run instructions in multiple places
  • I added/updated tests where it materially reduces regressions

Stack order: merge after #48. This PR is partial RFC 022 scope and should not close the RFC issue yet.

Refs #39

@incan-triage-bot incan-triage-bot Bot added documentation Improvements or additions to documentation package Library source, tests, incan.toml specification docs/rfcs/ normative RFCs labels May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation package Library source, tests, incan.toml specification docs/rfcs/ normative RFCs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant