Uh oh!
There was an error while loading. Please reload this page.
Fix hive view case sensitivity - #52694
Conversation
Fix uppercase identifiers in Hive view SQL causing query failures. Add HiveViewSqlTransformer to normalize SQL while preserving quoted strings.
hello-stephen
commented
Jul 2, 2025
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
| * This transformer converts SQL keywords, table names, and column names to lowercase | ||
| * while preserving the case of string literals enclosed in quotes. | ||
| */ | ||
| public class HiveViewSqlTransformer { |
There was a problem hiding this comment.
convert SQL without parser and analyzer is not safe.
Recently I refactor the whole case sensibility issue: #52561
And for hive catalog, you can try adding "only_test_lower_case_table_names" = "2" to see if it can solve your problem
We're closing this PR because it hasn't been updated in a while. |
What problem does this PR solve?
Issue Number: close#52557
Related PR: N/A
Problem Summary:
When querying Hive views through External Catalog, the view SQL text retrieved from Hive Metastore may contain uppercase table names and column names. Since Hive is case-insensitive but Doris may be case-sensitive in certain contexts, this can cause query failures when the view SQL contains mixed case identifiers.
Specific Issues:
SELECT * FROM MyTablebut Doris expectsmytableExample Failure Scenario:
Release note
Fix case sensitivity issue in Hive view SQL processing to ensure reliable querying of Hive views through External Catalog.
Check List (For Author)
Check List (For Reviewer)
Detailed Solution
1. Root Cause Analysis
The issue occurs in the
BindRelationphase when processing Hive views:2. Solution Design
Add HiveViewSqlTransformer utility class to normalize Hive view SQL:
3. Implementation Details
HiveViewSqlTransformer.java
BindRelation.java Integration
4. Test Cases
Basic Case Transformation
Preserve Quoted Strings
Complex Query with Aggregation
5. Before vs After
Before Fix:
After Fix:
6. Performance Impact
7. Compatibility
8. Edge Cases Handled
9. Files Modified
10. Risk Assessment
Risk Level: LOW
Mitigation: