packyan opened a new issue, #2438:
URL: https://github.com/apache/incubator-kyuubi/issues/2438

   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   
   
   ### Search before asking
   
   - [X] I have searched in the 
[issues](https://github.com/apache/incubator-kyuubi/issues?q=is%3Aissue) and 
found no similar issues.
   
   
   ### What would you like to be improved?
   
   The current constructor of AccessResource is :
   ```scala
   object AccessResource {
     def apply(
         objectType: ObjectType,
         firstLevelResource: String,
         secondLevelResource: String,
         thirdLevelResource: String) {
       ...
     }
   }
   ```
   In some cases, firstLevelResource maybe null, for example, in spark 
2.4,`DESCRIBE TABLE table_name`, will produce a `DescribeTableCommand` without 
database info, so the correspnding AccessResource's `firstLevelResource` is 
null. Then it will generate a invaild RangerRequest, because of the databasse 
field is null.
   
   I'm not sure that when the database is not explicitly specified in the sql 
statement, there will be other commands without database information.
   
   ### How should we improve?
   
   Therefore, I think we should add a sparksession in AccessResource, in the 
case of databasse is null. When the `firstLevelResource` is null or empty, get 
`firstLevelResource` from catalog's current database.
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!


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