WeisonWei opened a new pull request, #52620:
URL: https://github.com/apache/doris/pull/52620

   ### What problem does this PR solve?
   
   Issue Number: close #[ISSUE_NUMBER]
   
   Related PR: N/A
   
   Problem Summary:
   
   When retrieving Hive table schema through HMS (Hive Metastore), Doris fails 
to handle tables that contain columns with `void` type, leading to schema 
parsing errors and compatibility issues.
   
   **Root Cause:**
   In `HMSExternalTable.getHiveSchema()`, the code processes all columns from 
Hive schema without filtering out void columns, causing type mapping failures 
when encountering void types.
   
   **Solution:**
   - Skip columns with type 'void' (case-insensitive) during schema retrieval
   - Maintain compatibility with Hive tables that contain void columns
   - Ensure only valid, mappable columns are included in the Doris schema
   
   ### Release note
   
   Fix HMS external table compatibility by skipping void columns during Hive 
schema retrieval, preventing schema parsing failures for Hive tables containing 
void type columns.
   
   ### Check List (For Author)
   
   - Test <!-- At least one of them must be included. -->
       - [ ] Regression test
       - [x] Unit Test
       - [x] Manual test (add detailed scripts or steps below)
       - [ ] No need to test or manual test. Explain why:
           - [ ] This is a refactor/code format and no logic has been changed.
           - [ ] Previous test can cover this change.
           - [ ] No code files have been changed.
           - [ ] Other reason <!-- Add your reason?  -->
   
   **Unit Tests Added:**
   - `testVoidColumnFiltering()`: Tests that void columns are properly filtered 
out during schema processing
   - Covers both 'void' and 'VOID' type variations (case-insensitive)
   
   **Manual Test Steps:**
   ```sql
   -- 1. Create Hive table with void columns
   CREATE TABLE test_void_columns (
       id INT,
       name STRING,
       void_col1 VOID,
       description STRING,
       void_col2 VOID
   );
   
   -- 2. Create HMS catalog in Doris
   CREATE CATALOG hive_catalog PROPERTIES (
       "type"="hms",
       "hive.metastore.uris" = "thrift://hive-metastore:9001"
   );
   
   -- 3. Verify schema retrieval works correctly
   DESCRIBE hive_catalog.default.test_void_columns;
   -- Expected: Should show only id, name, description columns (void columns 
filtered out)
   
   -- 4. Verify table can be queried
   SELECT * FROM hive_catalog.default.test_void_columns LIMIT 10;
   -- Expected: Query should work without schema-related errors
   ```
   
   - Behavior changed:
       - [x] No.
       - [ ] Yes. <!-- Explain the behavior change -->
   
   - Does this need documentation?
       - [x] No.
       - [ ] Yes. <!-- Add document PR link here. eg: 
https://github.com/apache/doris-website/pull/1214 -->
   
   ### Check List (For Reviewer who merge this PR)
   
   - [ ] Confirm the release note
   - [ ] Confirm test cases
   - [ ] Confirm document
   - [ ] Add branch pick label <!-- Add branch pick label that this PR should 
merge into -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to