Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-611

regexp_substr(), is displaying wrong results, if starting and end character is same and vice versa also.

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • old issue number:
      480

      Description

      1. create a table and insert some amount of data into the table.
      2. query to test regexp_substr(). in below manner.

      but expected result is not displaying.

      0: jdbc:phoenix:10.18.40.69,10.18.40.130> select *,regexp_substr(name,'[^s]+',1) from sqltable limit 5;
      -----------------------------------------------------------

      NO NAME ADDR DEPT REGEXP_SUBSTR(NAME,'[^s]+',1)

      -----------------------------------------------------------

      0 jruls HYD 30 jrul
      1 hrjcu MUM 30 hrjcu
      2 yqtrv BLR 30 yqtrv
      3 satax HYD 30 atax
      4 jjcvw BLR 40 jjcvw

      -----------------------------------------------------------

      here for record 3 expected the value is null. but it is displaying "atax"

      similarly in reverse order
      0: jdbc:phoenix:10.18.40.69,10.18.40.130> select *,regexp_substr(name,'[^s]+',-1) from sqltable limit 5;
      ---------------------------------------------------------------------------------------------------------------

      NO NAME ADDR DEPT REGEXP_SUBSTR(NAME,'[^s]+',com.salesforce.phoenix.parse.MultiplyParseNode[1, -1])

      ---------------------------------------------------------------------------------------------------------------

      0 jruls HYD 30 null
      1 hrjcu MUM 30 u
      2 yqtrv BLR 30 v
      3 satax HYD 30 x
      4 jjcvw BLR 40 w

      ---------------------------------------------------------------------------------------------------------------
      here in reverse order value for 3.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sreenivasulureddy Y. SREENIVASULU REDDY
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: