Help with TDEngine custom dialect #3903
Replies: 1 comment 1 reply
-
There are a couple of issues. First of all, return self.expression(
exp.Group if self._match(tokens.TokenType.GROUP_BY) else exp.Partition,
expressions=self._parse_csv(self._parse_conjunction),
grouping_sets=self._parse_grouping_sets(),
cube=self._match(tokens.TokenType.CUBE) and self._parse_wrapped_id_vars(),
rollup=self._match(tokens.TokenType.ROLLUP) and self._parse_wrapped_id_vars(),
) For the first arg, you've already consumed the group by token, so the match is incorrect there as you'll never have a I'd suggest studying the code a bit more and then move on with the implementation once you have a good understanding of the basics. Look into past PRs as well, that'll help. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm building a custom dialect for TDEngine, they have a
PARTITION BY
syntax similar toGROUP BY
but I wasn't able to make the dialect accept thePARTITION BY
, it always returnsParseError: Invalid expression / Unexpected token. Line 6, Col: 13.
.The partition by is already an available token at sqlglot and I'm using the same flow available at the
parser.py
, so I'm not sure what I'm doing wrong.This is the query I'm trying to parse:
Beta Was this translation helpful? Give feedback.
All reactions