You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected using auto increments to work without generating errors.
Observed Behaviour
A RuntimeError is raised using autoincrement columns, see code report / stacktrace below:
Traceback (most recent call last):
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/linter/runner.py", line 97, in run
yield partial()
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/linter/linter.py", line 521, in lint_rendered
parsed = cls.parse_rendered(rendered)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/linter/linter.py", line 311, in parse_rendered
parsed, pvs = cls._parse_tokens(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/linter/linter.py", line 188, in _parse_tokens
parsed: Optional[BaseSegment] = parser.parse(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/parser.py", line 32, in parse
parsed = root_segment.parse(parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/base.py", line 870, in parse
self.segments = self.expand(self.segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/base.py", line 276, in expand
res = stmt.parse(parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/base.py", line 811, in parse
m = parse_grammar.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 198, in match
match = self._match_once(unmatched_segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 142, in _match_once
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 854, in match
resp = elem.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/base.py", line 466, in match
m = cls.match_grammar.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 331, in match
content_match = super().match(content_segs, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/delimited.py", line 135, in match
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 198, in match
match = self._match_once(unmatched_segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 142, in _match_once
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 854, in match
resp = elem.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/base.py", line 466, in match
m = cls.match_grammar.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 198, in match
match = self._match_once(unmatched_segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 142, in _match_once
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 854, in match
resp = elem.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/base.py", line 466, in match
m = cls.match_grammar.match(segments=segments, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 198, in match
match = self._match_once(unmatched_segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 142, in _match_once
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 198, in match
match = self._match_once(unmatched_segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/anyof.py", line 142, in _match_once
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 331, in match
content_match = super().match(content_segs, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/sequence.py", line 130, in match
elem_match = elem.match(mid_seg, parse_context=ctx)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/delimited.py", line 135, in match
match, _ = self._longest_trimmed_match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 217, in _longest_trimmed_match
res_match: MatchResult = matcher.match(
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/match_wrapper.py", line 49, in wrapped_match_method
m = func(self_cls, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/segments/ephemeral.py", line 90, in wrapped_match_method
return func(self, segments, parse_context=parse_context)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 826, in match
elem = self._get_elem(dialect=parse_context.dialect)
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/parser/grammar/base.py", line 805, in _get_elem
returndialect.ref(self._get_ref())
File "/Users/meesstrooker/sqlfluff/src/sqlfluff/core/dialects/base.py", line 232, in ref
raise RuntimeError(
RuntimeError: Grammar refers to 'NumericLiteralValue' which was not found in the snowflake dialect
Steps to Reproduce
Install the SQLFluff package version 0.7.0a4
Create a file with content below
Run sqlfluff lint --dialect snowflake
Content of SQL file generating the issue:
CREATE
OR REPLACE TABLE test_schema.test_table (test_column NUMBER autoincrement (0, 1));
Expected Behaviour
I expected using auto increments to work without generating errors.
Observed Behaviour
A RuntimeError is raised using autoincrement columns, see code report / stacktrace below:
Steps to Reproduce
Content of SQL file generating the issue:
Dialect
Snowflake
Version
sqlfluff, version 0.7.0a4
Configuration
The text was updated successfully, but these errors were encountered: