You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by "packyan (via GitHub)" <gi...@apache.org> on 2023/08/08 11:20:12 UTC
[GitHub] [kyuubi] packyan opened a new pull request, #5143: [AUTHZ] More test cases for function privileges building
packyan opened a new pull request, #5143:
URL: https://github.com/apache/kyuubi/pull/5143
<!--
Thanks for sending a pull request!
Here are some tips for you:
1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/CONTRIBUTING.html
2. If the PR is related to an issue in https://github.com/apache/kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'.
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'.
-->
### _Why are the changes needed?_
<!--
Please clarify why the changes are needed. For instance,
1. If you add a feature, you can talk about the use case of it.
2. If you fix a bug, you can clarify why it is a bug.
-->
### _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.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1295995932
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -59,7 +63,7 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
}
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = getClass.getSimpleName + "_2"
Review Comment:
Then you may use `OBJECT_NAME_SEPARATOR` for assembling this.
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [AUTHZ] More test cases for function privileges building [kyuubi]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #5143: [AUTHZ] More test cases for function privileges building
URL: https://github.com/apache/kyuubi/pull/5143
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1294424629
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -59,7 +63,7 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
}
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = getClass.getSimpleName + "_2"
Review Comment:
Is this a necessary change?
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -104,12 +108,127 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
spark.stop()
super.afterAll()
}
+
+ val HIVE_MASK_HASH_CLASS = "org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskHash"
+ val HIVE_FUNCTION_NAME_BASE = "hive_func"
+ val OBJECT_NAME_SEPARATOR = "_"
+
+ protected def checkFunctions(sql: String, count: Int, spark: SparkSession): Unit = {
+ val funcNames = ArrayBuffer.empty[String]
+ for (index <- 0.until(count)) {
+ funcNames.append(s"${if (index % 2 == 0) reusedDb else reusedDb2}" +
+ s".$HIVE_FUNCTION_NAME_BASE$OBJECT_NAME_SEPARATOR$index")
Review Comment:
Suggested to use placeholder brackets for better readability.
=> s".${HIVE_FUNCTION_NAME_BASE}${OBJECT_NAME_SEPARATOR}$index"
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -104,12 +108,127 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
spark.stop()
super.afterAll()
}
+
+ val HIVE_MASK_HASH_CLASS = "org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskHash"
+ val HIVE_FUNCTION_NAME_BASE = "hive_func"
+ val OBJECT_NAME_SEPARATOR = "_"
+
+ protected def checkFunctions(sql: String, count: Int, spark: SparkSession): Unit = {
+ val funcNames = ArrayBuffer.empty[String]
+ for (index <- 0.until(count)) {
+ funcNames.append(s"${if (index % 2 == 0) reusedDb else reusedDb2}" +
+ s".$HIVE_FUNCTION_NAME_BASE$OBJECT_NAME_SEPARATOR$index")
+ }
Review Comment:
Generating funcNames in a single block would be more readable.
```
val funcNames = {
...
}
```
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1296026452
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -58,8 +60,12 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
checkColumns(sql(query).queryExecution.optimizedPlan, cols)
}
+ protected val HIVE_MASK_HASH_CLASS = "org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskHash"
+ protected val HIVE_FUNCTION_NAME_BASE = "hive_func"
+ protected val OBJECT_NAME_SEPARATOR = "_"
+
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = s"${getClass.getSimpleName}${OBJECT_NAME_SEPARATOR}2"
Review Comment:
```suggestion
protected val reusedDb2: String = s"${getClass.getSimpleName}${OBJECT_NAME_SEPARATOR}2"
```
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] codecov-commenter commented on pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#issuecomment-1680751526
## [Codecov](https://app.codecov.io/gh/apache/kyuubi/pull/5143?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#5143](https://app.codecov.io/gh/apache/kyuubi/pull/5143?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (76d5e5a) into [master](https://app.codecov.io/gh/apache/kyuubi/commit/0a04f083942d86c29b67e2dcbfc0fc0961a166dc?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (0a04f08) will **not change** coverage.
> Report is 17 commits behind head on master.
> The diff coverage is `n/a`.
> :exclamation: Current head 76d5e5a differs from pull request most recent head 68c043c. Consider uploading reports for the commit 68c043c to get more accurate results
```diff
@@ Coverage Diff @@
## master #5143 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 566 566
Lines 31601 31601
Branches 4120 4120
======================================
Misses 31601 31601
```
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] yaooqinn commented on pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#issuecomment-1678710894
cc @bowenliang123
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1296024845
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -58,8 +60,12 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
checkColumns(sql(query).queryExecution.optimizedPlan, cols)
}
+ protected val HIVE_MASK_HASH_CLASS = "org.apache.hadoop.hive.ql.udf.generic.GenericUDFMaskHash"
+ protected val HIVE_FUNCTION_NAME_BASE = "hive_func"
+ protected val OBJECT_NAME_SEPARATOR = "_"
+
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = getClass.getSimpleName + s"${OBJECT_NAME_SEPARATOR}2"
Review Comment:
```suggestion
protected val reusedDb2: String = s"${getClass.getSimpleName}${OBJECT_NAME_SEPARATOR}2"
```
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] bowenliang123 commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "bowenliang123 (via GitHub)" <gi...@apache.org>.
bowenliang123 commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1295995932
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -59,7 +63,7 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
}
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = getClass.getSimpleName + "_2"
Review Comment:
Then you may use `OBJECT_NAME_SEPARATOR` explicitly for assembling this.
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] packyan commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "packyan (via GitHub)" <gi...@apache.org>.
packyan commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1295993905
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -59,7 +63,7 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
}
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = getClass.getSimpleName + "_2"
Review Comment:
> Is this a necessary change?
As I use `_` as separator, this is necessary.
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
[GitHub] [kyuubi] packyan commented on a diff in pull request #5143: [AUTHZ] More test cases for function privileges building
Posted by "packyan (via GitHub)" <gi...@apache.org>.
packyan commented on code in PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#discussion_r1295993905
##########
extensions/spark/kyuubi-spark-authz/src/test/scala/org/apache/kyuubi/plugin/spark/authz/FunctionPrivilegesBuilderSuite.scala:
##########
@@ -59,7 +63,7 @@ abstract class FunctionPrivilegesBuilderSuite extends AnyFunSuite
}
protected val reusedDb: String = getClass.getSimpleName
- protected val reusedDb2: String = getClass.getSimpleName + "2"
+ protected val reusedDb2: String = getClass.getSimpleName + "_2"
Review Comment:
> Is this a necessary change?
As I use `_` as separator, this is necessary
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org
Re: [PR] [AUTHZ] More test cases for function privileges building [kyuubi]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5143:
URL: https://github.com/apache/kyuubi/pull/5143#issuecomment-2800210650
Thanks for the PR! This PR is being closed due to inactivity. This isn't a judgement on the merit of the PR in any way. If this is still an issue with the latest version of Kyuubi, please reopen it and ask a committer to remove the Stale tag!
Thank you for using Kyuubi!
--
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: notifications-unsubscribe@kyuubi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org