Skip to content

Commit

Permalink
Refactor parse_match_recognize_measure
Browse files Browse the repository at this point in the history
Co-authored-by: Jo <46752250+georgesittas@users.noreply.github.com>
  • Loading branch information
VaggelisD and georgesittas authored Apr 8, 2024
1 parent 79e81de commit 074fb77
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sqlglot/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2739,13 +2739,10 @@ def _parse_from(
)

def _parse_match_recognize_measure(self) -> exp.MatchRecognizeMeasure:
if self._match_text_seq("FINAL") or self._match_text_seq("RUNNING"):
window_frame = self._prev.text
else:
window_frame = None

return self.expression(
exp.MatchRecognizeMeasure, window_frame=window_frame, this=self._parse_expression()
exp.MatchRecognizeMeasure,
window_frame=self._match_texts(("FINAL", "RUNNING")) and self._prev.text.upper(),
this=self._parse_expression(),
)

def _parse_match_recognize(self) -> t.Optional[exp.MatchRecognize]:
Expand Down

0 comments on commit 074fb77

Please sign in to comment.