S02042

错误代码

S02042

报错信息

Distributed queries do not support the ‘exists’ keyword. RefId:S02042

错误原因

在分布式表查询中,WHERE 子句不支持 EXISTS 关键字。以下示例将导致错误:

dbName = "dfs://test"
if (existsDatabase(dbName)) {
	dropDatabase(dbName)
}
t = table(2023.01.01..2023.01.03 as tradeDate)
db = database(dbName, VALUE, 2023.01.01..2023.01.03)
pt = db.createPartitionedTable(t, `pt, `tradeDate)
pt.append!(t)

select * from pt where exists(select * from t where t.tradeDate=pt.tradeDate)

解决办法

检查分布式表查询 WHERE 子句是否使用了 EXISTS 关键字。