File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -350,13 +350,15 @@ def _parse_select(
350350 parse_subquery_alias : bool = True ,
351351 parse_set_operation : bool = True ,
352352 consume_pipe : bool = True ,
353+ from_ : t .Optional [exp .From ] = None ,
353354) -> t .Optional [exp .Expression ]:
354355 select = self .__parse_select ( # type: ignore
355356 nested = nested ,
356357 table = table ,
357358 parse_subquery_alias = parse_subquery_alias ,
358359 parse_set_operation = parse_set_operation ,
359360 consume_pipe = consume_pipe ,
361+ from_ = from_ ,
360362 )
361363
362364 if (
Original file line number Diff line number Diff line change @@ -722,3 +722,11 @@ def test_sqlglot_extended_correctly(dialect: str) -> None:
722722def test_connected_identifier ():
723723 ast = d .parse_one ("""SELECT ("x"at time zone 'utc')::timestamp as x""" , "redshift" )
724724 assert ast .sql ("redshift" ) == """SELECT CAST(("x" AT TIME ZONE 'utc') AS TIMESTAMP) AS x"""
725+
726+
727+ def test_pipe_syntax ():
728+ ast = d .parse_one ("SELECT * FROM (FROM t2 |> SELECT id)" , "bigquery" )
729+ assert (
730+ ast .sql ("bigquery" )
731+ == "SELECT * FROM (WITH __tmp1 AS (SELECT id FROM t2) SELECT * FROM __tmp1)"
732+ )
You can’t perform that action at this time.
0 commit comments