DBeaver - Clickhouse - SQL 错误 [159] .. 读取超时

9
我在运行一个查询,在一个有13亿行的数据库上出现了"读取超时"的提示。
这并不是一个特别高级的查询,它只是将推文中的标签组合在一起。
SELECT case when match(hashtag, 
            '[Cc]orona.*|COVID.*|[Cc]ovid.*|[Cc]oVID_19.*|[Cc]orvid19.*|COVD19.*|CORONA.*|KILLTHEVI.*|SARSCoV.*|ChineseVi.*|WuhanVir.*|ChinaVir.*|[Vv]irus.*|
            [Qq]uarantine|[Pp]andemic.*|[Cc]linical[Tt]rial.*|FlattenTheCurve.*|SocialDistancing.*|StayHome.*|StayTheFHome.*|StayAtHome.*|stopthespread.*|
            SafeHands.*|WashYourHands.*|SelfIsolation.*')                           then 'COVID19' 
            when match(hashtag, '[Jj]anta[Cc]urfew.*|[Jj]anata[Cc]urfew.*')         then 'JantaCurfew'
            when match(hashtag, 'Bhula.*')                                          then 'Bhula'
            when match(hashtag, '[Ss]t[Pp]atrick.*|HappyStPatrick')                 then 'StPatricks day'
            when match(hashtag, '[Cc]hina.*')                                       then 'China'
            when match(hashtag, '[Ii]taly.*')                                       then 'Italy'
            when match(hashtag, '[Ii]ran.*')                                        then 'Iran'
            when match(hashtag, '[Ii]ndia.*')                                       then 'India'
            when match(hashtag, '[Hh]appy[Mm]others[Dd]ay.*|[Mm]others[Dd]ay.*')    then 'MothersDay'
            else hashtag END
            as Hashtag,
  SUM(CASE WHEN created >= '2020-05-14 00:00:00' AND created <= '2020-03-14 23:59:59' THEN 1 END) "May 14th'20",
  SUM(CASE WHEN created >= '2020-05-13 00:00:00' AND created <= '2020-03-13 23:59:59' THEN 1 END) "May 13th'20",
  SUM(CASE WHEN created >= '2020-05-12 00:00:00' AND created <= '2020-03-12 23:59:59' THEN 1 END) "May 12th'20"
FROM twitterDBhashtags
group by Hashtag 
order by "May 12th'20" DESC limit 20;

ClickHouse运行在条带化的硬盘上,并通过千兆网络进行访问。

如果超时是挑战的话,如何才能更改超时时间以获得更多时间呢?

如果可能的话,我非常想能够运行长达数分钟的查询而不会收到“读取超时”消息。

1个回答

28

CH JDBC驱动程序默认的socket_timeout为30000(30秒)

在高级选项卡下,您可以配置高级连接设置,例如字符编码。

连接/高级属性/新属性 -> socket_timeout = 300000


5
太好了,我知道我错过了什么。树和森林... "编辑连接" -> "驱动程序属性" -> 滚动列表到 "socket_timeout" :-)。现在它愉快地运行。 - questionmark
1
在社区版版本22.2.4.202211061524中,右键单击连接->编辑(F4)->驱动程序属性选项卡->套接字超时。 - Ajay M
现在的编程领域使用驼峰命名法 -> 套接字超时 - nashvent

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接