-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 不使用 last_value,而是基于 groupArray 获取最新 factor
在 day 和 east 的子命令参数上增加 --keep-factor,来保留 factor.csv。 close #33
- Loading branch information
Showing
5 changed files
with
67 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
WITH | ||
df AS ( | ||
SELECT | ||
code, | ||
arrayLast( | ||
x->true, | ||
arraySort(x->x.1, groupArray(( | ||
date, close, factor | ||
))) | ||
) AS t | ||
FROM | ||
rustdx.factor | ||
GROUP BY | ||
code | ||
) | ||
SELECT code, t.1 AS date, t.2 AS close, t.3 AS factor FROM df; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters