Divide CITI into Sandy and Steve.
Change "process" to "ingesting" in logs. Add eclipse script.
This commit is contained in:
parent
7ee01eacd6
commit
2003759074
3 changed files with 24 additions and 15 deletions
6
eclipse
Executable file
6
eclipse
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/sh
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
LOG=./logs
|
||||||
|
mkdir -p $LOG
|
||||||
|
/home/eclipse/sts-4.30.0.RELEASE/SpringToolSuite4 -data .. \
|
||||||
|
>$LOG/eclipse-sts.log 2>$LOG/eclipse-sts.err.log &
|
||||||
|
|
@ -541,7 +541,8 @@ public class Schema {
|
||||||
ingestAmazonRetailOrders(connection, year, "Steve");
|
ingestAmazonRetailOrders(connection, year, "Steve");
|
||||||
ingestChase(connection, year);
|
ingestChase(connection, year);
|
||||||
ingestDiscover(connection, year);
|
ingestDiscover(connection, year);
|
||||||
ingestCiti(connection, year);
|
ingestCiti(connection, year, "Sandy");
|
||||||
|
ingestCiti(connection, year, "Steve");
|
||||||
ingestFirstBank(connection, year);
|
ingestFirstBank(connection, year);
|
||||||
ingestElevations(connection, year);
|
ingestElevations(connection, year);
|
||||||
ingestPaypal(connection, year);
|
ingestPaypal(connection, year);
|
||||||
|
|
@ -551,7 +552,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestAmazonDigitalOrders(final Connection connection, final String year,
|
private void ingestAmazonDigitalOrders(final Connection connection, final String year,
|
||||||
final String person) throws IOException, SQLException {
|
final String person) throws IOException, SQLException {
|
||||||
System.out.println("process amazon digital orders budget_" + year + " " + person);
|
System.out.println("ingesting amazon digital orders budget_" + year + " " + person);
|
||||||
String triliumName = "Amazon.${person}.Digital-Ordering.Digital Items" //
|
String triliumName = "Amazon.${person}.Digital-Ordering.Digital Items" //
|
||||||
.replace("${person}", person);
|
.replace("${person}", person);
|
||||||
final String tableName = getTableName(triliumName);
|
final String tableName = getTableName(triliumName);
|
||||||
|
|
@ -633,7 +634,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestAmazonRetailOrders(final Connection connection, final String year,
|
private void ingestAmazonRetailOrders(final Connection connection, final String year,
|
||||||
final String person) throws IOException, SQLException {
|
final String person) throws IOException, SQLException {
|
||||||
System.out.println("process amazon retail orders " + year + " " + person);
|
System.out.println("ingesting amazon retail orders " + year + " " + person);
|
||||||
final String triliumName = "Amazon.${person}.Retail.OrderHistory" //
|
final String triliumName = "Amazon.${person}.Retail.OrderHistory" //
|
||||||
.replace("${person}", person);
|
.replace("${person}", person);
|
||||||
final String tableName = getTableName(triliumName);
|
final String tableName = getTableName(triliumName);
|
||||||
|
|
@ -684,7 +685,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestDiscover(final Connection connection, final String year)
|
private void ingestDiscover(final Connection connection, final String year)
|
||||||
throws IOException, SQLException {
|
throws IOException, SQLException {
|
||||||
System.out.println("process discover " + year);
|
System.out.println("ingesting discover " + year);
|
||||||
final String tableName = "discover";
|
final String tableName = "discover";
|
||||||
if (!tableExists(connection, year, tableName)) {
|
if (!tableExists(connection, year, tableName)) {
|
||||||
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
||||||
|
|
@ -724,10 +725,10 @@ public class Schema {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ingestCiti(final Connection connection, final String year)
|
private void ingestCiti(final Connection connection, final String year, final String person)
|
||||||
throws IOException, SQLException {
|
throws IOException, SQLException {
|
||||||
System.out.println("process citi " + year);
|
System.out.println("ingesting citi " + year + " " + person);
|
||||||
final String tableName = "citi";
|
final String tableName = "citi_" + person.toLowerCase();
|
||||||
if (!tableExists(connection, year, tableName)) {
|
if (!tableExists(connection, year, tableName)) {
|
||||||
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
||||||
"${databaseName}", "budget_" + year) //
|
"${databaseName}", "budget_" + year) //
|
||||||
|
|
@ -735,10 +736,11 @@ public class Schema {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final String sql = Util.getResourceAsString("getCiti.sql") //
|
final String sql = Util.getResourceAsString("getCiti.sql") //
|
||||||
.replace("${databaseName}", "budget_" + year);
|
.replace("${databaseName}", "budget_" + year) //
|
||||||
|
.replace("${person}", person.toLowerCase());
|
||||||
final String insertSql = Util.getResourceAsString("insertTransaction.sql") //
|
final String insertSql = Util.getResourceAsString("insertTransaction.sql") //
|
||||||
.replace("${databaseName}", "budget_" + year);
|
.replace("${databaseName}", "budget_" + year);
|
||||||
final String source = "citi";
|
final String source = "citi_" + person.toLowerCase();
|
||||||
try (PreparedStatement stmt = connection.prepareStatement(sql)) {
|
try (PreparedStatement stmt = connection.prepareStatement(sql)) {
|
||||||
try (ResultSet resultSet = stmt.executeQuery()) {
|
try (ResultSet resultSet = stmt.executeQuery()) {
|
||||||
while (resultSet.next()) {
|
while (resultSet.next()) {
|
||||||
|
|
@ -768,7 +770,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestFirstBank(final Connection connection, final String year)
|
private void ingestFirstBank(final Connection connection, final String year)
|
||||||
throws IOException, SQLException {
|
throws IOException, SQLException {
|
||||||
System.out.println("process firstbank " + year);
|
System.out.println("ingesting firstbank " + year);
|
||||||
final String tableName = "first_bank";
|
final String tableName = "first_bank";
|
||||||
if (!tableExists(connection, year, tableName)) {
|
if (!tableExists(connection, year, tableName)) {
|
||||||
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
||||||
|
|
@ -809,7 +811,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestElevations(final Connection connection, final String year)
|
private void ingestElevations(final Connection connection, final String year)
|
||||||
throws IOException, SQLException {
|
throws IOException, SQLException {
|
||||||
System.out.println("process elevations " + year);
|
System.out.println("ingesting elevations " + year);
|
||||||
final String tableName = "elevations";
|
final String tableName = "elevations";
|
||||||
if (!tableExists(connection, year, tableName)) {
|
if (!tableExists(connection, year, tableName)) {
|
||||||
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
||||||
|
|
@ -868,7 +870,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestChase(final Connection connection, final String year)
|
private void ingestChase(final Connection connection, final String year)
|
||||||
throws IOException, SQLException {
|
throws IOException, SQLException {
|
||||||
System.out.println("process chase " + year);
|
System.out.println("ingesting chase " + year);
|
||||||
final String tableName = "chase";
|
final String tableName = "chase";
|
||||||
if (!tableExists(connection, year, tableName)) {
|
if (!tableExists(connection, year, tableName)) {
|
||||||
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
||||||
|
|
@ -910,7 +912,7 @@ public class Schema {
|
||||||
|
|
||||||
private void ingestPaypal(final Connection connection, final String year)
|
private void ingestPaypal(final Connection connection, final String year)
|
||||||
throws IOException, SQLException {
|
throws IOException, SQLException {
|
||||||
System.out.println("process paypal " + year);
|
System.out.println("ingesting paypal " + year);
|
||||||
final String tableName = "paypal";
|
final String tableName = "paypal";
|
||||||
if (!tableExists(connection, year, tableName)) {
|
if (!tableExists(connection, year, tableName)) {
|
||||||
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
System.out.println(" table ${databaseName}.${tableName} does not exist".replace(
|
||||||
|
|
@ -1454,7 +1456,8 @@ public class Schema {
|
||||||
TABLE_NAMES.put("Paypal", "paypal");
|
TABLE_NAMES.put("Paypal", "paypal");
|
||||||
TABLE_NAMES.put("Firstbank", "first_bank");
|
TABLE_NAMES.put("Firstbank", "first_bank");
|
||||||
TABLE_NAMES.put("Firstbank.2025-checking", "first_bank");
|
TABLE_NAMES.put("Firstbank.2025-checking", "first_bank");
|
||||||
TABLE_NAMES.put("Citi", "citi");
|
TABLE_NAMES.put("Citi.Steve", "citi_steve");
|
||||||
|
TABLE_NAMES.put("Citi.Sandy", "citi_sandy");
|
||||||
TABLE_NAMES.put("Discover", "discover");
|
TABLE_NAMES.put("Discover", "discover");
|
||||||
TABLE_NAMES.put("Elevations", "elevations");
|
TABLE_NAMES.put("Elevations", "elevations");
|
||||||
TABLE_NAMES.put("Elevations.2025-checking", "elevations");
|
TABLE_NAMES.put("Elevations.2025-checking", "elevations");
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,4 @@ date,
|
||||||
description,
|
description,
|
||||||
debit,
|
debit,
|
||||||
credit
|
credit
|
||||||
from ${databaseName}.citi
|
from ${databaseName}.citi_${person}
|
||||||
Loading…
Reference in a new issue