Commit f2dc64f
authored
merge branch next to main, next version(4.5.0) content (#474)
* feat: support query result and derived table entity collecting (#434)
* feat: support queryResult and derived table entities collecting
* feat: support query result and derived table entity collecting
* test: enhance hive and spark entity collect test case
* fix: remove _ctx and add tokenIndex into position
* fix: rename declareType COMMON to LITERAL
* fix: optimize entity collector and update grammar
* test: add derived table and query result entities test case
* fix: remove isCaretInDerivedTableStmt and set default isAccessible to null
* fix: update _caretStmt docs
* test: add isAccessible test case
* fix: skip _caretStmt ts check
* docs: update README to include additional entity information
* test: fix create view test case
* fix: import from error sql module
* test: update entity collection tests
* fix: remove unused type
* chore: remove duplicate changelog in v4.4.1
* chore(release): 4.5.0-beta.0
* Next merge main (#468)
* fix(flink): #455 fix json functions' params problem in flink
* fix(flink): some grammar rules (#465)
* fix: #464 order by + expression
* fix: #464 EXTRACT function
* test: #464 flink JSON_VALUE RETURNING
* chore(release): 4.4.2
---------
Co-authored-by: zhaoge <>
Co-authored-by: JackWang032 <64318393+JackWang032@users.noreply.github.com>
* fix(parser): #283 collect errors from all erroneous statements in multi-statement input (#470)
* test(parser): #283 add multi-statement error validation tests for all dialects
* fix(parser): #283 collect errors from all erroneous statements in multi-statement input
* feat: add generic SQL language support (#469)
* fix(generic): fix INTERSECT/EXCEPT support, trim keywords to ~90
- Add INTERSECT and EXCEPT to queryNoWith rule for set operations
- Remove 173 unused KW_* lexer rules for removed features (views, indexes,
grants, transactions, stored procedures, window functions, triggers, etc.)
- Trim nonReserved list to only keywords actually used in parser rules
- Remove unused UNICODE_STRING and DIGIT_IDENTIFIER lexer rules
- Keyword count reduced from 263 to 90 (close to ~100 target)
- All 197 test suites pass (5627 tests)
* fix(generic): reserve core structural keywords and add DIGIT_IDENTIFIER
- Remove core structural keywords from nonReserved so they cannot be
used as identifiers: SELECT, FROM, WHERE, CREATE, TABLE, INSERT,
UPDATE, DELETE, DROP, ALTER, SET, JOIN, GROUP, HAVING, ORDER, ON,
UNION, INTERSECT, EXCEPT, INTO, NOT, AND, OR, IN, BETWEEN, LIKE,
IS, EXISTS, CASE, WHEN, THEN, ELSE, END, CAST, AS, DISTINCT,
PRIMARY, CONSTRAINT, REFERENCES, COLUMN, UNIQUE, CHECK, FOREIGN,
RENAME, RECURSIVE, WITH, NULL, ESCAPE, NULLIF
- Add DIGIT_IDENTIFIER lexer token for identifiers starting with a
digit (e.g. 123abc, 1st_column)
- Include DIGIT_IDENTIFIER in identifier rule alternatives
* fix(generic): add missing Listener/Visitor exports and diagnostics option
- Add GenericSqlListener and GenericSqlVisitor exports to src/index.ts
- Add GenericSQLOptions interface with configurable diagnostics flag
- Override validate() to return empty array when diagnostics disabled
- Export GenericSQLOptions type from src/index.ts
* fix(generic): add QUERY_RESULT and SELECT column entity collection
- Add exitQuerySpecification for QUERY_RESULT entity tracking
- Add exitSelectItem for column entity collection in SELECT clauses
- Track wildcard columns (ColumnDeclareType.ALL) for * and table.*
- Track expression columns with alias support (ColumnDeclareType.EXPRESSION)
- Stage previously untracked files (errorListener, splitListener, semanticContextCollector)
* test: add GenericSQL tests
* test: ensure all dialect tests pass with GenericSQL
* test(generic): add more sql test
- Add comprehensive syntax tests for all supported statement types
- Add context collect tests for entity and semantic collectors
- Add suggestion tests for token, syntax, and multi-statement scenarios
- Add error strategy, listener, visitor, and validation tests
- Fix entity collector to distinguish simple columns from expressions
* feat: match empty column when in entityCollecting context (#457) (#472)
* chore(release): 4.3.0
* fix(common): #424 allTokens slice when caretTokenIndex use tokenIndexOffset (#426)
* test: #424 syntax after comments
* fix(common): #424 allTokens slice when caretTokenIndex use tokenIndexOffset
* chore(release): 4.3.1
* fix(postgresql): #432 remove error rule
* test: #432 validate unComplete sql
* fix: #432 remove error rule
* feat: mark as entityCollecting in getAllEntities context to allow empty column
* chore: update jest.config.js to hide console.log
* fix(flink): #442 fix flink's insert values() can't support function problem
* feat: remove noReserved keywords in completions
* test: add filter keywords test case
* test: #438 sync suggestion no duplicate syntaxContextType
* fix: #438 syntaxContextType not duplicate
* chore(release): 4.4.0-beta.0
* chore(release): 4.4.0
* feat: support query result and derived table entity collecting (#434)
* feat: support queryResult and derived table entities collecting
* feat: support query result and derived table entity collecting
* test: enhance hive and spark entity collect test case
* fix: remove _ctx and add tokenIndex into position
* fix: rename declareType COMMON to LITERAL
* fix: optimize entity collector and update grammar
* test: add derived table and query result entities test case
* fix: remove isCaretInDerivedTableStmt and set default isAccessible to null
* fix: update _caretStmt docs
* test: add isAccessible test case
* fix: skip _caretStmt ts check
* docs: update README to include additional entity information
* test: fix create view test case
* fix: import from error sql module
* test: update entity collection tests
* fix: remove unused type
* feat: match empty column when in entityCollecting context
* feat: optimize collecting entity when match empty column in entityCollecting context (#467)
Co-authored-by: Cythia828 <942884029@qq.com>1 parent d6e1df2 commit f2dc64f
150 files changed
Lines changed: 75670 additions & 46906 deletions
File tree
- docs/images
- src
- grammar
- flink
- generic
- hive
- impala
- mysql
- postgresql
- spark
- trino
- lib
- flink
- generic
- hive
- impala
- mysql
- postgresql
- spark
- trino
- parser
- common
- flink
- generic
- hive
- impala
- mysql
- postgresql
- spark
- trino
- test/parser
- flink
- contextCollect
- fixtures
- suggestion
- generic
- contextCollect
- fixtures
- suggestion
- fixtures
- syntax
- fixtures
- hive
- contextCollect
- fixtures
- suggestion
- impala
- contextCollect
- fixtures
- suggestion
- mysql
- contextCollect
- fixtures
- suggestion
- fixtures
- postgresql
- contextCollect
- fixtures
- suggestion
- fixtures
- spark
- contextCollect
- fixtures
- suggestion
- trino
- contextCollect
- fixtures
- suggestion
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
27 | 37 | | |
28 | 38 | | |
29 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
| 334 | + | |
| 335 | + | |
333 | 336 | | |
334 | 337 | | |
335 | 338 | | |
| |||
346 | 349 | | |
347 | 350 | | |
348 | 351 | | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
353 | 383 | | |
354 | 384 | | |
355 | 385 | | |
356 | 386 | | |
357 | 387 | | |
358 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
359 | 527 | | |
360 | 528 | | |
361 | 529 | | |
| |||
0 commit comments