Skip to content

Commit

Permalink
[KYUUBI #5255] Add an optional comment field to the authz specs for b…
Browse files Browse the repository at this point in the history
…etter recognition

# 🔍 Description
## Issue References 🔗

This pull request fixes #5255

## Describe Your Solution 🔧

Add Optional comment field for desc, so that we can get information when the command from third party

## Types of changes 🔖

- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Test Plan 🧪

#### Behavior Without This Pull Request ⚰️

#### Behavior With This Pull Request 🎉

#### Related Unit Tests

---

# Checklists
## 📝 Author Self Checklist

- [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project
- [x] I have performed a self-review
- [x] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html)

## 📝 Committer Pre-Merge Checklist

- [x] Pull request title is okay.
- [x] No license issues.
- [x] Milestone correctly set?
- [x] Test coverage is ok
- [x] Assignees are selected.
- [x] Minimum number of approvals
- [x] No changes are requested

**Be nice. Be informative.**

Closes #5706 from davidyuan1223/add_option_comment_for_authz.

Closes #5255

46234e1 [davidyuan] bugfix
b9166bd [davidyuan] bugfix
2d4b920 [davidyuan] regenerate json file
a125ee4 [david yuan] Merge branch 'master' into add_option_comment_for_authz
80eb9ff [davidyuan] json file bug fix
bc6ec38 [davidyuan] style fix
b2527a5 [davidyuan] Merge remote-tracking branch 'origin/add_option_comment_for_authz' into add_option_comment_for_authz
682727d [davidyuan] bugfix
d79a38f [david yuan] Merge branch 'master' into add_option_comment_for_authz
6fed8b0 [davidyuan] issue #5255
e48c5a0 [davidyuan] issue #5255

Lead-authored-by: davidyuan <[email protected]>
Co-authored-by: david yuan <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
  • Loading branch information
davidyuan1223 authored and yaooqinn committed Nov 27, 2023
1 parent 5481bf5 commit c8f4e9c
Show file tree
Hide file tree
Showing 8 changed files with 736 additions and 375 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"fieldName" : "child",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "ALTERDATABASE",
"uriDescs" : [ ]
Expand All @@ -14,34 +15,40 @@
"fieldName" : "name",
"fieldExtractor" : "ResolvedDBObjectNameDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
}, {
"fieldName" : "namespace",
"fieldExtractor" : "StringSeqDatabaseExtractor",
"catalogDesc" : {
"fieldName" : "catalog",
"fieldExtractor" : "CatalogPluginCatalogExtractor"
"fieldExtractor" : "CatalogPluginCatalogExtractor",
"comment" : ""
},
"isInput" : false
"isInput" : false,
"comment" : ""
}, {
"fieldName" : "name",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "CREATEDATABASE",
"uriDescs" : [ {
"fieldName" : "properties",
"fieldExtractor" : "PropertiesLocationUriExtractor",
"isInput" : false
"isInput" : false,
"comment" : ""
} ]
}, {
"classname" : "org.apache.spark.sql.catalyst.plans.logical.DescribeNamespace",
"databaseDescs" : [ {
"fieldName" : "namespace",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "DESCDATABASE",
"uriDescs" : [ ]
Expand All @@ -51,7 +58,8 @@
"fieldName" : "namespace",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "DROPDATABASE",
"uriDescs" : [ ]
Expand All @@ -61,20 +69,24 @@
"fieldName" : "child",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
}, {
"fieldName" : "child",
"fieldExtractor" : "ResolvedDBObjectNameDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
}, {
"fieldName" : "namespace",
"fieldExtractor" : "StringSeqOptionDatabaseExtractor",
"catalogDesc" : {
"fieldName" : "catalogName",
"fieldExtractor" : "StringOptionCatalogExtractor"
"fieldExtractor" : "StringOptionCatalogExtractor",
"comment" : ""
},
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "SWITCHDATABASE",
"uriDescs" : [ ]
Expand All @@ -84,21 +96,24 @@
"fieldName" : "namespace",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "ALTERDATABASE_LOCATION",
"uriDescs" : [ {
"fieldName" : "location",
"fieldExtractor" : "StringURIExtractor",
"isInput" : false
"isInput" : false,
"comment" : ""
} ]
}, {
"classname" : "org.apache.spark.sql.catalyst.plans.logical.SetNamespaceProperties",
"databaseDescs" : [ {
"fieldName" : "namespace",
"fieldExtractor" : "ResolvedNamespaceDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "ALTERDATABASE",
"uriDescs" : [ ]
Expand All @@ -108,7 +123,8 @@
"fieldName" : "databaseName",
"fieldExtractor" : "StringDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "ALTERDATABASE",
"uriDescs" : [ ]
Expand All @@ -118,21 +134,24 @@
"fieldName" : "databaseName",
"fieldExtractor" : "StringDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "ALTERDATABASE_LOCATION",
"uriDescs" : [ {
"fieldName" : "location",
"fieldExtractor" : "StringURIExtractor",
"isInput" : false
"isInput" : false,
"comment" : ""
} ]
}, {
"classname" : "org.apache.spark.sql.execution.command.AnalyzeTablesCommand",
"databaseDescs" : [ {
"fieldName" : "databaseName",
"fieldExtractor" : "StringOptionDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "ANALYZE_TABLE",
"uriDescs" : [ ]
Expand All @@ -142,21 +161,24 @@
"fieldName" : "databaseName",
"fieldExtractor" : "StringDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "CREATEDATABASE",
"uriDescs" : [ {
"fieldName" : "path",
"fieldExtractor" : "StringURIExtractor",
"isInput" : false
"isInput" : false,
"comment" : ""
} ]
}, {
"classname" : "org.apache.spark.sql.execution.command.DescribeDatabaseCommand",
"databaseDescs" : [ {
"fieldName" : "databaseName",
"fieldExtractor" : "StringDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "DESCDATABASE",
"uriDescs" : [ ]
Expand All @@ -166,7 +188,8 @@
"fieldName" : "databaseName",
"fieldExtractor" : "StringDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "DROPDATABASE",
"uriDescs" : [ ]
Expand All @@ -176,7 +199,8 @@
"fieldName" : "databaseName",
"fieldExtractor" : "StringDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "SWITCHDATABASE",
"uriDescs" : [ ]
Expand All @@ -186,8 +210,9 @@
"fieldName" : "namespace",
"fieldExtractor" : "StringSeqDatabaseExtractor",
"catalogDesc" : null,
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "SWITCHDATABASE",
"uriDescs" : [ ]
} ]
} ]
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,29 @@
"functionTypeDesc" : {
"fieldName" : "isTemp",
"fieldExtractor" : "TempMarkerFunctionTypeExtractor",
"skipTypes" : [ "TEMP" ]
"skipTypes" : [ "TEMP" ],
"comment" : ""
},
"isInput" : false
"isInput" : false,
"comment" : ""
}, {
"fieldName" : "functionName",
"fieldExtractor" : "StringFunctionExtractor",
"databaseDesc" : {
"fieldName" : "databaseName",
"fieldExtractor" : "StringOptionDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
},
"functionTypeDesc" : {
"fieldName" : "isTemp",
"fieldExtractor" : "TempMarkerFunctionTypeExtractor",
"skipTypes" : [ "TEMP" ]
"skipTypes" : [ "TEMP" ],
"comment" : ""
},
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "CREATEFUNCTION"
}, {
Expand All @@ -36,19 +41,23 @@
"functionTypeDesc" : {
"fieldName" : "info",
"fieldExtractor" : "ExpressionInfoFunctionTypeExtractor",
"skipTypes" : [ "TEMP", "SYSTEM" ]
"skipTypes" : [ "TEMP", "SYSTEM" ],
"comment" : ""
},
"isInput" : true
"isInput" : true,
"comment" : ""
}, {
"fieldName" : "functionName",
"fieldExtractor" : "FunctionIdentifierFunctionExtractor",
"databaseDesc" : null,
"functionTypeDesc" : {
"fieldName" : "functionName",
"fieldExtractor" : "FunctionIdentifierFunctionTypeExtractor",
"skipTypes" : [ "TEMP", "SYSTEM" ]
"skipTypes" : [ "TEMP", "SYSTEM" ],
"comment" : ""
},
"isInput" : true
"isInput" : true,
"comment" : ""
} ],
"opType" : "DESCFUNCTION"
}, {
Expand All @@ -60,24 +69,29 @@
"functionTypeDesc" : {
"fieldName" : "isTemp",
"fieldExtractor" : "TempMarkerFunctionTypeExtractor",
"skipTypes" : [ "TEMP" ]
"skipTypes" : [ "TEMP" ],
"comment" : ""
},
"isInput" : false
"isInput" : false,
"comment" : ""
}, {
"fieldName" : "functionName",
"fieldExtractor" : "StringFunctionExtractor",
"databaseDesc" : {
"fieldName" : "databaseName",
"fieldExtractor" : "StringOptionDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
},
"functionTypeDesc" : {
"fieldName" : "isTemp",
"fieldExtractor" : "TempMarkerFunctionTypeExtractor",
"skipTypes" : [ "TEMP" ]
"skipTypes" : [ "TEMP" ],
"comment" : ""
},
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "DROPFUNCTION"
}, {
Expand All @@ -89,10 +103,12 @@
"fieldName" : "databaseName",
"fieldExtractor" : "StringOptionDatabaseExtractor",
"catalogDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
},
"functionTypeDesc" : null,
"isInput" : false
"isInput" : false,
"comment" : ""
} ],
"opType" : "RELOADFUNCTION"
} ]
} ]
Loading

0 comments on commit c8f4e9c

Please sign in to comment.