question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feat] Sql autocomplete (I can apply my code solution )

See original GitHub issue

Feature Request

您的功能诉求是否是跟某个问题相关的? We need Sql autocomplete in StreamX.

StreamX 中没有Sql autocomplete ,使用不友好。

你希望的新功能诉求是怎么样的? We are human, we always depends on autocompelete or hits to development. We need auto parser to notice user their sql grammar is not right before running. 开发的时候有自动提示,启动前提示用户 sql 语法哪里错了,可能的值。

您为此有过什么替代方案? Sql client notic and so on . However Sql client notice is not perfect.(ps: I can apply my solution ).

Sql client 的实现(很烂)。HueZeppeline 的挺好用。

辅助文档 我的实现方案(分阶段实现):

  • 方案1
  1. 移植HueZeppline的实现(可能存在许可问题)。
  • 方案2
  1. 移植 Flink sql client实现。
  • 方案3(我们内部的实现方案)
  1. 第一阶段: 利用Fst树+词频统计实现。(我们是基于 ES suggestion做的。我可以写一个Java Fst 树实现)
  2. 第二阶段: 利用 Apache Calcite 解析上下文,提供上下提示,字段自动填充。

第三阶段(not only suggestion) ps: 更大胆一点,把Flink sql 做成数仓。平台封装Sql connector信息,通过特定语法或者是特定条件复用连接(我们的内部实现,这样还能屏蔽掉用户知道物理底层的连接信息,!!!让用户知道连接是一样很丑陋,且不安全的事情!!!)。 比如: show table 显示所有可用的连接信息等等这些特性,并且提示可用表等。

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
aiwenmocommented, Dec 26, 2021

您好,您的 Sql autocomplete 要通过大量的前后端交互来实现吗?对于 B/S 的系统,个人认为这个功能偏前端,前端可以提前加载后台的配置如词典或者元数据,然后具体的提示与补全逻辑可在前端实现,最后通过后台校验语法与逻辑是否可通过。此外在书写的过程中验证和校验的功能其实并不实用,因为不完整的句子一定是无法通过校验的。具体的实现可以参考一下 Dlink 的自定义语法提示与补全与语法和逻辑校验功能。希望此文可以帮助您。

0reactions
aiwenmocommented, Jan 3, 2022
<html> <body> <!DOCTYPE html>

<span md-inline="plain" class="md-plain" style="box-sizing: border-box;">Dlink</span>

  • <span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">环境配置信息</span>

<span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">Dlink : 0.4.0</span>

<span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">Flink : 1.11、1.12、1.13、1.14</span>

<figure class="md-table-fig" cid="n8" mdtype="table" style="box-sizing: border-box; margin: 1.2em 0px; overflow-x: auto; max-width: calc(100% + 16px); padding: 0px; cursor: default; color: rgb(51, 51, 51); font-family: "Open Sans", "Clear Sans", "Helvetica Neue", Helvetica, Arial, "Segoe UI Emoji", sans-serif; font-size: 16px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">
语法提示 方法提示 udf 上下文提示 输入纠错
支持,且支持自定义扩展及联想 支持,且支持自定义扩展及联想 支持,且支持自定义扩展及联想 支持,联想 支持,手动触发
</figure>
  1. <span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">由于 Dlink 的提示与补全原理使用了自定义规则的方式,所以满足所有的可能性,不过需要手动扩展规则。</span>

  2. <span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">Dlink 提供了更加专业的 sql 交互,可在线查询,使 FlinkSQL 的开发和使用更接近 Navicat、DataGrip 等。 </span>

<span md-inline="plain" class="md-plain" style="box-sizing: border-box;">源码解析(底层原理)</span>

<span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">Dlink 底层也是基于前端配合后端来做的。后端维护规则,前端根据规则和用户输入词进行联想与补全。</span>

<span md-inline="plain" class="md-plain" style="box-sizing: border-box; text-indent: 0px;">欢迎补充~</span>

</body> </html>
Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL IntelliSense and Autocomplete in SSMS | Redgate
Phil Factor reviews the major features of SSMS IntelliSense and autocomplete and then explains how SQL Prompt fills in the gaps, and how...
Read more >
[Feat] Sql autocomplete (I can apply my code solution ) #504
We are human, we always depends on autocompelete or hits to development. We need auto parser to notice user their sql grammar is...
Read more >
Intellisense accept shortcut - sql - Stack Overflow
I'm used to use enter, but sql management studio seem to accept only Tab or Space key - enter just cancels suggestion and...
Read more >
dbForge SQL Complete - IntelliSense and Code Formatting in ...
Write, beautify, refactor your SQL code and give your productivity a dramatic boost with the features that are included in SQL Complete but...
Read more >
Identify issues with IntelliSense (SSMS) - SQL - Microsoft Learn
Select the Edit menu, select IntelliSense, then select Refresh Local Cache. Use the CTRL+Shift+R keyboard shortcut. Disconnect your editor ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found