-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IND-553]: Add support for trading reward tables in Athena (#930)
- Loading branch information
1 parent
a495f46
commit 06146b0
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
indexer/services/roundtable/src/lib/athena-ddl-tables/trading_reward_aggregations.ts
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,43 @@ | ||
import { | ||
getAthenaTableCreationStatement, | ||
getExternalAthenaTableCreationStatement, | ||
} from '../../helpers/sql'; | ||
|
||
const TABLE_NAME: string = 'trading_reward_aggregations'; | ||
const RAW_TABLE_COLUMNS: string = ` | ||
\`id\` binary, | ||
\`address\` string, | ||
\`startedAt\` string, | ||
\`startedAtHeight\` bigint, | ||
\`endedAt\` string, | ||
\`endedAtHeight\` bigint, | ||
\`period\` string, | ||
\`amount\` string | ||
`; | ||
const TABLE_COLUMNS: string = ` | ||
"id", | ||
"address", | ||
"startedAt", | ||
"startedAtHeight", | ||
"endedAt", | ||
"endedAtHeight", | ||
"period", | ||
"amount" | ||
`; | ||
|
||
export function generateRawTable(tablePrefix: string, rdsExportIdentifier: string): string { | ||
return getExternalAthenaTableCreationStatement( | ||
tablePrefix, | ||
rdsExportIdentifier, | ||
TABLE_NAME, | ||
RAW_TABLE_COLUMNS, | ||
); | ||
} | ||
|
||
export function generateTable(tablePrefix: string): string { | ||
return getAthenaTableCreationStatement( | ||
tablePrefix, | ||
TABLE_NAME, | ||
TABLE_COLUMNS, | ||
); | ||
} |
37 changes: 37 additions & 0 deletions
37
indexer/services/roundtable/src/lib/athena-ddl-tables/trading_rewards.ts
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,37 @@ | ||
import { | ||
getAthenaTableCreationStatement, | ||
getExternalAthenaTableCreationStatement, | ||
} from '../../helpers/sql'; | ||
|
||
const TABLE_NAME: string = 'trading_rewards'; | ||
const RAW_TABLE_COLUMNS: string = ` | ||
\`id\` binary, | ||
\`address\` string, | ||
\`blockTime\` string, | ||
\`blockHeight\` bigint, | ||
\`amount\` string | ||
`; | ||
const TABLE_COLUMNS: string = ` | ||
"id", | ||
"address", | ||
"blockTime", | ||
"blockHeight", | ||
"amount" | ||
`; | ||
|
||
export function generateRawTable(tablePrefix: string, rdsExportIdentifier: string): string { | ||
return getExternalAthenaTableCreationStatement( | ||
tablePrefix, | ||
rdsExportIdentifier, | ||
TABLE_NAME, | ||
RAW_TABLE_COLUMNS, | ||
); | ||
} | ||
|
||
export function generateTable(tablePrefix: string): string { | ||
return getAthenaTableCreationStatement( | ||
tablePrefix, | ||
TABLE_NAME, | ||
TABLE_COLUMNS, | ||
); | ||
} |
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