pivotby的表如何和其他table进行join

我用的是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这边做。 (这样效率高一些?

请先 登录 后评论

1 个回答

Boye

是的,db端完成join效率高

请先 登录 后评论
  • 1 关注
  • 0 收藏,364 浏览
  • eric 提出于 2023-11-28 00:14

相似问题