Apache Drill
  1. Apache Drill
  2. DRILL-739

SUBSTRING function with regex pattern fails to parse.

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Future
    • Component/s: Functions - Drill
    • Labels:
      None

      Description

      SUBSTRING(string from pattern) function fails to execute. For example:

      select substring(name from '^.....') from voter where age < 20;

      message: "Failure while parsing sql. < ValidationException:[ org.eigenbase.util.EigenbaseContextException: From line 1, column 8 to line 1, column 36 ] < EigenbaseContextException:[ From line 1, column 8 to line 1, column 36 ] < SqlValidatorException:[ Cannot apply 'SUBSTRING' to arguments of type 'SUBSTRING(<ANY> FROM <CHAR(6)>)'. Supported form(s): 'SUBSTRING(<CHAR> FROM <INTEGER>)'
      'SUBSTRING(<CHAR> FROM <INTEGER> FOR <INTEGER>)'
      'SUBSTRING(<VARCHAR> FROM <INTEGER>)'
      'SUBSTRING(<VARCHAR> FROM <INTEGER> FOR <INTEGER>)'
      'SUBSTRING(<BINARY> FROM <INTEGER>)'
      'SUBSTRING(<BINARY> FROM <INTEGER> FOR <INTEGER>)'
      'SUBSTRING(<VARBINARY> FROM <INTEGER>)'
      'SUBSTRING(<VARBINARY> FROM <INTEGER> FOR <INTEGER>)' ]"
      ]

      Same error for the following test queries:
      select substring(name from 's.n$') from student where rownum=105;
      select substring(name from '^[A-Z].*$') from voter where rownum=15;

        Activity

        Tony Stevenson made changes -
        Workflow no-reopen-closed, patch-avail, testing [ 12862283 ] Drill workflow [ 12935142 ]
        Jacques Nadeau made changes -
        Issue Type Bug [ 1 ] New Feature [ 2 ]
        Mehant Baid made changes -
        Fix Version/s Future [ 12326743 ]
        Fix Version/s 1.0.0-BETA2 [ 12324880 ]
        Jacques Nadeau made changes -
        Fix Version/s 1.0.0-BETA2 [ 12324880 ]
        Fix Version/s 1.0.0-BETA1 [ 12324963 ]
        Cliff Buchanan made changes -
        Target Version/s Future [ 12326743 ]
        Hide
        Cliff Buchanan added a comment -

        substring('string', 'regexp') isn't currently allowed by the optiq validator, so this will not be implemented for the beta release.

        Show
        Cliff Buchanan added a comment - substring('string', 'regexp') isn't currently allowed by the optiq validator, so this will not be implemented for the beta release.
        Cliff Buchanan made changes -
        Assignee Mehant Baid [ mehant ] Cliff Buchanan [ cbuchanan ]
        Jacques Nadeau made changes -
        Fix Version/s 1.0.0-BETA1 [ 12324963 ]
        Jacques Nadeau made changes -
        Field Original Value New Value
        Assignee Mehant Baid [ mehant ]
        Krystal created issue -

          People

          • Assignee:
            Cliff Buchanan
            Reporter:
            Krystal
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development