Skip to content

spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#42

Merged
trendvidia merged 1 commit into
mainfrom
v1.0-spec-rename
May 13, 2026
Merged

spec(v1.0): rename @table → @dataset, add @proto, expand reserved names#42
trendvidia merged 1 commit into
mainfrom
v1.0-spec-rename

Conversation

@trendvidia

Copy link
Copy Markdown
Owner

Summary

Implements the three one-time spec changes from the protowire v1.0 freeze line (STABILITY.md):

  • @table@dataset (draft §3.4.4). Hard cutover, no alias period.
  • @proto directive added (draft §3.4.5). Four body shapes lexically distinguished: anonymous, named, source, descriptor. Descriptor form is the MUST-support shape; this port supports all four.
  • Reserved directive names expanded from 5 to 13 (draft §3.4.6). Parser + FastDecoder reject @table, @datasource, @view, @procedure, @function, @permissions.

Public API rename surface

Before After
Ast.TableDirective Ast.DatasetDirective
Ast.TableRow Ast.DatasetRow
TableReader DatasetReader
Document.tables() Document.datasets()
Result.tables() Result.datasets()
TokenKind.AT_TABLE AT_DATASET
Ast.ProtoDirective + Ast.ProtoShape (new)
Document.protos() + Result.protos() (new)
TokenKind.AT_PROTO (new)
SchemaValidator.FUTURE_RESERVED_DIRECTIVES (new)

Source files TableReader.java, TableReaderTest.java, TableParserTest.java renamed to their Dataset* equivalents.

@dataset's row message type is now optional in the AST — binding to an anonymous @proto per draft §3.4.4 Anonymous binding. Lexer.repositionTo(int) added so the parser can skip past an @proto brace-body whose interior is protobuf source rather than PXF.

Test plan

  • `./gradlew :pxf:test` passes — 103 tests, 0 failures
  • New `ProtoDirectiveTest` with 13 cases covering all four body shapes, anonymous binding, multi-`@proto`, nested-brace bodies, reserved-name rejection, `@type` coexistence, and the `ProtoShape` enum
  • Cross-port verification once protowire-typescript merges its v1.0 PR; protowire-go bench-pxf-android: lite-tier perf harness #19 already merged

Companion PRs:

Implements the three one-time spec changes from the protowire v1.0
freeze line (protowire/STABILITY.md):

- @table directive renamed to @dataset (draft §3.4.4). Same
  semantics; v1 reserves @table for a future storage-definition
  meaning. Hard cutover — no alias period.

- @proto directive added (draft §3.4.5). Four body shapes
  distinguished lexically: anonymous { ... }, named pkg.Type
  { ... }, source """...""", descriptor b"...". Descriptor form is
  mandatory per spec; the other three are QoI (all four supported).
  Anonymous @proto is consumed one-shot by the next typed-binding
  directive.

- Reserved directive name list expanded from 5 to 13 (draft §3.4.6).
  Parser + FastDecoder reject @table, @Datasource, @view,
  @procedure, @function, @permissions as spec-reserved.

Public API rename surface:
  Ast.TableDirective  → Ast.DatasetDirective
  Ast.TableRow        → Ast.DatasetRow
  TableReader         → DatasetReader
  Document.tables()   → Document.datasets()
  Result.tables()     → Result.datasets()
  Document.protos() / Result.protos()                       (new)
  Ast.ProtoDirective + Ast.ProtoShape                       (new)
  TokenKind.AT_TABLE  → AT_DATASET; + AT_PROTO              (new)
  SchemaValidator.FUTURE_RESERVED_DIRECTIVES                (new)

Source files renamed:
  TableReader.java          → DatasetReader.java
  TableReaderTest.java      → DatasetReaderTest.java
  TableParserTest.java      → DatasetParserTest.java
New: ProtoDirectiveTest.java with 13 cases covering all four shapes,
anonymous binding, multi-@proto, nested-brace bodies, reserved-name
rejection, @type coexistence, ProtoShape enum.

@dataset's row message type is now optional in the AST (binding to
an anonymous @proto). Lexer.repositionTo(int) added so the parser
can skip past an @proto brace-body whose interior is protobuf source
rather than PXF.

103 tests, 0 failures.
@trendvidia trendvidia merged commit 2f57a1e into main May 13, 2026
3 checks passed
@trendvidia trendvidia deleted the v1.0-spec-rename branch May 13, 2026 07:08
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