Skip to content

Snowflake REDUCE() unparsable #6386

@rogalski

Description

@rogalski

Search before asking

  • I searched the issues and found no similar issues.

What Happened

parsing violation

Expected Behaviour

successful parse

Observed Behaviour

parsing violation

How to reproduce

SELECT REDUCE([1,2,3], 0, (acc, val) -> acc + val);
$ sqlfluff --version
sqlfluff, version 3.2.4
$ sqlfluff parse -d snowflake reduce.sql 
[L:  1, P:  1]      |file:
[L:  1, P:  1]      |    statement:
[L:  1, P:  1]      |        select_statement:
[L:  1, P:  1]      |            select_clause:
[L:  1, P:  1]      |                keyword:                                      'SELECT'
[L:  1, P:  7]      |                [META] indent:
[L:  1, P:  7]      |                whitespace:                                   ' '
[L:  1, P:  8]      |                select_clause_element:
[L:  1, P:  8]      |                    column_reference:
[L:  1, P:  8]      |                        naked_identifier:                     'REDUCE'
[L:  1, P: 14]      |                [META] dedent:
[L:  1, P: 14]      |                unparsable:                                   !! Expected: 'Nothing here.'
[L:  1, P: 14]      |                    start_bracket:                            '('
[L:  1, P: 15]      |                    start_square_bracket:                     '['
[L:  1, P: 16]      |                    numeric_literal:                          '1'
[L:  1, P: 17]      |                    comma:                                    ','
[L:  1, P: 18]      |                    numeric_literal:                          '2'
[L:  1, P: 19]      |                    comma:                                    ','
[L:  1, P: 20]      |                    numeric_literal:                          '3'
[L:  1, P: 21]      |                    end_square_bracket:                       ']'
[L:  1, P: 22]      |                    comma:                                    ','
[L:  1, P: 23]      |                    whitespace:                               ' '
[L:  1, P: 24]      |                    numeric_literal:                          '0'
[L:  1, P: 25]      |                    comma:                                    ','
[L:  1, P: 26]      |                    whitespace:                               ' '
[L:  1, P: 27]      |                    start_bracket:                            '('
[L:  1, P: 28]      |                    word:                                     'acc'
[L:  1, P: 31]      |                    comma:                                    ','
[L:  1, P: 32]      |                    whitespace:                               ' '
[L:  1, P: 33]      |                    word:                                     'val'
[L:  1, P: 36]      |                    end_bracket:                              ')'
[L:  1, P: 37]      |                    whitespace:                               ' '
[L:  1, P: 38]      |                    function_assigner:                        '->'
[L:  1, P: 40]      |                    whitespace:                               ' '
[L:  1, P: 41]      |                    word:                                     'acc'
[L:  1, P: 44]      |                    whitespace:                               ' '
[L:  1, P: 45]      |                    plus:                                     '+'
[L:  1, P: 46]      |                    whitespace:                               ' '
[L:  1, P: 47]      |                    word:                                     'val'
[L:  1, P: 50]      |                    end_bracket:                              ')'
[L:  1, P: 51]      |    statement_terminator:                                     ';'
[L:  1, P: 52]      |    [META] end_of_file:

==== parsing violations ====
L:   1 | P:  14 |  PRS | Line 1, Position 14: Found unparsable section: '([1,2,3], 0, (acc,
                       | val) -> acc + val)'

Dialect

snowflake

Version

3.2.4

Configuration

N/A

Are you willing to work on and submit a PR to address the issue?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsnowflakeIssues related to the Snowflake dialect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions