wangxiao13 opened a new issue, #14555:
URL: https://github.com/apache/gravitino/issues/14555

   ### Describe the feature
   
   ### Description
   
   `HiveCatalogOperations.listTables()` and 
`HiveViewCatalogOperations.listViews()`
   unconditionally call `listTablesByType(...)` (thrift `get_tables_by_type`) to
   filter out `VIRTUAL_VIEW` entries. That RPC was introduced in Apache Hive 
2.3.0
   (HIVE-14498), so any metastore older than 2.3 rejects the call at the thrift
   layer:
   
       org.apache.thrift.TApplicationException: Invalid method name: 
'get_tables_by_type'
   
   ### Environment
   
   - Gravitino: 1.3.1
   - Metastore: Hive 1.1.0-cdh5.14.4 (CDH 5.14.4)
   - Observable symptom: listing schemas works, opening a schema
     (listing tables) fails with the error above
   
   ### Why this is a problem
   
   The 1.3.1 docs state "The Hive catalog supports HMS versions 2.x and 3.x. it 
can
   automatically detect the HMS version." Following that, HMS 2.0/2.1/2.2 
should be
   usable, but they fail too, because `get_tables_by_type` only exists from 2.3.
   So in practice the supported range is 2.3+, not 2.x.
   
   ### Proposal
   
   Add a version-gated fallback, e.g. wrap the `listTablesByType` calls in a
   capability check (the catalog already resolves `hiveVersion()` for the
   NOT NULL / DEFAULT feature) and degrade gracefully when the RPC is missing:
   
   - `listTables()`: skip view filtering when the RPC is unsupported
   - `listViews()` / `viewExists()`: fall back to `getAllTables()` + per-table
     `getTable()` and check `tableType == VIRTUAL_VIEW`
   
   If falling back to per-table lookups is considered too slow for large
   databases, an alternative is to reject old metastores at catalog creation 
time
   with a clear error message, instead of failing later on table listing.
   
   Happy to submit a PR for either approach.
   
   ### Motivation
   
   _No response_
   
   ### Describe the solution
   
   _No response_
   
   ### Additional context
   
   _No response_


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