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

Add ARRAY_INSERT function(enabled in Spark library)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.34.0
    • 1.36.0
    • core

    Description

      array_insert(x, pos, val) - Places val into index pos of array x. Array indices start at 1, or start from the end if index is negative. Index above array size appends the array, or prepends the array if index is negative, with 'null' elements

      Examples:

      > SELECT array_insert(array(1, 2, 3, 4), 5, 5); [1,2,3,4,5]

      > SELECT array_insert(array(5, 3, 2, 1), -3, 4); [5,4,3,2,1] 

      https://spark.apache.org/docs/latest/api/sql/index.html#array_insert

      Attachments

        1. image-2023-08-14-11-17-33-205.png
          114 kB
          Ran Tao
        2. image-2023-08-14-11-20-46-189.png
          115 kB
          Ran Tao

        Issue Links

          Activity

            People

              taoran Ran Tao
              taoran Ran Tao
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: