使用aj进行表连接时报错:The last joining column for asof join must be...?

我的连接语句如下:

login("admin", "123456")

if(existsDatabase("dfs://rangedb")){
    dropDatabase("dfs://rangedb")
}

n = 1000000
ID = rand(10, n)
TM1 = take(2000..2020, n)
TM2 = take(1990..2000, n)
x = rand(1.0, n)
y = rand(2.0, n)
tag1 = take(`A`B`C, n)
tag2 = take(`C`D`F, n)
t1 = table(TM1 as TM, ID, x, tag1 as tag)
t2 = table(TM2 as TM, ID, y, tag2 as tag)
db = database("dfs://rangedb", RANGE,  0 5 10)

pt1 = db.createPartitionedTable(t1, `pt1, `ID)
pt1.append!(t1)

pt2 = db.createPartitionedTable(t2, `pt2, `ID)
pt2.append!(t2)

select * from aj(t1, t2, `ID`tag);

报如下错误:
The last joining column for asof join must be an integer or temporal vector.

请问哪里不对?

阅读 1.7k
1 个回答

asof join的最后一个连接列通常为时间类型,也可为整数类型、UUID或IPADDR类型。这里的tag是string,所以不支持作为最后一个连接列。

推荐问题
logo
101 新手上路
子站问答
访问
宣传栏