[ 
https://issues.apache.org/jira/browse/CALCITE-5704?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17726940#comment-17726940
 ] 

jackylau commented on CALCITE-5704:
-----------------------------------

[~libenchao] thanks for your response. another way is referring to this 
ARRAY_SAME_SAME, [~jiajunbernoulli] , how about you?

 
{code:java}
// code placeholder

public static final SqlBinaryOperator CONCAT =
    new SqlBinaryOperator(
        "||",
        SqlKind.OTHER,
        60,
        true,
        ReturnTypes.ARG0.andThen((opBinding, typeToTransform) -> {
          SqlReturnTypeInference returnType =
              typeToTransform.getSqlTypeName().getFamily() == 
SqlTypeFamily.ARRAY
                  ? ReturnTypes.LEAST_RESTRICTIVE
                  : ReturnTypes.DYADIC_STRING_SUM_PRECISION_NULLABLE;

          return requireNonNull(returnType.inferReturnType(opBinding),
              "inferred CONCAT element type");
        }),
        null,
        OperandTypes.STRING_SAME_SAME_OR_ARRAY_SAME_SAME);
 {code}

> Add ARRAY_EXCEPT, ARRAY_INTERSECT and ARRAY_UNION for Spark dialect
> -------------------------------------------------------------------
>
>                 Key: CALCITE-5704
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5704
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: jackylau
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.35.0
>
>
> array_union(array1, array2) - Returns an array of the elements in the union 
> of array1 and array2, without duplicates.
> array_intersect(array1, array2) - Returns an array of the elements in the 
> intersection of array1 and array2, without duplicates.
> array_except(array1, array2) - Returns an array of the elements in array1 but 
> not in array2, without duplicates.
> For more details
> [https://spark.apache.org/docs/latest/api/sql/index.html]



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to