如何在Clickhouse SQL查询中添加评论

发布于 2025-01-21 09:26:30 字数 426 浏览 0 评论 0原文

我遇到了这个奇怪的事情,想了解您如何处理它。

我正在使用摩纳哥编辑器编写SQL查询,然后使用Node Clickhouse库来运行查询,因此,在编辑器中,用户输入此查询:

-- Explain
select * from table 1

而发送到Clickhouse的查询就是这样:

-- Explain\nselect * from table 1

但是,当运行此问题时,我收到了错误,

:"SyntaxError: Unexpected number in JSON at position 2\n at pa...

似乎是注释了。这引起了错误。

您能告诉我如何在查询中发表评论并发送到Clickhouse运行吗?

I met this strange thing and want to understand how you handle it.

I am using Monaco editor to write sql query and then using node clickhouse library to run the query, so, in the editor, user entered this:

-- Explain
select * from table 1

and the query sent to clickhouse is this:

-- Explain\nselect * from table 1

But when running this, I got error

:"SyntaxError: Unexpected number in JSON at position 2\n at pa...

Seemed the comment here is causing the error.

Can you tell me how to put comment into the query and send to clickhouse to run?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半岛未凉 2025-01-28 09:26:30

您是否已经找到了解决问题的解决方案?
否则,我可以建议您使用“多行注释”,如下所示:

/* Explain */
SELECT * 
FROM table1

达到所需结果的问题。

Have you already found the solution to your problem?
Otherwise I can advise you to use the "multi-line comments" as follows:

/* Explain */
SELECT * 
FROM table1

It gets around the problem to achieve the desired result.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文