Ignore owner if translating Hive view in INVOKER mode#12403
Ignore owner if translating Hive view in INVOKER mode#12403joechu1 wants to merge 2 commits intotrinodb:masterfrom
Conversation
|
@joechu1 i see you pushed changes here |
Only one is needed. I'm happy to move forward with #14077 given that it includes the test cases. I added the new commit based on the previous discussion, but should not be a hard requirement. I'm just making the streamlined code available in case there was interest. |
|
What does this actually do? The diff doesn't give a lot of context, so when I read it I think the config flag might be overriding the view type in the view definition.... I don't think that is what this code is doing, but I can't tell from the diff. Can you describe the problem and the fix in more detail? |
|
@dain I've updated the description for the PR to describe the problem and fix in more detail. |
|
Superseded by #14077 which has the changes here + tests. |
Description
#12221 added the option to set the security mode for querying Hive views to either DEFINER OR INVOKER, where previously Hive views were hardcoded to run in DEFINER mode only. This option was needed because the way Hive views are defined for many organizations did not require setting an owner for the view, which prevents the DEFINER security mode from working.
This PR addresses a bug that appears as a result of that change for a specific code path, where if using the legacy Hive view logic in INVOKER mode with a Hive view that has an owner, queries will fail with the error:
Query 20220919_184230_00013_9ndxr failed: owner cannot be present with runAsInvokerThe bug comes from not taking into account that a ConnectorViewDefinition cannot be created if running as invoker and an owner is set.
This change will avoid passing along the Hive view owner (if there is one) when creating a ConnectorViewDefinition to access a Hive view in INVOKER mode with the legacy code.
Fix
Hive connector
This change prevents an error when querying a Hive view using a specific set of configuration values
Related issues, pull requests, and links
Documentation
( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( ) Release notes entries required with the following suggested text: