Open packyan opened 2 years ago
cc @yaooqinn
we shall use currentdb case by case
The DescribeTableCommand supports both temp view, permanent view, and table. we can use the current db directly for the temp view. we seem can do nothing if the spark does not pass the database part into this command.
Code of Conduct
Search before asking
What would you like to be improved?
The current constructor of AccessResource is :
In some cases, firstLevelResource maybe null, for example, in spark 2.4,
DESCRIBE TABLE table_name
, will produce aDescribeTableCommand
without database info, so the correspnding AccessResource'sfirstLevelResource
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, getfirstLevelResource
from catalog's current database.Are you willing to submit PR?