-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplify nexmark query 6 using one sql stmt (#334)
* feat: simplify nexmark query 6 using one sql stmt * fix: nanosecond type for streaming process * fix: typo
- Loading branch information
Showing
14 changed files
with
249 additions
and
127 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,19 @@ | ||
SELECT Count(DISTINCT seller) | ||
FROM auction | ||
INNER JOIN bid | ||
ON a_id = auction | ||
WHERE b_date_time BETWEEN a_date_time AND expires; | ||
|
||
|
||
SELECT seller, | ||
Max(price) AS final | ||
FROM auction | ||
INNER JOIN bid | ||
ON a_id = auction | ||
WHERE b_date_time BETWEEN a_date_time AND expires | ||
GROUP BY a_id, | ||
seller | ||
ORDER BY seller; | ||
|
||
|
||
SELECT seller, | ||
Avg(final) | ||
FROM q | ||
FROM (SELECT ROW_NUMBER() | ||
OVER ( | ||
PARTITION BY seller | ||
ORDER BY date_time DESC) AS row, | ||
seller, | ||
final | ||
FROM (SELECT seller, | ||
Max(price) AS final, | ||
Max(b_date_time) AS date_time | ||
FROM auction | ||
INNER JOIN bid | ||
ON a_id = auction | ||
WHERE b_date_time BETWEEN a_date_time AND expires | ||
GROUP BY a_id, | ||
seller) AS Q) AS R | ||
WHERE row <= 10 | ||
GROUP BY seller; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ mod q3; | |
mod q4; | ||
mod q5; | ||
mod q6; | ||
mod q6_v2; | ||
mod q7; | ||
mod q8; | ||
mod q9; |
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
Oops, something went wrong.