csurong opened a new issue, #4350:
URL: https://github.com/apache/amoro/issues/4350

   ### What happened?
   
   When an external Hive catalog contains a Hive view, the view may be returned 
by Hive Metastore table listing APIs and exposed on the Amoro Tables page as a 
manageable table.
   
   ### Actual behavior
   
   Opening the view invokes the normal table detail endpoint. 
CommonUnifiedCatalog attempts to load it through the configured format 
catalogs, and MixedHiveCatalog handles the Hive view as a physical table. The 
view has no storage location, so MixedHiveCatalog.getMixedTableMeta calls 
`endsWith` on a null location and throws a NullPointerException. The detail 
request returns HTTP 500 and the page cannot be opened.
   
   ### Expected behavior
   
   Hive virtual and materialized views should not be exposed as manageable 
Amoro tables. Loading a view through a physical table path should return a 
clear not-found or unsupported result instead of throwing a 
NullPointerException. Regular physical tables should remain unaffected.
   
   ### Affects Versions
   
   master
   
   ### What table formats are you seeing the problem on?
   
   Iceberg, Mixed-Hive
   
   ### What engines are you seeing the problem on?
   
   _No response_
   
   ### How to reproduce
   
   1. Configure an external Hive catalog in Amoro.
   2. Create a physical table and a Hive view in the same database.
   3. Open the database from the Tables page.
   4. Observe that the Hive view is listed as a manageable table.
   5. Open the view entry.
   6. Observe that the detail request returns HTTP 500 with a 
NullPointerException from MixedHiveCatalog.getMixedTableMeta.
   
   ### Relevant log output
   
   ```shell
   java.lang.NullPointerException: null
       at 
org.apache.amoro.hive.catalog.MixedHiveCatalog.getMixedTableMeta(MixedHiveCatalog.java:195)
       at 
org.apache.amoro.hive.catalog.MixedHiveCatalog.loadTable(MixedHiveCatalog.java:347)
       at 
org.apache.amoro.formats.mixed.MixedCatalog.loadTable(MixedCatalog.java:72)
       at 
org.apache.amoro.CommonUnifiedCatalog.loadTable(CommonUnifiedCatalog.java:134)
       at 
org.apache.amoro.server.dashboard.ServerTableDescriptor.getTableDetail(ServerTableDescriptor.java:75)
       at 
org.apache.amoro.server.dashboard.controller.TableController.getTableDetail(TableController.java:151)
   ```
   
   ### Anything else
   
   Hive views should remain available to query engines that support them, but 
they should not be treated as Iceberg, Mixed Hive, or native Hive physical 
tables by Amoro table management.
   
   ### Are you willing to submit a PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's Code of 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]

Reply via email to