You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "XieJiann (via GitHub)" <gi...@apache.org> on 2023/08/21 08:06:11 UTC
[GitHub] [doris] XieJiann opened a new pull request, #23257: [feature](Nereids)add encryptKey
XieJiann opened a new pull request, #23257:
URL: https://github.com/apache/doris/pull/23257
## Proposed changes
add select key
```
- CREATE ENCRYPTKEY key_name AS "key_string"
- select key my_key
+-----------------------------+
| encryptKeyRef('', 'my_key') |
+-----------------------------+
| ABCD123456789 |
+-----------------------------+
```
<!--Describe your changes.-->
## 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] XieJiann commented on pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1691002848
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] morrySnow commented on a diff in pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "morrySnow (via GitHub)" <gi...@apache.org>.
morrySnow commented on code in PR #23257:
URL: https://github.com/apache/doris/pull/23257#discussion_r1301111310
##########
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -612,6 +613,7 @@ nonReserved
| INTO
| IS
| ITEMS
+ | KEY
Review Comment:
key is a reserve keyword, should not put in nonReserved list
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilder.java:
##########
@@ -1101,6 +1101,17 @@ public UnboundFunction visitExtract(DorisParser.ExtractContext ctx) {
});
}
+ @Override
+ public Expression visitEncryptKey(DorisParser.EncryptKeyContext ctx) {
+ Expression db = new StringLiteral("");
+ if (ctx.dbName != null) {
+ db = new StringLiteral(ctx.dbName.getText());
+ }
+ Expression keyName = new StringLiteral(ctx.keyName.getText());
+ return new UnboundFunction("encryptKeyRef", false,
+ ImmutableList.of(db, keyName));
Review Comment:
return `new EncryptKeyRef(....);` is ok
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java:
##########
@@ -107,6 +113,23 @@ public Expression visitLiteral(Literal literal, ExpressionRewriteContext context
return literal;
}
+ @Override
+ public Expression visitEncryptKeyRef(EncryptKeyRef encryptKeyRef, ExpressionRewriteContext context) {
+ String dbName = encryptKeyRef.getDbName();
+ ConnectContext connectContext = ConnectContext.get();
+ if (Strings.isNullOrEmpty(dbName)) {
+ dbName = connectContext.getDatabase();
+ }
+ Preconditions.checkArgument(!"".equals(dbName), "DB " + dbName + "not found");
Review Comment:
throw `AnalysisException` directly
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java:
##########
@@ -107,6 +113,23 @@ public Expression visitLiteral(Literal literal, ExpressionRewriteContext context
return literal;
}
+ @Override
+ public Expression visitEncryptKeyRef(EncryptKeyRef encryptKeyRef, ExpressionRewriteContext context) {
+ String dbName = encryptKeyRef.getDbName();
+ ConnectContext connectContext = ConnectContext.get();
+ if (Strings.isNullOrEmpty(dbName)) {
+ dbName = connectContext.getDatabase();
+ }
+ Preconditions.checkArgument(!"".equals(dbName), "DB " + dbName + "not found");
+ dbName = ClusterNamespace.getFullName(connectContext.getClusterName(), dbName);
+ org.apache.doris.catalog.Database database =
+ Env.getCurrentEnv().getInternalCatalog().getDbNullable(dbName);
+ Preconditions.checkArgument(database != null, "DB " + dbName + "not found");
Review Comment:
throw AnalysisException directly
##########
fe/fe-core/src/main/java/org/apache/doris/catalog/BuiltinScalarFunctions.java:
##########
@@ -463,6 +464,7 @@ public class BuiltinScalarFunctions implements FunctionHelper {
scalar(ElementExtract.class, "%element_extract%"),
scalar(ElementSlice.class, "%element_slice%"),
scalar(Elt.class, "elt"),
+ scalar(EncryptKeyRef.class, "encryptKeyRef"),
Review Comment:
should not put this function in function list
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/FoldConstantRuleOnFE.java:
##########
@@ -107,6 +113,23 @@ public Expression visitLiteral(Literal literal, ExpressionRewriteContext context
return literal;
}
+ @Override
+ public Expression visitEncryptKeyRef(EncryptKeyRef encryptKeyRef, ExpressionRewriteContext context) {
+ String dbName = encryptKeyRef.getDbName();
+ ConnectContext connectContext = ConnectContext.get();
+ if (Strings.isNullOrEmpty(dbName)) {
+ dbName = connectContext.getDatabase();
+ }
+ Preconditions.checkArgument(!"".equals(dbName), "DB " + dbName + "not found");
+ dbName = ClusterNamespace.getFullName(connectContext.getClusterName(), dbName);
+ org.apache.doris.catalog.Database database =
+ Env.getCurrentEnv().getInternalCatalog().getDbNullable(dbName);
+ Preconditions.checkArgument(database != null, "DB " + dbName + "not found");
+ EncryptKey encryptKey = database.getEncryptKey(encryptKeyRef.getEncryptKeyName());
+ Preconditions.checkArgument(encryptKey != null, "Can not found encryptKey" + encryptKeyRef.getEncryptKeyName());
Review Comment:
throw AnalysisException directly
##########
fe/fe-core/src/main/antlr4/org/apache/doris/nereids/DorisParser.g4:
##########
@@ -373,6 +373,7 @@ primaryExpression
| identifier #columnReference
| base=primaryExpression DOT fieldName=identifier #dereference
| LEFT_PAREN expression RIGHT_PAREN #parenthesizedExpression
+ | KEY (dbName=identifier DOT)? keyName=identifier #encryptKey
Review Comment:
align #xxxx
--
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 #23257: [feature](Nereids) support `select key encryptKey`
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1686168174
(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.81 seconds
stream load tsv: 541 seconds loaded 74807831229 Bytes, about 131 MB/s
stream load json: 21 seconds loaded 2358488459 Bytes, about 107 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.3 seconds inserted 10000000 Rows, about 341K ops/s
storage size: 17162071129 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] hello-stephen commented on pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1691026520
(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.32 seconds
stream load tsv: 545 seconds loaded 74807831229 Bytes, about 130 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.4 seconds inserted 10000000 Rows, about 340K ops/s
storage size: 17162084846 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 #23257: [feature](Nereids) support `select key encryptKey`
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1692699971
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 #23257: [feature](Nereids) support `select key encryptKey`
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1692699993
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] XieJiann commented on pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1692877652
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] XieJiann commented on pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1685850942
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] XieJiann commented on pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1686112501
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 #23257: [feature](Nereids) support `select key encryptKey`
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1691227519
(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 45.74 seconds
stream load tsv: 540 seconds loaded 74807831229 Bytes, about 132 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 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.6 seconds inserted 10000000 Rows, about 337K ops/s
storage size: 17161998230 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] XieJiann commented on pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "XieJiann (via GitHub)" <gi...@apache.org>.
XieJiann commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1691180458
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 #23257: [feature](Nereids) support `select key encryptKey`
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1692912322
(From new machine)TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 47.43 seconds
stream load tsv: 538 seconds loaded 74807831229 Bytes, about 132 MB/s
stream load json: 20 seconds loaded 2358488459 Bytes, about 112 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.5 seconds inserted 10000000 Rows, about 338K ops/s
storage size: 17161873934 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 #23257: [feature](Nereids) support `select key encryptKey`
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #23257:
URL: https://github.com/apache/doris/pull/23257#issuecomment-1694899365
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] jackwener merged pull request #23257: [feature](Nereids) support `select key encryptKey`
Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener merged PR #23257:
URL: https://github.com/apache/doris/pull/23257
--
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