pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/DTStack/dt-sql-parser/commit/05134bc569996d108f961a7228c2e34cea0fd98b

" /> fix(trino): update timezone grammar to avoid ambiguity (#394) · DTStack/dt-sql-parser@05134bc · GitHub
Skip to content

Commit 05134bc

Browse files
authored
fix(trino): update timezone grammar to avoid ambiguity (#394)
* fix(trino): update timezone grammar to avoid ambiguity * test(trino): add semicolon for test sqls
1 parent f2e6b60 commit 05134bc

6 files changed

Lines changed: 2001 additions & 1985 deletions

File tree

src/grammar/trino/TrinoSql.g4

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -737,17 +737,15 @@ normalForm
737737
;
738738

739739
type
740-
: KW_ROW '(' rowField (',' rowField)* ')' # rowType
741-
| KW_INTERVAL from=intervalField (KW_TO to=intervalField)? # intervalType
742-
| base=KW_TIMESTAMP ('(' precision= typeParameter ')')? (KW_WITHOUT KW_TIME KW_ZONE)? # dateTimeType
743-
| base=KW_TIMESTAMP ('(' precision= typeParameter ')')? KW_WITH KW_TIME KW_ZONE # dateTimeType
744-
| base=KW_TIME ('(' precision= typeParameter ')')? (KW_WITHOUT KW_TIME KW_ZONE)? # dateTimeType
745-
| base=KW_TIME ('(' precision= typeParameter ')')? KW_WITH KW_TIME KW_ZONE # dateTimeType
746-
| KW_DOUBLE KW_PRECISION # doublePrecisionType
747-
| KW_ARRAY '<' type '>' # legacyArrayType
748-
| KW_MAP '<' keyType=type ',' valueType=type '>' # legacyMapType
749-
| type KW_ARRAY ('[' INTEGER_VALUE ']')? # arrayType
750-
| identifier ('(' typeParameter (',' typeParameter)* ')')? # genericType
740+
: KW_ROW '(' rowField (',' rowField)* ')' # rowType
741+
| KW_INTERVAL from=intervalField (KW_TO to=intervalField)? # intervalType
742+
| base=KW_TIMESTAMP ('(' precision= typeParameter ')')? ((KW_WITH | KW_WITHOUT) KW_TIME KW_ZONE)? # dateTimeType
743+
| base=KW_TIME ('(' precision= typeParameter ')')? ((KW_WITH | KW_WITHOUT) KW_TIME KW_ZONE)? # timeType
744+
| KW_DOUBLE KW_PRECISION # doublePrecisionType
745+
| KW_ARRAY '<' type '>' # legacyArrayType
746+
| KW_MAP '<' keyType=type ',' valueType=type '>' # legacyMapType
747+
| type KW_ARRAY ('[' INTEGER_VALUE ']')? # arrayType
748+
| identifier ('(' typeParameter (',' typeParameter)* ')')? # genericType
751749
;
752750

753751
rowField

src/lib/trino/TrinoSql.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/lib/trino/TrinoSqlListener.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ import { RowTypeContext } from "./TrinoSqlParser.js";
268268
import { IntervalTypeContext } from "./TrinoSqlParser.js";
269269
import { ArrayTypeContext } from "./TrinoSqlParser.js";
270270
import { DoublePrecisionTypeContext } from "./TrinoSqlParser.js";
271+
import { TimeTypeContext } from "./TrinoSqlParser.js";
271272
import { LegacyArrayTypeContext } from "./TrinoSqlParser.js";
272273
import { GenericTypeContext } from "./TrinoSqlParser.js";
273274
import { DateTimeTypeContext } from "./TrinoSqlParser.js";
@@ -3356,6 +3357,18 @@ export class TrinoSqlListener implements ParseTreeListener {
33563357
* @param ctx the parse tree
33573358
*/
33583359
exitDoublePrecisionType?: (ctx: DoublePrecisionTypeContext) => void;
3360+
/**
3361+
* Enter a parse tree produced by the `timeType`
3362+
* labeled alternative in `TrinoSqlParser.type`.
3363+
* @param ctx the parse tree
3364+
*/
3365+
enterTimeType?: (ctx: TimeTypeContext) => void;
3366+
/**
3367+
* Exit a parse tree produced by the `timeType`
3368+
* labeled alternative in `TrinoSqlParser.type`.
3369+
* @param ctx the parse tree
3370+
*/
3371+
exitTimeType?: (ctx: TimeTypeContext) => void;
33593372
/**
33603373
* Enter a parse tree produced by the `legacyArrayType`
33613374
* labeled alternative in `TrinoSqlParser.type`.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy