You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/25 11:34:52 UTC

[GitHub] [incubator-doris] stalary opened a new pull request, #9778: [Bug] sql block rule npe

stalary opened a new pull request, #9778:
URL: https://github.com/apache/incubator-doris/pull/9778

   # Proposed changes
   
   Issue Number: close https://github.com/apache/incubator-doris/issues/9749
   
   ## Problem Summary:
   
   Describe the overview of changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: (Yes/No/I Don't know)
   2. Has unit tests been added: (Yes/No/No Need)
   3. Has document been added or modified: (Yes/No/No Need)
   4. Does it need to update dependencies: (Yes/No)
   5. Are there any changes that cannot be rolled back: (Yes/No)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] stalary commented on a diff in pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
stalary commented on code in PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#discussion_r882264423


##########
regression-test/suites/sql_block_rule/test_sql_block_rule.groovy:
##########
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_sql_block_rule", "sql_block_rule") {
+    sql """
+                USE regression_test
+              """
+
+    sql """
+                CREATE SQL_BLOCK_RULE test_rule_sql
+                PROPERTIES("sql"="SELECT \\\\* FROM table_2", "global"= "true", "enable"= "true")
+              """
+
+    test {
+        sql "SELECT * FROM table_2"
+        exception "sql match regex sql block rule: test_rule_sql"
+    }
+
+    sql """
+                DROP SQL_BLOCK_RULE test_rule_sql
+              """
+
+    sql """
+                CREATE SQL_BLOCK_RULE test_rule_num
+                PROPERTIES("tablet_num"="1", "global"= "true", "enable"= "true")
+              """
+
+    test {
+        sql "SELECT * FROM table_2"
+        exception "sql hits sql block rule: test_rule_num, reach tablet_num : 1"
+    }
+
+    qt_select """
+                SHOW SQL_BLOCK_RULE
+              """
+
+    sql """
+                DROP SQL_BLOCK_RULE test_rule_num
+              """
+

Review Comment:
   Ok, I'm going to add it.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] carlvinhust2012 commented on a diff in pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
carlvinhust2012 commented on code in PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#discussion_r882261551


##########
regression-test/suites/sql_block_rule/test_sql_block_rule.groovy:
##########
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_sql_block_rule", "sql_block_rule") {
+    sql """
+                USE regression_test
+              """
+
+    sql """
+                CREATE SQL_BLOCK_RULE test_rule_sql
+                PROPERTIES("sql"="SELECT \\\\* FROM table_2", "global"= "true", "enable"= "true")
+              """
+
+    test {
+        sql "SELECT * FROM table_2"
+        exception "sql match regex sql block rule: test_rule_sql"
+    }
+
+    sql """
+                DROP SQL_BLOCK_RULE test_rule_sql
+              """
+
+    sql """
+                CREATE SQL_BLOCK_RULE test_rule_num
+                PROPERTIES("tablet_num"="1", "global"= "true", "enable"= "true")
+              """
+
+    test {
+        sql "SELECT * FROM table_2"
+        exception "sql hits sql block rule: test_rule_num, reach tablet_num : 1"
+    }
+
+    qt_select """
+                SHOW SQL_BLOCK_RULE
+              """
+
+    sql """
+                DROP SQL_BLOCK_RULE test_rule_num
+              """
+

Review Comment:
   Add a normal case maybe better.



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#issuecomment-1139234140

   PR approved by anyone and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#issuecomment-1139234123

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman merged pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
morningman merged PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] stalary commented on a diff in pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
stalary commented on code in PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#discussion_r882263977


##########
fe/fe-core/src/main/java/org/apache/doris/blockrule/SqlBlockRule.java:
##########
@@ -33,12 +34,13 @@
 import java.util.List;
 import java.util.regex.Pattern;
 
+/**
+ * Use for block some sql by rule.
+ **/
 public class SqlBlockRule implements Writable {
 
     public static final String NAME_TYPE = "SQL BLOCK RULE NAME";
 
-    public static final String DEFAULT_USER = "default";

Review Comment:
   DEFAULT_USER is used only when the first designed, and then defined with global, it is no longer needed



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] morningman commented on a diff in pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#discussion_r884049148


##########
regression-test/conf/regression-conf.groovy:
##########
@@ -28,7 +28,7 @@ feHttpAddress = "127.0.0.1:8030"
 feHttpUser = "root"
 feHttpPassword = ""
 
-beHttpAddress = "127.0.0.1:8040"
+beHttpAddress = "192.168.120.12:8140"

Review Comment:
   don't change 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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] carlvinhust2012 commented on a diff in pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
carlvinhust2012 commented on code in PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#discussion_r882262763


##########
fe/fe-core/src/main/java/org/apache/doris/blockrule/SqlBlockRule.java:
##########
@@ -33,12 +34,13 @@
 import java.util.List;
 import java.util.regex.Pattern;
 
+/**
+ * Use for block some sql by rule.
+ **/
 public class SqlBlockRule implements Writable {
 
     public static final String NAME_TYPE = "SQL BLOCK RULE NAME";
 
-    public static final String DEFAULT_USER = "default";

Review Comment:
   why delete this line?



-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] github-actions[bot] commented on pull request #9778: [Bug] sql block rule npe

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#issuecomment-1140133109

   PR approved by at least one committer and no changes requested.


-- 
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: commits-unsubscribe@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org