我在分布式表上测试查询时遇到了问题。
SQL是这样的:
select distinct OriginCityName from on_time.ontime_all t where t."OriginStateName" = 'California'
' on_time.ontime_all'是一个分布式表,其中包含OriginCityName列,OriginStateName列和其他一些列。错误:
Received exception from server (version 1.1.54381):
Code: 171. DB::Exception: Received from localhost:9000, ::1. DB::Exception: Block structure mismatch in UNION stream: different number of columns:
OriginCityName String String(size = 0)
OriginCityName String String(size = 0), OriginStateName String String(size = 0).
0 rows in set. Elapsed: 0.186 sec.
但是,如果我对SQL执行以下操作之一,则错误消失:
select distinct *
这种SQL对我的应用程序很重要,所以有人可以帮我解决这个问题吗?它是一个bug还是ClickHouse的限制?非常感谢你。