sqlglot - 为什么无法正确解析 DELETE SQL 语句?
为什么Python模块sqlglot无法正确解析DELETE SQL语句?
import sqlglot
sql="DELETE FROM MySchema.MyTable WHERE MyCol='MyValue'"
parsed=sqlglot.parse_one(sql)
结果:
parsed
(COMMAND this: DELETE, expression:
(LITERAL this: FROM MySchema.MyTable WHERE MyCol='MyValue', is_string: True))
为什么sqlglot能够解析其他DML命令(SELECT、INSERT、UPDATE)但不能解析DELETE?
我做错了什么吗?
谢谢。
Why Python module sqlglot is not able to parse correctly DELETE SQL Statement?
import sqlglot
sql="DELETE FROM MySchema.MyTable WHERE MyCol='MyValue'"
parsed=sqlglot.parse_one(sql)
Result:
parsed
(COMMAND this: DELETE, expression:
(LITERAL this: FROM MySchema.MyTable WHERE MyCol='MyValue', is_string: True))
Why sqlglot is capable of parsing the other DML commands (SELECT, INSERT, UPDATE) but not DELETE?
Am I doing something wrong?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
自 v1.24.2 起仅部分支持 DELETE 解析。我们将其解释为命令并解析其余部分。我并没有真正需要解析 DELETE,因此支持功能不完整。
编辑:从 v1.24.3 开始,SQLGlot 现在支持 DELETE FROM
DELETE parsing is only partially supported as of v1.24.2. We interpret it as a command and parse the rest. I haven't really had a need to parse DELETE and so support is not fully functional.
EDIT: As of v1.24.3, SQLGlot now supporst DELETE FROM