You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "liuyongvs (via GitHub)" <gi...@apache.org> on 2023/05/14 12:30:12 UTC
[GitHub] [calcite] liuyongvs commented on a diff in pull request #3198: [CALCITE-5700] Add ARRAY_SIZE, ARRAY_REPEAT function (enabled in Spar…
liuyongvs commented on code in PR #3198:
URL: https://github.com/apache/calcite/pull/3198#discussion_r1193138348
##########
core/src/main/java/org/apache/calcite/runtime/SqlFunctions.java:
##########
@@ -3797,6 +3797,14 @@ public static List distinct(List list) {
return new ArrayList<>(result);
}
+ /** Support the ARRAY_REPEAT function. */
+ public static @Nullable List repeat(Object element, Object count) {
+ if (count == null) {
+ return null;
+ }
+ return Collections.nCopies((Integer) count, element);
Review Comment:
@JiajunBernoulli it only can be integer in spark, i comments it before.
```
override def inputTypes: Seq[AbstractDataType] = Seq(AnyDataType, IntegerType)
```
--
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@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org