-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(plugin-pinot): Normalize mixed-case Pinot table/column name handling when case-sensitive flag is disabled #26663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
sh-shamsan
wants to merge
1
commit into
prestodb:master
Choose a base branch
from
sh-shamsan:normalize-pinot-tablehandle
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
…ing when case-sensitive flag is disabled
Contributor
Reviewer's GuideIntroduce identifier normalization for mixed-case table and column names when case sensitivity is disabled by propagating session context to metadata lookups and adding a case-sensitivity flag to column mapping. Sequence diagram for normalized table name lookup in PinotMetadatasequenceDiagram
participant S as "ConnectorSession"
participant M as "PinotMetadata"
participant C as "PinotConnection"
S->>M: getTableHandle(session, tableName)
M->>M: getPinotTableNameFromPrestoTableName(session, tableName.getTableName())
M->>C: getTableNames()
M->>M: normalizeIdentifier(session, prestoTableName)
M->>M: normalizeIdentifier(session, pinotTableName)
M->>M: Compare normalized names
M-->>S: PinotTableHandle
Sequence diagram for PinotColumn creation with case sensitivity flagsequenceDiagram
participant PC as "PinotConnection"
participant CU as "PinotColumnUtils"
participant Col as "PinotColumn"
PC->>CU: getPinotColumnsForPinotSchema(schema, ..., nullHandlingEnabled, isCaseSensitiveNameMatchingEnabled)
CU->>CU: For each columnName in schema
CU->>Col: PinotColumn(name, ...)
Note right of Col: name is normalized to lower-case if flag is false
CU-->>PC: List<PinotColumn>
Class diagram for updated PinotMetadata and PinotColumnUtils normalization logicclassDiagram
class PinotMetadata {
- pinotPrestoConnection: PinotConnection
+ listSchemaNames(session)
- getPinotTableNameFromPrestoTableName(session, prestoTableName)
+ getTableHandle(session, tableName)
+ getTableMetadata(session, tableName)
+ getColumnHandles(session, tableHandle)
+ listTableColumns(session, prefix)
}
class PinotColumnUtils {
+ getPinotColumnsForPinotSchema(pinotTableSchema, inferDateType, inferTimestampType)
+ getPinotColumnsForPinotSchema(pinotTableSchema, inferDateType, inferTimestampType, nullHandlingEnabled, isCaseSensitiveNameMatchingEnabled)
}
PinotMetadata --> PinotColumnUtils : uses
PinotMetadata --> PinotConnection : uses
PinotConnection --> PinotColumnUtils : uses
Class diagram for PinotColumn creation with case sensitivity flagclassDiagram
class PinotColumn {
+ PinotColumn(name, type, nullable, comment)
- name: String
- type: PrestoType
- nullable: boolean
- comment: String
}
PinotColumnUtils --> PinotColumn : creates
PinotColumnUtils : +getPinotColumnsForPinotSchema(..., isCaseSensitiveNameMatchingEnabled)
PinotColumn : name is normalized to lower-case if isCaseSensitiveNameMatchingEnabled is false
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.