You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "zddr (via GitHub)" <gi...@apache.org> on 2023/08/04 23:57:29 UTC

[GitHub] [doris] zddr opened a new pull request, #22629: [feature](auth)support Col auth

zddr opened a new pull request, #22629:
URL: https://github.com/apache/doris/pull/22629

   ## Proposed changes
   
   Issue Number: close #xxx
   
   support `GRANT privilege[(col1,col2...)] [, privilege] ON db.tbl TO user_identity [ROLE 'role'];`
   
   ## 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] [doris] zddr commented on a diff in pull request #22629: [feature](auth)support Col auth

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on code in PR #22629:
URL: https://github.com/apache/doris/pull/22629#discussion_r1287226237


##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivPredicate.java:
##########
@@ -110,6 +110,18 @@ public Operator getOp() {
         return op;
     }
 
+    // Determine which column Privilege correspond to PrivPredicate
+    //The current logic is to include a SELECT_ PRIV returns SELECT_ PRIV, if load is included_ PRIV returns LOAD_ PRIV,
+    // the order cannot be reversed
+    public Privilege getColPrivilege() {
+        if (privs.get(Privilege.SELECT_PRIV.getIdx())) {
+            return Privilege.SELECT_PRIV;
+        } else if (privs.get(Privilege.LOAD_PRIV.getIdx())) {
+            return Privilege.LOAD_PRIV;
+        }
+        return null;

Review Comment:
   return Optional



-- 
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] [doris] morningman commented on a diff in pull request #22629: [feature](auth)support Col auth

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman commented on code in PR #22629:
URL: https://github.com/apache/doris/pull/22629#discussion_r1287118272


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/GrantStmt.java:
##########
@@ -48,21 +55,24 @@ public class GrantStmt extends DdlStmt {
     private TablePattern tblPattern;
     private ResourcePattern resourcePattern;
     private WorkloadGroupPattern workloadGroupPattern;
-    private List<Privilege> privileges;
+    private Set<Privilege> privileges = Sets.newHashSet();
+    private Map<ColPrivilegeKey, Set<String>> colPrivileges = Maps.newHashMap();

Review Comment:
   Add comment to explain the key and value of this map



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/GrantStmt.java:
##########
@@ -48,21 +55,24 @@ public class GrantStmt extends DdlStmt {
     private TablePattern tblPattern;
     private ResourcePattern resourcePattern;
     private WorkloadGroupPattern workloadGroupPattern;
-    private List<Privilege> privileges;
+    private Set<Privilege> privileges = Sets.newHashSet();
+    private Map<ColPrivilegeKey, Set<String>> colPrivileges = Maps.newHashMap();
     // Indicates that these roles are granted to a user
     private List<String> roles;
+    List<AccessPrivilegeWithCols> accessPrivileges;

Review Comment:
   ```suggestion
       private List<AccessPrivilegeWithCols> accessPrivileges;
   ```



##########
fe/fe-core/src/main/java/org/apache/doris/mysql/privilege/PrivPredicate.java:
##########
@@ -110,6 +110,18 @@ public Operator getOp() {
         return op;
     }
 
+    // Determine which column Privilege correspond to PrivPredicate
+    //The current logic is to include a SELECT_ PRIV returns SELECT_ PRIV, if load is included_ PRIV returns LOAD_ PRIV,
+    // the order cannot be reversed
+    public Privilege getColPrivilege() {
+        if (privs.get(Privilege.SELECT_PRIV.getIdx())) {
+            return Privilege.SELECT_PRIV;
+        } else if (privs.get(Privilege.LOAD_PRIV.getIdx())) {
+            return Privilege.LOAD_PRIV;
+        }
+        return null;

Review Comment:
   Better not return null?
   Consider to add a new enum, such as UNKNOWN or something



-- 
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] [doris] hello-stephen commented on pull request #22629: [feature](auth)support Col auth

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1676176116

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 46.47 seconds
    stream load tsv:          509 seconds loaded 74807831229 Bytes, about 140 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          29.2 seconds inserted 10000000 Rows, about 342K ops/s
    storage size: 17162100170 Bytes


-- 
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] [doris] zddr commented on pull request #22629: [feature](auth)support Col auth

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1666366307

   run buildall


-- 
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] [doris] hello-stephen commented on pull request #22629: [feature](auth)support Col auth

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1666376595

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 48.14 seconds
    stream load tsv:          536 seconds loaded 74807831229 Bytes, about 133 MB/s
    stream load json:         21 seconds loaded 2358488459 Bytes, about 107 MB/s
    stream load orc:          66 seconds loaded 1101869774 Bytes, about 15 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          29.2 seconds inserted 10000000 Rows, about 342K ops/s
    storage size: 17162548989 Bytes


-- 
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] [doris] zddr commented on pull request #22629: [feature](auth)support Col auth

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1669758021

   run buildall


-- 
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] [doris] yiguolei merged pull request #22629: [feature](auth)support Col auth

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #22629:
URL: https://github.com/apache/doris/pull/22629


-- 
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] [doris] zddr commented on pull request #22629: [feature](auth)support Col auth

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1676168702

   run buildall


-- 
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] [doris] yiguolei commented on pull request #22629: [feature](auth)support Col auth

Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1666355490

   run buildall


-- 
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] [doris] hello-stephen commented on pull request #22629: [feature](auth)support Col auth

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1669808191

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 44.78 seconds
    stream load tsv:          511 seconds loaded 74807831229 Bytes, about 139 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          32 seconds loaded 861443392 Bytes, about 25 MB/s
    insert into select:          29.3 seconds inserted 10000000 Rows, about 341K ops/s
    storage size: 17162502137 Bytes


-- 
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] [doris] github-actions[bot] commented on pull request #22629: [feature](auth)support Col auth

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1676380985

   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] [doris] github-actions[bot] commented on pull request #22629: [feature](auth)support Col auth

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1676381004

   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] [doris] zddr commented on pull request #22629: [feature](auth)support Col auth

Posted by "zddr (via GitHub)" <gi...@apache.org>.
zddr commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1674851275

   run buildall


-- 
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] [doris] hello-stephen commented on pull request #22629: [feature](auth)support Col auth

Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #22629:
URL: https://github.com/apache/doris/pull/22629#issuecomment-1674904218

   (From new machine)TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 45.52 seconds
    stream load tsv:          515 seconds loaded 74807831229 Bytes, about 138 MB/s
    stream load json:         20 seconds loaded 2358488459 Bytes, about 112 MB/s
    stream load orc:          65 seconds loaded 1101869774 Bytes, about 16 MB/s
    stream load parquet:          31 seconds loaded 861443392 Bytes, about 26 MB/s
    insert into select:          29.1 seconds inserted 10000000 Rows, about 343K ops/s
    storage size: 17162139946 Bytes


-- 
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