Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15080

Calcite. Functions extends string parameters by trailing spaces

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • None
    • None
    • sql
    • None

    Description

      I discovered the strange behavior of functions with several string parameters, which then returns one of these parameters. In this case, the returned parameter string is expanded with trailing spaces to the length of the longest string.

      query T
      SELECT COALESCE(COALESCE(null, 'world'), 'blabla')
      ----
      world  - result is 'world ' - so we have extra trailing spaces from max length string parameter'blabla'
      query I
      SELECT DECODE(102, 101, 'IBM', 102, 'GRIDGAIN', 103, 'Hewlett Packard','BALL')
      ----
      GRIDGAIN   - result is 'GRIDGAIN       ' - so we have extra traiing spaces from max length string parameter 'Hewlett Packard'

      see src/test/sql/function/generic/test_decode.test_ignore

      seeĀ src/test/sql/function/generic/test_coalesce.test_ignore

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            jooger Iurii Gerzhedovich

            Dates

              Created:
              Updated:

              Slack

                Issue deployment