Skip to content

Named key references in CONCAT(K)/JOIN(K): CONCAT(0, 'A'), JOIN('k') - #3

Merged
shigarov merged 4 commits into
mainfrom
feature/named-record-key
Aug 29, 2026
Merged

Named key references in CONCAT(K)/JOIN(K): CONCAT(0, 'A'), JOIN('k')#3
shigarov merged 4 commits into
mainfrom
feature/named-record-key

Conversation

@shigarov

Copy link
Copy Markdown
Contributor

Summary

  • The key K of CONCAT(K) / JOIN(K) may now list attribute names besides 0-based positions: CONCAT(0, 1, 'A', 'B'), JOIN('Year'), mixed in any order. A name is resolved per record (via assoc) to the position of the item carrying that attribute, so the key no longer depends on the order of the fields. Semantics of the operations is unchanged; positional keys behave exactly as before.
  • New type RecordKey(positions, names); ActionSpec.key(), concat/join(String | RecordKey, …) factories (ATP and embedded DSL). The Set<Integer> constructor, keyPositions() and the int/Set<Integer> factories are kept as delegates.
  • Grammar: keyRef : INT | STRING; CONCAT('') is a compile error. Canonical form: positions ascending, then names sorted, single-quoted.
  • Conformance: semantic cases concat_named_key, join_named_key, negative concat_empty_key_name, curated extra named_key; the 152 existing positive pairs are unchanged.
  • Docs (rtl-reference, api, model/itm, model/atp, examples, embedded-rtl) and CHANGELOG [Unreleased].

Closes TODO #1 (plan RTL_NAMED_RECORD_KEY). The manuscript is intentionally untouched (K over positions only); the difference is noted in docs/model/itm.md.

Test plan

  • mvn clean test green (incl. new WorkingStateConcatTest/WorkingStateJoinTest named-key cases, RtlCompilerTest parse + round-trip, conformance suites, corpus freshness)
  • mkdocs build --strict clean
  • pyRegTab: implement named keys to pass the new conformance cases (downstream)

🤖 Generated with Claude Code

shigarov and others added 4 commits August 29, 2026 10:21
…te names

A key attribute name is resolved per record (via assoc) to the position of the
item carrying that attribute, so drop_K and compat_K apply to the resolved
positions and the semantics of the operations is unchanged; positional keys
behave exactly as before. ActionSpec.keyPositions -> key: RecordKey, with the
Set<Integer> constructor, keyPositions() and the int/Set factories kept as
delegates. Serializer: positions ascending, then names sorted, single-quoted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Grammar: keyRef : INT | STRING in concatOp/joinOp; an empty name is a compile
error. Embedded DSL: concat/join(String keyName, ...) and (RecordKey, ...).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ive, curated named_key)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@shigarov
shigarov merged commit f039857 into main Aug 29, 2026
2 checks passed
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