我用的是python api
factors = s.table("dfs://K_FACTOR_LONG", "factor_k_long")
kline = s.table("dfs://daily", "quotes")
t1 = trade.select("value").where("tradetime between timestamp(2023.11.06):timestamp(2023.11.11)").pivotby("tradetime", "securityid,factorname")
m = t1.merge(kline, left_on=["securityid", "time_key"], right_on=["securityid", "tradetime"], how="left")
factors是根据官方教程生成的alpha101窄表,kline是原始分钟k线数据。 我想把这两个表拼在一起。
报错如下:
File "ddb_read.py", line 29, in <module>
m = t1.merge(kline, left_on=["securityid", "time_key"], right_on=["securityid", "tradetime"], how="left")
AttributeError: 'TablePivotBy' object has no attribute 'merge'
希望join能在db端完成,而不是toDF后python这边做。 (这样效率高一些?