Skip to content

Latest commit

 

History

History
54 lines (44 loc) · 2.8 KB

AGENTS.md

File metadata and controls

54 lines (44 loc) · 2.8 KB

Tree-Model SQL Grammar Guidelines

These instructions apply to iotdb-core/antlr/ and supplement the repository instructions.

Keyword and identifier compatibility

  • When adding a keyword token to SqlLexer.g4, add the same token to the keyWords rule in IdentifierParser.g4 in the same change. A new dedicated lexer token no longer matches the generic ID alternative; omitting it from keyWords can break its use as an unquoted measurement or path node name.
  • Preserve the existing identifier and path rules in IoTDBSqlParser.g4, which imports IdentifierParser. Do not make users quote previously valid unquoted names to work around a missing keyword entry, or change existing reserved/special-token behavior incidentally.
  • This synchronization applies to keyword tokens. Do not add punctuation, operators, whitespace, lexer fragments, or literal rules to keyWords merely because they are defined in the lexer.

Verification

  • Verify both the newly introduced SQL syntax and the same word used as an unquoted measurement and path component in create/insert/query statements. Include case variants; testing only quoted identifiers does not cover this compatibility requirement. The existing IoTDBSyntaxConventionIdentifierIT provides identifier/path regression coverage. Follow integration-test/AGENTS.md before editing or running ITs.
  • Edit the .g4 sources and regenerate through Maven; do not edit generated Java, .tokens, or .interp files. Rebuild the affected grammar and DataNode consumers and run the affected parser/identifier tests. Successful grammar generation alone does not prove that existing names still parse correctly.