Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subaccount usernames table to list of tables to export. (backport #2677) #2679

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading