Skip to content

Commit c1ae224

Browse files
committed
feat(trino): check spelling errors for trino sql
1 parent e8c4b23 commit c1ae224

File tree

5 files changed

+151
-151
lines changed

5 files changed

+151
-151
lines changed

src/grammar/trino/TrinoSql.g4

+5-5
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,10 @@ trimsSpecification
373373

374374
listAggOverflowBehavior
375375
: KW_ERROR
376-
| KW_TRUNCATE string? listaggCountIndication
376+
| KW_TRUNCATE string? listAggCountIndication
377377
;
378378

379-
listaggCountIndication
379+
listAggCountIndication
380380
: KW_WITH KW_COUNT
381381
| KW_WITHOUT KW_COUNT
382382
;
@@ -489,7 +489,7 @@ jsonTableDefaultPlan
489489

490490
tableFunctionCall
491491
: functionName '(' (tableFunctionArgument (',' tableFunctionArgument)*)? (
492-
KW_COPARTITION copartitionTables (',' copartitionTables)*
492+
KW_COPARTITION coPartitionTables (',' coPartitionTables)*
493493
)? ')'
494494
;
495495

@@ -522,7 +522,7 @@ descriptorField
522522
: identifier type?
523523
;
524524

525-
copartitionTables
525+
coPartitionTables
526526
: '(' qualifiedName ',' qualifiedName (',' qualifiedName)* ')'
527527
;
528528

@@ -573,7 +573,7 @@ primaryExpression
573573
| KW_ROW '(' expression (',' expression)* ')' # rowConstructor
574574
| name=KW_LISTAGG '(' setQuantifier? expression (',' string)? (
575575
KW_ON KW_OVERFLOW listAggOverflowBehavior
576-
)? ')' (KW_WITHIN KW_GROUP '(' KW_ORDER KW_BY sortItem (',' sortItem)* ')') filter? # listagg
576+
)? ')' (KW_WITHIN KW_GROUP '(' KW_ORDER KW_BY sortItem (',' sortItem)* ')') filter? # listAgg
577577
| processingMode? functionName '(' (label=identifier '.')? ASTERISK ')' filter? over? # functionCall
578578
| processingMode? functionName '(' (setQuantifier? expression (',' expression)*)? (
579579
KW_ORDER KW_BY sortItem (',' sortItem)*

src/lib/trino/TrinoSql.interp

+2-2
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ sampledRelation
728728
sampleType
729729
trimsSpecification
730730
listAggOverflowBehavior
731-
listaggCountIndication
731+
listAggCountIndication
732732
patternRecognition
733733
measureDefinition
734734
rowsPerMatch
@@ -752,7 +752,7 @@ tableArgument
752752
tableArgumentRelation
753753
descriptorArgument
754754
descriptorField
755-
copartitionTables
755+
coPartitionTables
756756
expression
757757
booleanExpression
758758
predicate

src/lib/trino/TrinoSqlListener.ts

+23-23
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ import { SampledRelationContext } from "./TrinoSqlParser.js";
144144
import { SampleTypeContext } from "./TrinoSqlParser.js";
145145
import { TrimsSpecificationContext } from "./TrinoSqlParser.js";
146146
import { ListAggOverflowBehaviorContext } from "./TrinoSqlParser.js";
147-
import { ListaggCountIndicationContext } from "./TrinoSqlParser.js";
147+
import { ListAggCountIndicationContext } from "./TrinoSqlParser.js";
148148
import { PatternRecognitionContext } from "./TrinoSqlParser.js";
149149
import { MeasureDefinitionContext } from "./TrinoSqlParser.js";
150150
import { RowsPerMatchContext } from "./TrinoSqlParser.js";
@@ -181,7 +181,7 @@ import { TableArgumentTableContext } from "./TrinoSqlParser.js";
181181
import { TableArgumentQueryContext } from "./TrinoSqlParser.js";
182182
import { DescriptorArgumentContext } from "./TrinoSqlParser.js";
183183
import { DescriptorFieldContext } from "./TrinoSqlParser.js";
184-
import { CopartitionTablesContext } from "./TrinoSqlParser.js";
184+
import { CoPartitionTablesContext } from "./TrinoSqlParser.js";
185185
import { ExpressionContext } from "./TrinoSqlParser.js";
186186
import { LogicalNotContext } from "./TrinoSqlParser.js";
187187
import { PredicatedContext } from "./TrinoSqlParser.js";
@@ -212,6 +212,7 @@ import { TrimContext } from "./TrinoSqlParser.js";
212212
import { ParameterContext } from "./TrinoSqlParser.js";
213213
import { NormalizeContext } from "./TrinoSqlParser.js";
214214
import { LocalTimestampContext } from "./TrinoSqlParser.js";
215+
import { ListAggContext } from "./TrinoSqlParser.js";
215216
import { JsonObjectContext } from "./TrinoSqlParser.js";
216217
import { IntervalLiteralContext } from "./TrinoSqlParser.js";
217218
import { NumericLiteralContext } from "./TrinoSqlParser.js";
@@ -239,7 +240,6 @@ import { CurrentTimestampContext } from "./TrinoSqlParser.js";
239240
import { CurrentSchemaContext } from "./TrinoSqlParser.js";
240241
import { ExistsContext } from "./TrinoSqlParser.js";
241242
import { PositionContext } from "./TrinoSqlParser.js";
242-
import { ListaggContext } from "./TrinoSqlParser.js";
243243
import { SearchedCaseContext } from "./TrinoSqlParser.js";
244244
import { CurrentCatalogContext } from "./TrinoSqlParser.js";
245245
import { GroupingOperationContext } from "./TrinoSqlParser.js";
@@ -1948,15 +1948,15 @@ export class TrinoSqlListener implements ParseTreeListener {
19481948
*/
19491949
exitListAggOverflowBehavior?: (ctx: ListAggOverflowBehaviorContext) => void;
19501950
/**
1951-
* Enter a parse tree produced by `TrinoSqlParser.listaggCountIndication`.
1951+
* Enter a parse tree produced by `TrinoSqlParser.listAggCountIndication`.
19521952
* @param ctx the parse tree
19531953
*/
1954-
enterListaggCountIndication?: (ctx: ListaggCountIndicationContext) => void;
1954+
enterListAggCountIndication?: (ctx: ListAggCountIndicationContext) => void;
19551955
/**
1956-
* Exit a parse tree produced by `TrinoSqlParser.listaggCountIndication`.
1956+
* Exit a parse tree produced by `TrinoSqlParser.listAggCountIndication`.
19571957
* @param ctx the parse tree
19581958
*/
1959-
exitListaggCountIndication?: (ctx: ListaggCountIndicationContext) => void;
1959+
exitListAggCountIndication?: (ctx: ListAggCountIndicationContext) => void;
19601960
/**
19611961
* Enter a parse tree produced by `TrinoSqlParser.patternRecognition`.
19621962
* @param ctx the parse tree
@@ -2352,15 +2352,15 @@ export class TrinoSqlListener implements ParseTreeListener {
23522352
*/
23532353
exitDescriptorField?: (ctx: DescriptorFieldContext) => void;
23542354
/**
2355-
* Enter a parse tree produced by `TrinoSqlParser.copartitionTables`.
2355+
* Enter a parse tree produced by `TrinoSqlParser.coPartitionTables`.
23562356
* @param ctx the parse tree
23572357
*/
2358-
enterCopartitionTables?: (ctx: CopartitionTablesContext) => void;
2358+
enterCoPartitionTables?: (ctx: CoPartitionTablesContext) => void;
23592359
/**
2360-
* Exit a parse tree produced by `TrinoSqlParser.copartitionTables`.
2360+
* Exit a parse tree produced by `TrinoSqlParser.coPartitionTables`.
23612361
* @param ctx the parse tree
23622362
*/
2363-
exitCopartitionTables?: (ctx: CopartitionTablesContext) => void;
2363+
exitCoPartitionTables?: (ctx: CoPartitionTablesContext) => void;
23642364
/**
23652365
* Enter a parse tree produced by `TrinoSqlParser.expression`.
23662366
* @param ctx the parse tree
@@ -2719,6 +2719,18 @@ export class TrinoSqlListener implements ParseTreeListener {
27192719
* @param ctx the parse tree
27202720
*/
27212721
exitLocalTimestamp?: (ctx: LocalTimestampContext) => void;
2722+
/**
2723+
* Enter a parse tree produced by the `listAgg`
2724+
* labeled alternative in `TrinoSqlParser.primaryExpression`.
2725+
* @param ctx the parse tree
2726+
*/
2727+
enterListAgg?: (ctx: ListAggContext) => void;
2728+
/**
2729+
* Exit a parse tree produced by the `listAgg`
2730+
* labeled alternative in `TrinoSqlParser.primaryExpression`.
2731+
* @param ctx the parse tree
2732+
*/
2733+
exitListAgg?: (ctx: ListAggContext) => void;
27222734
/**
27232735
* Enter a parse tree produced by the `jsonObject`
27242736
* labeled alternative in `TrinoSqlParser.primaryExpression`.
@@ -3043,18 +3055,6 @@ export class TrinoSqlListener implements ParseTreeListener {
30433055
* @param ctx the parse tree
30443056
*/
30453057
exitPosition?: (ctx: PositionContext) => void;
3046-
/**
3047-
* Enter a parse tree produced by the `listagg`
3048-
* labeled alternative in `TrinoSqlParser.primaryExpression`.
3049-
* @param ctx the parse tree
3050-
*/
3051-
enterListagg?: (ctx: ListaggContext) => void;
3052-
/**
3053-
* Exit a parse tree produced by the `listagg`
3054-
* labeled alternative in `TrinoSqlParser.primaryExpression`.
3055-
* @param ctx the parse tree
3056-
*/
3057-
exitListagg?: (ctx: ListaggContext) => void;
30583058
/**
30593059
* Enter a parse tree produced by the `searchedCase`
30603060
* labeled alternative in `TrinoSqlParser.primaryExpression`.

0 commit comments

Comments
 (0)