8000 RF01 & AM08: Unexpected failure for `join unnest with offset` in BigQuery · Issue #6725 · sqlfluff/sqlfluff · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
RF01 & AM08: Unexpected failure for join unnest with offset in BigQuery #6725
Closed
@lishenjie

Description

@lishenjie

Search before asking

  • I searched the issues and found no similar issues.

What Happened

The following BQ query fails RF01 & AM08.

It's possibly after #6400 and #6239.

Expected Behaviour

All Finished 📜 🎉!

Observed Behaviour

== [test.sql] FAIL                                                                                                                                                                                                                                           
L:   2 | P:   5 | RF01 | Reference 'ix' refers to table/view not found in the
                       | FROM clause or found in ancestor statement.
                       | [references.from]
L:   5 | P:   1 | AM08 | Implicit cross join detected.
                       | [ambiguous.join_condition]
All Finished 📜 🎉!

ix is the offset alias (https://cloud.google.com/bigquery/docs/arrays).
left join is to include rows with null value_list arrays (https://cloud.google.com/bigquery/docs/arrays).

How to reproduce

sqlfluff lint test.sql --dialect bigquery

test.sql:

select
    ix,
    v
from t
left join
    unnest(t.value_list) as v
    with offset as ix

Dialect

bigquery

Version

sqlfluff, version 3.3.0
Python 3.11.11

Configuration

The default configuration.

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

    bigqueryIssues relating to the BigQuery dialectbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0