Skip to content

fix(hive): support hyphenated config property names in SET statement (#487) - #491

Open
liuxy0551 wants to merge 1 commit into
DTStack:mainfrom
liuxy0551:fix_487
Open

fix(hive): support hyphenated config property names in SET statement (#487)#491
liuxy0551 wants to merge 1 commit into
DTStack:mainfrom
liuxy0551:fix_487

Conversation

@liuxy0551

Copy link
Copy Markdown
Collaborator

Problem

HiveSQL.validate() reports a syntax error on config keys containing
hyphens, e.g. set tez.grouping.max-size = 1, while SparkSQL.validate()
accepts them. These keys are valid Hive SQL (Hive passes tez.* properties
through to the Tez session).

Changes

  • src/lib/SQLParserBase.ts: add isNextTokenAdjacent() semantic predicate
    to check whether two tokens are adjacent (no whitespace).
  • src/grammar/hive/HiveSqlParser.g4: rewrite SET statement to
    KW_SET configProperty EQUAL .*?; add configProperty / configPropertyPart
    to allow adjacent - between config key segments. Keeps the
    configPropertiesItem-based structure so SET <key> autocomplete still
    offers known keys.
  • Regenerate src/lib/hive/HiveSqlParser.*.

Tests

  • Positive cases added to test/parser/hive/syntax/fixtures/setConfigProperties.sql
    (tez.grouping.max-size etc.).
  • Negative case: spaced set hive.a - b = 1; still reports an error.

Verification

  • Hive full tests: 30 suites / 1189 tests passed.
  • Full test suite: 220 suites / 6337 tests passed, no regressions.
  • antlr4 --all --check, prettier-check, check-types, build all pass.

Closes #487

@liuxy0551
liuxy0551 requested a review from Cythia828 August 17, 2026 09:07
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.

[Bug]: SET statement fails when a config property name contains a hyphen

1 participant