Skip to content

Commit

Permalink
bq validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishakaushik-cloud committed Jun 9, 2023
1 parent b037661 commit ccccfd1
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import io.cdap.e2e.utils.PluginPropertyUtils;
import org.junit.Assert;

import java.sql.*;
import java.util.Date;
import java.util.GregorianCalendar;
Expand Down Expand Up @@ -108,8 +107,6 @@ public static void createSourceTable(String sourceTable) throws SQLException, Cl
statement.executeUpdate("INSERT INTO " + sourceTable + " (id, lastName)" + "VALUES (1, 'Priya')");
statement.executeUpdate("INSERT INTO " + sourceTable + " (id, lastName)" + "VALUES (2, 'Shubhangi')");
statement.executeUpdate("INSERT INTO " + sourceTable + " (id, lastName)" + "VALUES (3, 'Shorya')");


}
}

Expand All @@ -128,8 +125,6 @@ public static void createSourceDatatypesTable(String sourceTable) throws SQLExce
String datatypesColumns = PluginPropertyUtils.pluginProp("datatypesColumns");
String createSourceTableQuery = "CREATE TABLE " + sourceTable + " " + datatypesColumns;
statement.executeUpdate(createSourceTableQuery);
System.out.println(createSourceTableQuery);

// Insert dummy data.
String datatypesValues = PluginPropertyUtils.pluginProp("datatypesValue1");
String datatypesColumnsList = PluginPropertyUtils.pluginProp("datatypesColumnsList");
Expand All @@ -142,7 +137,6 @@ public static void createTargetDatatypesTable(String targetTable) throws SQLExce
String datatypesColumns = PluginPropertyUtils.pluginProp("datatypesColumns");
String createTargetTableQuery = "CREATE TABLE " + targetTable + " " + datatypesColumns;
statement.executeUpdate(createTargetTableQuery);
System.out.println(createTargetTableQuery);
}
}

Expand All @@ -151,11 +145,9 @@ public static void createTargetCloudMysqlTable(String targetTable) throws SQLExc
String datatypesColumns = PluginPropertyUtils.pluginProp("CloudMySqlDatatypesColumns");
String createTargetTableQuery = "CREATE TABLE " + targetTable + " " + datatypesColumns;
statement.executeUpdate(createTargetTableQuery);
System.out.println(createTargetTableQuery);
}
}


public static void dropTables(String[] tables) throws SQLException, ClassNotFoundException {
try (Connection connect = getCloudSqlConnection(); Statement statement = connect.createStatement()) {
for (String table : tables) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ public static void setTableName() {
PluginPropertyUtils.addPluginProp("sourceTable", sourceTableName);
PluginPropertyUtils.addPluginProp("targetTable", targetTableName);
PluginPropertyUtils.addPluginProp("selectQuery", String.format("select * from %s", sourceTableName));
System.out.println(sourceTableName);

}

@Before(order = 1)
Expand Down Expand Up @@ -147,7 +145,6 @@ private static void createSourceBQTableWithQueries(String bqCreateTableQueryFile
// Insert query does not return any record.
// Iterator on TableResult values in getSoleQueryResult method throws NoSuchElementException
}
System.out.println(bqSourceTable);
PluginPropertyUtils.addPluginProp("bqSourceTable", bqSourceTable);
BeforeActions.scenario.write("BQ Source Table " + bqSourceTable + " created successfully");
}
Expand Down

0 comments on commit ccccfd1

Please sign in to comment.