S02015

错误代码

S02015

报错信息

If the left table of a [xxx join] is an non-partitioned table, the right table cannot be a partitioned table. RefId:S02015

错误原因

2.00.9 之前的版本,同时满足以下条件时,会出现这个报错:

  • sqlDSsqlObj 是如下表连接查询语句:ljsljfjajpwjwj,且左表为非分区表,右表为分区表

  • 指定 forcePartition=false

在 2.00.8 版本上执行不满足上述条件的代码后会出现该报错。
dbName = "dfs://test"
if (existsDatabase(dbName)) {
    dropDatabase(dbName)
}

item = table(1..10 as id, 10+rand(100,10) as qty, 1.0+rand(10.0,10) as price)
promotion = table(1..10 as id, rand(0b 1b, 10) as flag, 0.5+rand(0.4,10) as discount);

db = database(dbName, VALUE, 1..10)
promotionPt = db.createPartitionedTable(promotion, `promotionPt, `id)
promotionPt.append!(promotion)

sqlDS(<select * from lj(item, promotionPt, `id)>)

解决办法

对于 2.00.9 之前的版本,在 sqlDSsqlObj 指定的表连接语句中,当左表是非分区表时,右表只能指定为非分区表。