Comments (4)
@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 文档
另外,在hive 这种只有两层结构的sql语言中仍然保持只返回 table 的原因是,我们希望所有的 SQL 语言parser 的 API 的表现保持一致。
from dt-sql-parser.
看了一下#189,目前是只支持拿本地上下文内craete的table进行补全吗?
如果是要做提前判断用户接下来要输入一个表名,使用从接口来的表名列表补全,应该如何实现?
from dt-sql-parser.
看了一下#189,目前是只支持拿本地上下文内craete的table进行补全吗? 如果是要做提前判断用户接下来要输入一个表名,使用从接口来的表名列表补全,应该如何实现?
目前支持使用接口来进行表名补全,你可以参考 monaco-sql-languages的实现
from dt-sql-parser.
WHERE语句后面似乎不支持
from dt-sql-parser.
Related Issues (20)
- Spark 支持物化视图语法
- tokenSuggestion 的单测断言部分能否不考虑数组顺序呢?
- [Feature Request]: 将运行时从 antlr4ts 切换到 antlr4ng HOT 1
- 如何在浏览器环境中直接使用? HOT 8
- [Bug]: The Trino parser seems to be broken HOT 2
- [Feature Request]: ErrorListener 的错误信息优化,需要支持国际化
- webpack production mod 下代码执行报错 HOT 7
- [Bug]:浏览器环境本地开发时可正常使用,执行yarn build后 部署到服务器页面报错 HOT 3
- 某些语句遇到错误没有全部捕获 HOT 1
- [Bug]: 构建产物缺失 HOT 5
- [Feature Request]: 如何实现自动提示字段? HOT 3
- [Bug]: getAllEntities的isContainCaret判断异常 HOT 3
- [Feature Request]: upgrade with trino/core
- [Bug]: lifecycle for dtstack
- [Bug]: impala suggestion without data types
- [Bug]: impala syntax error
- [Bug]: hive not support set configuration properties
- [Bug]: webpack mode=production模式下,文件访问报错 HOT 1
- [Bug]: pgsql truncate table suggestion
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dt-sql-parser.