-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
web: fix player history request - CH is not using projection
- Loading branch information
1 parent
a7c91ba
commit 480fd77
Showing
6 changed files
with
29,062 additions
and
29,004 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
57,982 changes: 28,991 additions & 28,991 deletions
57,982
sql/init_scripts/sample_data/player_stats.csv
Large diffs are not rendered by default.
Oops, something went wrong.
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
40 changes: 40 additions & 0 deletions
40
web/test/databases/requests/playerstats/player/PlayerHistoryRequestTest.scala
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,40 @@ | ||
package databases.requests.playerstats.player | ||
|
||
import common.StringExt.StringExt | ||
import databases.requests.ClickhouseRequest | ||
import org.scalatest.{FunSuite, Matchers} | ||
|
||
class PlayerHistoryRequestTest extends FunSuite with Matchers { | ||
test("Test player history request with settings") { | ||
PlayerHistoryRequest.builder(1L).sqlWithParameters() | ||
.sql | ||
.normalize() shouldBe ( | ||
s"""SELECT league_id, | ||
|league_unit_id, | ||
|league_unit_name, | ||
|player_id, | ||
|first_name, | ||
|last_name, | ||
|team_id, | ||
|team_name, | ||
|(age * 112) + days as age, | ||
|tsi, | ||
|rating, | ||
|rating_end_of_match, | ||
|cup_level, | ||
|${ClickhouseRequest.roleIdCase("role_id")} as role, | ||
|played_minutes, | ||
|injury_level, | ||
|salary, | ||
|yellow_cards, | ||
|red_cards, | ||
|goals, | ||
|season, | ||
|round, | ||
|nationality | ||
|FROM hattrick.player_stats | ||
| WHERE ((player_id = 1)) ORDER BY season DESC , round DESC , cup_level ASC SETTINGS optimize_read_in_order = 0""" | ||
.stripMargin.normalize() | ||
) | ||
} | ||
} |
5 changes: 2 additions & 3 deletions
5
.../player/PlayerGamesGoalsRequestTest.scala → ...r/stats/PlayerGamesGoalsRequestTest.scala
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