Giter Site home page Giter Site logo

Comments (4)

HaydenOrz avatar HaydenOrz commented on June 2, 2024

@ouzhou 这是一个不好解决,也是一个见仁见智的问题,在这里已经有过类似的讨论 #189 (comment)

如果按你提到的这种情况下,返回 database 和 table,这在 hive 中没有任何问题。

但是在 Trino / Flink 中有三层结构(catalog -> database -> table), 并且sql文本为 SELECT * FROM a.b<插入位置>,相应的应该返回 database 和 table,因为无法确定 a.b 是 catalog.database 还是 database.table 。这样的返回实际上显得有些奇怪,因为即使这样返回了,你仍然需要通过附带的 wordRanges 和 引擎真实的元数据信息结合来做一些判断。

目前dt-sql-parser 在处理这个问题时,不再考虑是否应该返回 database 或者 catalog,统一返回 table,开发者可以通过附带的 wordRanges 自行判断。这实际上也与许多文档中对语法的描述相对应,比如 hive 的 query 文档
image

另外,在hive 这种只有两层结构的sql语言中仍然保持只返回 table 的原因是,我们希望所有的 SQL 语言parser 的 API 的表现保持一致。

from dt-sql-parser.

ouzhou avatar ouzhou commented on June 2, 2024

看了一下#189,目前是只支持拿本地上下文内craete的table进行补全吗?
如果是要做提前判断用户接下来要输入一个表名,使用从接口来的表名列表补全,应该如何实现?

from dt-sql-parser.

LuckyFBB avatar LuckyFBB commented on June 2, 2024

看了一下#189,目前是只支持拿本地上下文内craete的table进行补全吗? 如果是要做提前判断用户接下来要输入一个表名,使用从接口来的表名列表补全,应该如何实现?

目前支持使用接口来进行表名补全,你可以参考 monaco-sql-languages的实现

1

from dt-sql-parser.

ouzhou avatar ouzhou commented on June 2, 2024
image

WHERE语句后面似乎不支持

from dt-sql-parser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.