Skip to content
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

mysql下使用full join和case when语法会飘红提示错误 #134

Closed
qinyouzhi opened this issue Jun 19, 2024 · 6 comments
Closed

mysql下使用full join和case when语法会飘红提示错误 #134

qinyouzhi opened this issue Jun 19, 2024 · 6 comments
Assignees

Comments

@qinyouzhi
Copy link

1.当使用别名时full join语法会报错
如:
select * from db1.table1 as t1 full join

2.case when语法报错
如:
select
id,
case when age = 18 then '成年'
when age = 60 then '老年' else '未知' end name

@liuxy0551 liuxy0551 self-assigned this Jun 19, 2024
@liuxy0551
Copy link
Collaborator

  1. mysql 中未找到 full join 语法的支持,查找资料发现可以通过 LEFT JOINRIGHT JOIN 组合去实现。
  2. 验证了下确实存在这个问题,当 CASE WHEN 之间没有 case_value 时,会有飘红提示,这需要由 dt-sql-parser 修复。稍晚些时候提供版本号。

liuxy0551 added a commit to liuxy0551/monaco-sql-languages that referenced this issue Jun 19, 2024
@liuxy0551
Copy link
Collaborator

你可以使用 [email protected] ,在这个版本解决了 CASE WHEN 有飘红的问题,语法参考的是:https://dev.mysql.com/doc/refman/5.7/en/case.html

image

@qinyouzhi
Copy link
Author

非常感谢,还有个问题需要咨询一下:
我在用spark时语句where后不会提示column,在select后面可以正常提示,是设计就如此吗?

@liuxy0551
Copy link
Collaborator

非常感谢,还有个问题需要咨询一下: 我在用spark时语句where后不会提示column,在select后面可以正常提示,是设计就如此吗?

可以提供下示例语句吗

@qinyouzhi
Copy link
Author

例如:
select column1, column2 from database.table1 这里的column1, column2会根据表字段进行提示

select * from database.table1 where column1 这里的column1在输入的时候没有提示,syntax只有function

@liuxy0551
Copy link
Collaborator

目前确实多个方言有这个问题,我们将在近期支持,后续可以在 DTStack/dt-sql-parser#322 中查看进度。

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

No branches or pull requests

2 participants