You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "gitccl (via GitHub)" <gi...@apache.org> on 2023/03/28 08:25:27 UTC
[GitHub] [doris] gitccl opened a new pull request, #18175: [vectorized](function) support array_first_index function
gitccl opened a new pull request, #18175:
URL: https://github.com/apache/doris/pull/18175
# Proposed changes
Issue Number: close #xxx
## Problem summary
```
mysql> select array_first_index(x->x+1>3, [2, 3, 4]);
+-------------------------------------------------------------------+
| array_first_index(array_map([x] -> x(0) + 1 > 3, ARRAY(2, 3, 4))) |
+-------------------------------------------------------------------+
| 2 |
+-------------------------------------------------------------------+
mysql> select array_first_index(x -> x is null, [null, 1, 2]);
+----------------------------------------------------------------------+
| array_first_index(array_map([x] -> x(0) IS NULL, ARRAY(NULL, 1, 2))) |
+----------------------------------------------------------------------+
| 1 |
+----------------------------------------------------------------------+
mysql> select array_first_index(x->power(x,2)>10, [1, 2, 3, 4]);
+---------------------------------------------------------------------------------+
| array_first_index(array_map([x] -> power(x(0), 2.0) > 10.0, ARRAY(1, 2, 3, 4))) |
+---------------------------------------------------------------------------------+
| 4 |
+---------------------------------------------------------------------------------+
```
## Checklist(Required)
* [ ] Does it affect the original behavior
* [ ] Has unit tests been added
* [X] Has document been added or modified
* [ ] Does it need to update dependencies
* [X] Is this PR support rollback (If NO, please explain WHY)
## 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] gitccl commented on a diff in pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on code in PR #18175:
URL: https://github.com/apache/doris/pull/18175#discussion_r1151562732
##########
gensrc/script/doris_builtins_functions.py:
##########
@@ -650,6 +649,8 @@
[['array_exists'], 'ARRAY_BOOLEAN', ['ARRAY_VARCHAR'], ''],
[['array_exists'], 'ARRAY_BOOLEAN', ['ARRAY_STRING'], ''],
+ [['array_first_index'], 'BIGINT', ['ARRAY_BOOLEAN'], 'ALWAYS_NULLABLE'],
+
Review Comment:
done
--
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] gitccl commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1490335737
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] gitccl commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1488145204
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] gitccl commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1487093394
Hi @zhangstar333, PTAL
--
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] gitccl commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1486444739
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] gitccl commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1490110109
run p0
--
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 #18175: [vectorized](function) support array_first_index function
Posted by "yiguolei (via GitHub)" <gi...@apache.org>.
yiguolei merged PR #18175:
URL: https://github.com/apache/doris/pull/18175
--
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] zhangstar333 commented on a diff in pull request #18175: [vectorized](function) support array_first_index function
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #18175:
URL: https://github.com/apache/doris/pull/18175#discussion_r1151345199
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/LambdaFunctionCallExpr.java:
##########
@@ -133,7 +135,6 @@ public void analyzeImpl(Analyzer analyzer) throws AnalysisException {
LOG.warn("fn {} not exists", this.toSqlImpl());
throw new AnalysisException(getFunctionNotFoundError(collectChildReturnTypes()));
}
- fn.setReturnType(getChild(0).getType());
} else if (fnName.getFunction().equalsIgnoreCase("array_filter")) {
Review Comment:
why remove 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] [doris] github-actions[bot] commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1488414443
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] github-actions[bot] commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1489691161
clang-tidy review says "All clean, LGTM! :+1:"
--
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] gitccl commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1489689008
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] github-actions[bot] commented on pull request #18175: [vectorized](function) support array_first_index function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1488150002
clang-tidy review says "All clean, LGTM! :+1:"
--
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 #18175: [vectorized](function) support array_first_index function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1490341605
clang-tidy review says "All clean, LGTM! :+1:"
--
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] zhangstar333 commented on a diff in pull request #18175: [vectorized](function) support array_first_index function
Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #18175:
URL: https://github.com/apache/doris/pull/18175#discussion_r1151344868
##########
gensrc/script/doris_builtins_functions.py:
##########
@@ -650,6 +649,8 @@
[['array_exists'], 'ARRAY_BOOLEAN', ['ARRAY_VARCHAR'], ''],
[['array_exists'], 'ARRAY_BOOLEAN', ['ARRAY_STRING'], ''],
+ [['array_first_index'], 'BIGINT', ['ARRAY_BOOLEAN'], 'ALWAYS_NULLABLE'],
+
Review Comment:
this function seems better to return 0 if it is not found in any case, so maybe set always_not_nullable mode
--
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 #18175: [vectorized](function) support array_first_index function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1488152653
clang-tidy review says "All clean, LGTM! :+1:"
--
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 #18175: [vectorized](function) support array_first_index function
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1486436679
clang-tidy review says "All clean, LGTM! :+1:"
--
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 #18175: [vectorized](function) support array_first_index function
Posted by "hello-stephen (via GitHub)" <gi...@apache.org>.
hello-stephen commented on PR #18175:
URL: https://github.com/apache/doris/pull/18175#issuecomment-1486477317
TeamCity pipeline, clickbench performance test result:
the sum of best hot time: 33.88 seconds
stream load tsv: 472 seconds loaded 74807831229 Bytes, about 151 MB/s
stream load json: 24 seconds loaded 2358488459 Bytes, about 93 MB/s
stream load orc: 74 seconds loaded 1101869774 Bytes, about 14 MB/s
stream load parquet: 32 seconds loaded 861443392 Bytes, about 25 MB/s
https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20230328090010_clickbench_pr_121740.html
--
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] gitccl commented on a diff in pull request #18175: [vectorized](function) support array_first_index function
Posted by "gitccl (via GitHub)" <gi...@apache.org>.
gitccl commented on code in PR #18175:
URL: https://github.com/apache/doris/pull/18175#discussion_r1151354974
##########
fe/fe-core/src/main/java/org/apache/doris/analysis/LambdaFunctionCallExpr.java:
##########
@@ -133,7 +135,6 @@ public void analyzeImpl(Analyzer analyzer) throws AnalysisException {
LOG.warn("fn {} not exists", this.toSqlImpl());
throw new AnalysisException(getFunctionNotFoundError(collectChildReturnTypes()));
}
- fn.setReturnType(getChild(0).getType());
} else if (fnName.getFunction().equalsIgnoreCase("array_filter")) {
Review Comment:
The return type has already been specified in the `fn` when we create function in `doris_builtins_functions.py`. In this case, the return type of `fn` is `Int64`, but the the return type of children 0 is `Array(Bool)`, we shouldn't change the return type of the `fn`.
--
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