You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by GitBox <gi...@apache.org> on 2022/03/20 05:26:53 UTC

[GitHub] [drill] kingswanwho opened a new pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

kingswanwho opened a new pull request #2499:
URL: https://github.com/apache/drill/pull/2499


   # [DRILL-8117](https://issues.apache.org/jira/browse/DRILL-8117): Clean up deprecated Apache code in Drill
   
   ## Description
   
   Cleaned up deprecated code of drill-common, due to some UT code of drill-exec referenced to drill-common, so the code of drill-exec was cleaned either.
   
   ## Documentation
   
   The replaced code references to the recommendation from the deprecated code comments.
   
   ## Testing
   
   N/A
   


-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] kingswanwho commented on a change in pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

Posted by GitBox <gi...@apache.org>.
kingswanwho commented on a change in pull request #2499:
URL: https://github.com/apache/drill/pull/2499#discussion_r836006194



##########
File path: exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java
##########
@@ -156,22 +159,25 @@ public void unauthorizedTarget() throws Exception {
 
   @Test
   public void invalidPolicy() throws Exception {
-    thrownException.expect(new UserExceptionMatcher(UserBitShared.DrillPBError.ErrorType.VALIDATION,
-        "Invalid impersonation policies."));
+    String query = "ALTER SYSTEM SET `%s`='%s'";

Review comment:
       Hi Paul, it does really help! I will replace all those hard-code by client in this PR, thanks!




-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] paul-rogers commented on a change in pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

Posted by GitBox <gi...@apache.org>.
paul-rogers commented on a change in pull request #2499:
URL: https://github.com/apache/drill/pull/2499#discussion_r833963288



##########
File path: exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java
##########
@@ -156,22 +159,25 @@ public void unauthorizedTarget() throws Exception {
 
   @Test
   public void invalidPolicy() throws Exception {
-    thrownException.expect(new UserExceptionMatcher(UserBitShared.DrillPBError.ErrorType.VALIDATION,
-        "Invalid impersonation policies."));
+    String query = "ALTER SYSTEM SET `%s`='%s'";

Review comment:
       Just picking one test file at random, here's an example of the idea: https://github.com/apache/drill/blob/master/exec/java-exec/src/test/java/org/apache/drill/exec/compile/TestLargeFileCompilation.java#L273
   
   It is not about the exception handling, which is fine. It's just about the busy-work of formatting the `ALTER SYSTEM SET` commands over and over.
   
   Again, without looking closely, I don't know if this test happens to use one of the two clients that have these methods. If not, then you have to do things the tedious way.




-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] kingswanwho commented on a change in pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

Posted by GitBox <gi...@apache.org>.
kingswanwho commented on a change in pull request #2499:
URL: https://github.com/apache/drill/pull/2499#discussion_r836006194



##########
File path: exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java
##########
@@ -156,22 +159,25 @@ public void unauthorizedTarget() throws Exception {
 
   @Test
   public void invalidPolicy() throws Exception {
-    thrownException.expect(new UserExceptionMatcher(UserBitShared.DrillPBError.ErrorType.VALIDATION,
-        "Invalid impersonation policies."));
+    String query = "ALTER SYSTEM SET `%s`='%s'";

Review comment:
       Hi Paul, it does really help! I will replace all those tedious work by client in this PR, thanks!




-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] paul-rogers commented on a change in pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

Posted by GitBox <gi...@apache.org>.
paul-rogers commented on a change in pull request #2499:
URL: https://github.com/apache/drill/pull/2499#discussion_r832902877



##########
File path: exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java
##########
@@ -156,22 +159,25 @@ public void unauthorizedTarget() throws Exception {
 
   @Test
   public void invalidPolicy() throws Exception {
-    thrownException.expect(new UserExceptionMatcher(UserBitShared.DrillPBError.ErrorType.VALIDATION,
-        "Invalid impersonation policies."));
+    String query = "ALTER SYSTEM SET `%s`='%s'";

Review comment:
       We have methods that do this work: it is very common. Maybe the required clients are not available in this particular test?




-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] kingswanwho commented on a change in pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

Posted by GitBox <gi...@apache.org>.
kingswanwho commented on a change in pull request #2499:
URL: https://github.com/apache/drill/pull/2499#discussion_r836006194



##########
File path: exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java
##########
@@ -156,22 +159,25 @@ public void unauthorizedTarget() throws Exception {
 
   @Test
   public void invalidPolicy() throws Exception {
-    thrownException.expect(new UserExceptionMatcher(UserBitShared.DrillPBError.ErrorType.VALIDATION,
-        "Invalid impersonation policies."));
+    String query = "ALTER SYSTEM SET `%s`='%s'";

Review comment:
       Hi Paul, it does really help! I will replace all those hard-code in my PR by client  thanks!




-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [drill] kingswanwho commented on a change in pull request #2499: DRILL-8117: Clean up deprecated Apache code in Drill

Posted by GitBox <gi...@apache.org>.
kingswanwho commented on a change in pull request #2499:
URL: https://github.com/apache/drill/pull/2499#discussion_r833325247



##########
File path: exec/java-exec/src/test/java/org/apache/drill/exec/impersonation/TestInboundImpersonation.java
##########
@@ -156,22 +159,25 @@ public void unauthorizedTarget() throws Exception {
 
   @Test
   public void invalidPolicy() throws Exception {
-    thrownException.expect(new UserExceptionMatcher(UserBitShared.DrillPBError.ErrorType.VALIDATION,
-        "Invalid impersonation policies."));
+    String query = "ALTER SYSTEM SET `%s`='%s'";

Review comment:
       Hi Paul,
   Greetings to you!
   I did this because the UT code in Drill used `ExpectedException thrown = ExpectedException.none();`
   for ExpectedException instantiation.
   However the method `ExpectedException.none()` has been deprecated, so I replaced `ExpectedException.none()` by `Assert.assertThrows` as the [deprecation notice](https://junit.org/junit4/javadoc/latest/org/junit/rules/ExpectedException.html#none()) suggested.
   Could you please give some suggestions will be really appreciated.
   Best,
   Jingchuan




-- 
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: dev-unsubscribe@drill.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org