You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[KYUUBI #2650] Add FilteredShowColumnsCommand to AuthZ module
### _Why are the changes needed?_
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes#2650 from zhangrenhua/feature/AddFilteredShowColumnsCommand.
Closes#2650842a00e [zhangrenhua] Add FilteredShowColumnsCommand to AuthZ module
Authored-by: zhangrenhua <zhangrenhuaman@senses-ai.com>
Signed-off-by: Kent Yao <yao@apache.org>
Copy file name to clipboardExpand all lines: extensions/spark/kyuubi-spark-authz/src/main/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RuleReplaceShowObjectCommands.scala
Copy file name to clipboardExpand all lines: extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/ranger/RangerSparkExtensionSuite.scala
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -316,6 +316,26 @@ abstract class RangerSparkExtensionSuite extends KyuubiFunSuite with SparkSessio
316
316
doAs("admin", sql(s"DROP DATABASE IF EXISTS $db3"))
317
317
}
318
318
}
319
+
320
+
test("show columns") {
321
+
valdb="default"
322
+
valtable="src"
323
+
valcol="key"
324
+
valcreate=s"CREATE TABLE IF NOT EXISTS $db.$table ($col int, value int) USING $format"
325
+
try {
326
+
doAs("admin", sql(create))
327
+
328
+
doAs("admin", assert(sql(s"SHOW COLUMNS IN $table").count() ==2))
329
+
doAs("admin", assert(sql(s"SHOW COLUMNS IN $db.$table").count() ==2))
330
+
doAs("admin", assert(sql(s"SHOW COLUMNS IN $table IN $db").count() ==2))
331
+
332
+
doAs("kent", assert(sql(s"SHOW COLUMNS IN $table").count() ==1))
333
+
doAs("kent", assert(sql(s"SHOW COLUMNS IN $db.$table").count() ==1))
334
+
doAs("kent", assert(sql(s"SHOW COLUMNS IN $table IN $db").count() ==1))
335
+
} finally {
336
+
doAs("admin", sql(s"DROP TABLE IF EXISTS $db.$table"))
0 commit comments