Skip to content

feat: collect entity's attribute(comment,alias,colType) #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Aug 23, 2024

Conversation

Cythia828
Copy link
Collaborator

@Cythia828 Cythia828 commented Jul 9, 2024

Feat

#340

  • 收集TrinoSQL里实体的comment,colType,alias属性
  • 收集HiveSQL里实体的comment,colType,alias属性
  • 收集ImpalaSQL里实体的comment,colType,alias属性
  • 收集SparkSQL里实体的comment,colType,alias属性
  • 收集PostgreSQL里实体的comment,colType,alias属性
  • 收集Mysql里实体的comment,colType,alias属性

Tips

  • 关于endContextList,后期都有调整过,原因是我们查找的顺序是从实体所在的位置去查找的,而结束节点是为了让向上查找提前结束,如果设置的节点是与实体同层甚至比实体层级更低的话,那么向上查找会一直找到跟节点,增加无谓的查找,所以调整endContextList里的结束节点,一定是在实体节点的上层的节点
  • 关于function,需要后面针对function做一个统一的整理:alias、arguments、returns等
  • 关于pushEntity的第三个参数attrInfo的类型,改为AttrInfo[]AttrInfo里的attrName为字符串,这样能保证每个属性与其结束节点是对应的,不会因为别的属性的结束节点提交结束查找而错过正确答案

@Cythia828 Cythia828 changed the title WIP: feat(trinosql): collect trino sql's attribute(comment,alias,colType..) feat(trinosql): collect trino sql's attribute(comment,alias,colType..) Jul 9, 2024
@Cythia828 Cythia828 changed the title feat(trinosql): collect trino sql's attribute(comment,alias,colType..) feat: collect entity's attribute(comment,alias,colType) Jul 12, 2024
@Cythia828 Cythia828 marked this pull request as ready for review July 30, 2024 09:54
@Cythia828 Cythia828 changed the title feat: collect entity's attribute(comment,alias,colType) WIP: feat: collect entity's attribute(comment,alias,colType) Jul 30, 2024
@Cythia828 Cythia828 force-pushed the feat/collect_attribute branch from 4bd17fe to c291daf Compare August 2, 2024 06:20
@Cythia828 Cythia828 changed the title WIP: feat: collect entity's attribute(comment,alias,colType) feat: collect entity's attribute(comment,alias,colType) Aug 19, 2024
@HaydenOrz HaydenOrz merged commit 7dc1d46 into DTStack:next Aug 23, 2024
5 checks passed
HaydenOrz pushed a commit to HaydenOrz/dt-sql-parser that referenced this pull request Aug 27, 2024
* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>
HaydenOrz pushed a commit that referenced this pull request Oct 17, 2024
* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>
liuxy0551 pushed a commit to liuxy0551/dt-sql-parser that referenced this pull request Oct 21, 2024
* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>
liuxy0551 pushed a commit to liuxy0551/dt-sql-parser that referenced this pull request Nov 14, 2024
* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>
liuxy0551 pushed a commit that referenced this pull request Nov 14, 2024
* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>
@mumiao mumiao mentioned this pull request Feb 13, 2025
mumiao added a commit that referenced this pull request Feb 13, 2025
* feat: improve errorListener msg (#281)

* feat: add mysql errorListener and commonErrorListener

* feat: improve other sql error msg

* feat: support i18n for error msg

* feat: add all sql errorMsg unit test

* feat: update locale file and change i18n funtion name

* test: upate error unit test

* feat(flinksql): collect comment, type attribute for entity (#319)

* feat(flinksql): collect comment, type attribute for entity

* feat(flinksql): delete console log

* fix(#305): delete function ctxToWord,using ctxToText instead of ctxToWord

* feat: update attribute's type

* feat(flinksql): update flinksql's entitycollect unit test

* feat: optimize interface and update unit test

* feat: update collect attr detail

* feat: optimize interface and some function's arguments

* feat: add comment and update params' name

* feat: collect alias in select statement

* feat: update collect attribute function and update unit test

---------

Co-authored-by: zhaoge <>

* fix: spell check (#337)

Co-authored-by: liuyi <[email protected]>

* ci: check-types and test unit update

* feat: collect entity's attribute(#333)

* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>

* chore(release): 4.1.0-beta.0

* fix: #362 set hiveVar value (#369)

* fix: #371 export EntityContext types (#372)

* fix: minimum collect candidates boundary to fix parse performance (#378)

* fix: minimum collect candidates boundary to fix parse performance

* fix: fix check-types

* fix: remove debugger code

* fix(flink): fix flinksql syntax error about ROW and function using (#383)

Co-authored-by: zhaoge <>

* build: pnpm antlr4 --lang all

---------

Co-authored-by: 霜序 <[email protected]>
Co-authored-by: XCynthia <[email protected]>
Co-authored-by: 琉易 <[email protected]>
Co-authored-by: liuyi <[email protected]>
Co-authored-by: zhaoge <>
Co-authored-by: Hayden <[email protected]>
Co-authored-by: JackWang032 <[email protected]>
mumiao added a commit that referenced this pull request May 8, 2025
* feat: improve errorListener msg (#281)

* feat: add mysql errorListener and commonErrorListener

* feat: improve other sql error msg

* feat: support i18n for error msg

* feat: add all sql errorMsg unit test

* feat: update locale file and change i18n funtion name

* test: upate error unit test

* feat(flinksql): collect comment, type attribute for entity (#319)

* feat(flinksql): collect comment, type attribute for entity

* feat(flinksql): delete console log

* fix(#305): delete function ctxToWord,using ctxToText instead of ctxToWord

* feat: update attribute's type

* feat(flinksql): update flinksql's entitycollect unit test

* feat: optimize interface and update unit test

* feat: update collect attr detail

* feat: optimize interface and some function's arguments

* feat: add comment and update params' name

* feat: collect alias in select statement

* feat: update collect attribute function and update unit test

---------

Co-authored-by: zhaoge <>

* fix: spell check (#337)

Co-authored-by: liuyi <[email protected]>

* ci: check-types and test unit update

* feat: collect entity's attribute(#333)

* feat(trinosql): collect trino sql's attribute(comment,alias,colType)

* feat(hivesql): collect hive sql's attribute(comment,alias,colType)

* feat(impalasql): collect attribute(comment, colType, alias)

* feat(sparksql): collect entity's attribute (comment,alias, colType)

* feat: update endContextList of collect attribute

* feat(postgresql): collect hive sql's attribute(alias,colType)

* feat: update interface of attrInfo and alter entitycollect ts file

* feat(mysql): collect entity's attribute(comment,colType,alias)

* ci: fix check-types problem

---------

Co-authored-by: zhaoge <>

* chore(release): 4.1.0-beta.0

* fix: #362 set hiveVar value (#369)

* fix: #371 export EntityContext types (#372)

* fix: minimum collect candidates boundary to fix parse performance (#378)

* fix: minimum collect candidates boundary to fix parse performance

* fix: fix check-types

* fix: remove debugger code

* fix(flink): fix flinksql syntax error about ROW and function using (#383)

Co-authored-by: zhaoge <>

* build: pnpm antlr4 --lang all

* Feat/follow keywords (#407)

* feat: provide follow keywords when get suggestions

* chore: add watch script

* refactor: optimize spark grammar (#360)

* feat: support semantic context of isNewStatement (#361)

* feat: support semantic context of isStatamentBeginning

* docs: add docs for semantic context

* feat: unify variables in lexer (#366)

* feat: unify variables in lexer

* fix: all sql use WHITE_SPACE

* feat: complete after error syntax (#334)

* refactor: split getMinimumParserInfo to slice input and parser again

* test: complete after error syntax

* feat: complete after error syntax

* feat: use createParser to get parserIns and remove parserWithNewInput

* feat(all sql): add all sql expression column (#358)

* feat(impala): add impala expression column

* feat(trino): add expression column

* feat(hive): add hive expression column

* feat(spark): add spark expression column

* feat(mysql): add mysql expression column unit test

* feat(flink): add flink expression column

* feat(postgresql): add pg expression column

* feat: #410 optimize processCandidates tokenIndexOffset (#411)

* test: test suggestion wordRanges with range when processCandidates without tokenIndexOffset

* feat: #410 optimize processCandidates tokenIndexOffset

---------

Co-authored-by: 霜序 <[email protected]>
Co-authored-by: XCynthia <[email protected]>
Co-authored-by: 琉易 <[email protected]>
Co-authored-by: liuyi <[email protected]>
Co-authored-by: zhaoge <>
Co-authored-by: Hayden <[email protected]>
Co-authored-by: JackWang032 <[email protected]>
Co-authored-by: JackWang032 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants