WeisonWei opened a new issue, #52619:
URL: https://github.com/apache/doris/issues/52619

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
   2.1.x, 3.0.x
   
   
   ### What's Wrong?
   
   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.
   
   ### What You Expected?
   
   
   Doris should gracefully handle Hive tables with void columns by:
   1. Skipping void columns during schema retrieval
   2. Successfully parsing the remaining valid columns
   3. Maintaining compatibility with various Hive table structures
   
   ### How to Reproduce?
   
   1. **Create a Hive table with void columns:**
   ```sql
   -- In Hive
   CREATE TABLE test_table_with_void (
       id INT,
       name STRING,
       void_col VOID,
       another_void_col VOID
   );
   ```
   
   2. **Create HMS catalog in Doris:**
   ```sql
   CREATE CATALOG hive_catalog PROPERTIES (
       "type"="hms",
       "hive.metastore.uris" = "thrift://hive-metastore:9083"
   );
   ```
   
   3. **Try to query the table:**
   ```sql
   -- This may fail due to void column processing
   DESCRIBE hive_catalog.default.test_table_with_void;
   ```
   
   **Expected vs Actual:**
   - **Expected**: Schema shows only non-void columns (id, name)
   - **Actual**: Schema parsing fails or includes invalid void columns
   
   
   ### How to Reproduce?
   
   
   1. **Create a Hive table with void columns:**
   ```sql
   -- In Hive
   CREATE TABLE test_table_with_void (
       id INT,
       name STRING,
       void_col VOID,
       another_void_col VOID
   );
   ```
   
   2. **Create HMS catalog in Doris:**
   ```sql
   CREATE CATALOG hive_catalog PROPERTIES (
       "type"="hms",
       "hive.metastore.uris" = "thrift://hive-metastore:9083"
   );
   ```
   
   3. **Try to query the table:**
   ```sql
   -- This may fail due to void column processing
   DESCRIBE hive_catalog.default.test_table_with_void;
   ```
   
   **Expected vs Actual:**
   - **Expected**: Schema shows only non-void columns (id, name)
   - **Actual**: Schema parsing fails or includes invalid void columns
   
   
   ### Anything Else?
   
   **Impact:**
   - Affects compatibility with existing Hive tables that contain void columns
   - Can cause schema retrieval failures for legitimate Hive tables
   - Impacts data lake analytics workflows
   
   **Proposed Solution:**
   Skip void columns during schema processing in 
`HMSExternalTable.getHiveSchema()`:
   
   ```java
   for (FieldSchema field : schema) {
       if ("void".equalsIgnoreCase(field.getType())) {
           continue; // Skip void columns
       }
       // Process normal columns...
   }
   ```
   
   **Related Components:**
   - HMS External Table
   - Hive Schema Processing
   - Type Mapping
   
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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