Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6450

Postgres CONCAT_WS function throws exception when parameter type is (<CHAR(1)>, <INTEGER ARRAY>)

    XMLWordPrintableJSON

Details

    Description

      The SQL can run success in Postgres:

      select concat_ws(',',ARRAY[10000, 10000, 10000, 10000]); 

      But in Calcite, It will throw exception:

      @Test void testConcatFunction() {
      final String sql = "select concat_ws(',',ARRAY[10000, 10000, 10000, 10000]) as c";
      fixture()
      .withFactory(c ->
      c.withOperatorTable(t ->
      SqlValidatorTest.operatorTableFor(SqlLibrary.POSTGRESQL)))
      .withCatalogReader(MockCatalogReaderExtended::create)
      .withSql(sql)
      .ok();
      }
      From line 1, column 8 to line 1, column 55: Cannot apply 'CONCAT_WS' to arguments of type 'CONCAT_WS(<CHAR(1)>, <INTEGER ARRAY>)'. Supported form(s): 'CONCAT_WS(<STRING>)'

      This issue find in comment CALCITE-6446 .

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nobigo xiong duan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: