Mihai Budiu created CALCITE-6347:
------------------------------------

             Summary: ARRAY_REPEAT with a string argument causes a compiler 
crash
                 Key: CALCITE-6347
                 URL: https://issues.apache.org/jira/browse/CALCITE-6347
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.36.0
            Reporter: Mihai Budiu


The following SqlOperatorTest:

{code:java}
    f.checkScalar("array_repeat('1', 2)", "['1', '1']",
        "CHAR(1) NOT NULL ARRAY NOT NULL");
{code}

causes a compiler error:

{code}
Error while compiling generated Java code:

...
static final String $L4J$C$org_apache_calcite_runtime_SqlFunctions_repeat_1_2_ 
= org.apache.calcite.runtime.SqlFunctions.repeat("1", 2);
...
        at org.apache.calcite.avatica.Helper.wrap(Helper.java:37)
        at 
org.apache.calcite.adapter.enumerable.EnumerableInterpretable.toBindable(EnumerableInterpretable.java:128)
        at 
org.apache.calcite.prepare.CalcitePrepareImpl$CalcitePreparingStmt.implement(CalcitePrepareImpl.java:1171)
        at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:326)
        at org.apache.calcite.prepare.Prepare.prepareSql(Prepare.java:220)
        at 
org.apache.calcite.prepare.CalcitePrepareImpl.prepare2_(CalcitePrepareImpl.java:666)
{code}

This happens because the "repeat" function in SqlFunctions is overloaded to 
implement both ARRAY_REPEAT and REPEAT.



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

Reply via email to