fix(hive): support hyphenated config property names in SET statement (#487) - #491
Open
liuxy0551 wants to merge 1 commit into
Open
fix(hive): support hyphenated config property names in SET statement (#487)#491liuxy0551 wants to merge 1 commit into
liuxy0551 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
HiveSQL.validate()reports a syntax error on config keys containinghyphens, e.g.
set tez.grouping.max-size = 1, whileSparkSQL.validate()accepts them. These keys are valid Hive SQL (Hive passes
tez.*propertiesthrough to the Tez session).
Changes
src/lib/SQLParserBase.ts: addisNextTokenAdjacent()semantic predicateto check whether two tokens are adjacent (no whitespace).
src/grammar/hive/HiveSqlParser.g4: rewrite SET statement toKW_SET configProperty EQUAL .*?; addconfigProperty/configPropertyPartto allow adjacent
-between config key segments. Keeps theconfigPropertiesItem-based structure soSET <key>autocomplete stilloffers known keys.
src/lib/hive/HiveSqlParser.*.Tests
test/parser/hive/syntax/fixtures/setConfigProperties.sql(
tez.grouping.max-sizeetc.).set hive.a - b = 1;still reports an error.Verification
antlr4 --all --check,prettier-check,check-types,buildall pass.Closes #487