Skip to content

Commit

Permalink
Add subaccount usernames table to list of tables to export. (#2677)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentwschau authored Jan 8, 2025
1 parent 4cdfae6 commit b2674f5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
getAthenaTableCreationStatement,
getExternalAthenaTableCreationStatement,
} from '../../helpers/sql';

const TABLE_NAME: string = 'subaccount_usernames';
const RAW_TABLE_COLUMNS: string = `
\`username\` string,
\`subaccountId\` string
`;
const TABLE_COLUMNS: string = `
"username",
"subaccountId"
`;

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,
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import * as athenaOrders from '../lib/athena-ddl-tables/orders';
import * as athenaPerpetualMarkets from '../lib/athena-ddl-tables/perpetual_markets';
import * as athenaPerpetualPositions from '../lib/athena-ddl-tables/perpetual_positions';
import * as athenaPnlTicks from '../lib/athena-ddl-tables/pnl_ticks';
import * as athenaSubaccountUsernames from '../lib/athena-ddl-tables/subaccount_usernames';
import * as athenaSubaccounts from '../lib/athena-ddl-tables/subaccounts';
import * as athenaTendermintEvents from '../lib/athena-ddl-tables/tendermint_events';
import * as athenaTradingRewardAggregations from '../lib/athena-ddl-tables/trading_reward_aggregations';
Expand Down Expand Up @@ -64,6 +65,7 @@ export const tablesToAddToAthena: { [table: string]: AthenaTableDDLQueries } = {
affiliate_info: athenaAffiliateInfo,
affiliate_referred_users: athenaAffiliateReferredUsers,
vaults: athenaVaults,
subaccount_usernames: athenaSubaccountUsernames,
};

const statStart: string = `${config.SERVICE_NAME}.update_research_environment`;
Expand Down

0 comments on commit b2674f5

Please sign in to comment.