梅开二度:我在 VS Code 上又写了一个 Hive&Spark SQL 的插件
本文首发于 2023.11.20。
在几个月前,我在公司内部推广了我写的 FlinkSQL 插件,收到了较好的反馈。具体介绍可以见我之前写的博客——《想在 DataGrip 里写 SQL 般丝滑的写 FlinkSQL?安装它就完事儿了》。
后来我开始学习离线开发,有一次看见离线同学在开发时,来回跳三个窗口:
一个是文本编辑器,用来编辑并整理(手动 format)自己的 SQL。
一个内网的网页,用来校验语法错误并保存。
还有一个数据库连接软件 dbeaver,用来连上去跑 SQL。
一时半刻我看得眼花缭乱,不禁问他:难道没有什么好的工具可以统一编辑、format、校验语法错误的事吗?他告诉我没有,至少在免费软件里没有。
从那刻起,我诞生了一个想法——撸一个和 Flink SQL Helper 差不多的插件,但是 for Hive and Spark SQL。我趁着国庆休假的时候完成了大部分逻辑,并陆陆续续自测、在公司里小范围推广,收集反馈,目前已经打磨的比较好了。那么现在就来给大家介绍介绍这个好东西。
插件地址:https://marketplace.visualstudio.com/items?itemName=CamileSing.hive-sql-helper
1.功能介绍
代码高亮日常基操,不再赘述。自定义颜色参考上面地址的 2.1 Color theme recommend。
所有功能和 FlinkSQL Helper 一模一样,主打一个快乐陪伴,介绍功能时会尽量简述,有兴趣了解细节的可以看之前的文章。
1.1 代码补全

Snippets



1.2 语法错误提示


1.3 重构

1.4 发现文件中所有的引用处


1.5 格式化

2.使用方法
下载一个 VS Code or 打开 网页版 VS Code https://vscode.dev/
在插件拦中搜索
hive sql helper
。

除了语法错误提示,其他功能都是开箱即用的。如果想使用语法错误提示功能,需要打开设置(见下),并将保存方式改为手动保存,以获取较好的体验——语法检查会在保存时触发。

3.结语
以上内容为 Hive&Spark SQL Helper on VS Code v1.2.x 版本的主要功能。老规矩,如果大家有任何建议或者需求、问题反馈,可以在 Github 的 Issue(https://github.com/camilesing/Hive-SQL-Helper-VSCode/issues)中反馈,我看到后会第一时间回复。也欢迎各路大神一起参与开发,打造更好的插件。
版权声明: 本文为 InfoQ 作者【泊浮目】的原创文章。
原文链接:【http://xie.infoq.cn/article/1ebae754ecdc1c910edf36321】。未经作者许可,禁止转载。
评论