Repository navigation
Conversation
…aware multipart identifiers ExpressionSeqTableExtractor split the table argument of CALL procedures on '.', so a quoted argument such as `local`.`db`.`tbl` was checked as the Ranger resource `db` / `tbl` with backticks, and quoted dots produced more than three parts and a MatchError. Parse the argument with the session parser's parseMultipartIdentifier, as the procedures do, and keep the previous splitting for arguments that are not a parsable identifier. Signed-off-by: arimu1 <19286898+arimu1@users.noreply.github.com>
|
Hello @arimu1, |
This branch has not been deployed
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.
Fixes #7852
Why are the changes needed?
ExpressionSeqTableExtractor(used by SparkCalland PaimonPaimonCallCommandplans) turned the first procedure argument into a table withExpression.toString()and a plainsplit("\\."). The procedures themselves parse that argument with the quote-awareparseMultipartIdentifier, so equivalent arguments authorized different resources:table => 'local.db.tbl'is checked asdb/tbl.table => 'local.db.tbl'is checked as`db`/`tbl`(backticks kept in the names), so a user withALTERondb/tblis denied.`cat`.`my.db`.`my.tbl`, splits into five parts and throwsMatchError.This change parses the argument with
spark.sessionState.sqlParser.parseMultipartIdentifier, as the procedures do. An argument that is not a parsable 1-3 part identifier falls back to the previousStringTableExtractorsplitting, so previously handled inputs keep their behavior. The hunk inStringTableExtractoris left untouched.Affected versions: 1.9.0 through master, as reported in #7852.
How was this patch tested?
Added
ExpressionSeqTableExtractorSuite(unquoted, quoted vs unquoted equivalence, quoted dots and escaped backticks, non-parsable fallback).With the fix:
Tests: succeeded 4, failed 0(Temurin 21, Spark 3.5 / Scala 2.12 defaults). With the change intableExtractors.scalareverted, the same suite givessucceeded 2, failed 2(the quoted-equivalence test fails and the quoted-dots test fails withscala.MatchError: 5). Scala files passspotless:check.Was this patch assisted by generative AI tooling?
Assisted-by: Claude Sonnet 5.5 (Cursor)