iskenderurs opened a new pull request, #1280:
URL: https://github.com/apache/ranger/pull/1280

   ## What changes were proposed in this pull request?
   
   Use JDBC metadata for Hive database and table resource lookup instead of 
`SHOW DATABASES/TABLES LIKE`. Translate Ranger `*` and `?` patterns to JDBC `%` 
and `_`, then apply the original Ranger wildcard locally to preserve literal 
characters such as `_` in resource names. This lets connection testing and 
resource lookup use the same path with Hive 3.1.3 and Hive 4.0.1. The Hive 
Metastore API path and column lookup are unchanged.
   
   ## How was this patch tested?
   
   `mvn -pl hive-agent -am 
-Dtest=TestHiveClientDatabaseLookup,TestAllHiveOperationInRanger 
-Dsurefire.failIfNoSpecifiedTests=false test` on JDK 11: 4 tests passed. The 
new tests cover connection test pattern `*`, database and table prefix lookup, 
exclusions, and literal `_` filtering.
   
   Live JDBC checks against HiveServer2 3.1.3 and 4.0.1 confirmed 
`DatabaseMetaData.getSchemas()` and `getTables()` return the expected databases 
and tables with `%` patterns. Hive 4.0.1 returned no rows for the old `SHOW 
DATABASES LIKE '*'` and `SHOW TABLES LIKE 'test*'` queries, while the metadata 
calls returned the resources.
   


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