Skip to content

Commit 8f29e31

Browse files
committed
All the review comments have been addressed, and the required changes have been committed. The build has been successfully tested locally.
1 parent 645c24c commit 8f29e31

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

src/e2e-test/java/io/cdap/plugin/bigquery/stepsdesign/BigQueryBase.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,14 @@ public void getCountOfNoOfRecordsTransferredToTargetBigQueryTable() throws IOExc
9494
}
9595

9696
@Then("Validate records transferred to target table is equal to number of records from source table " +
97-
"with filter {string}")
97+
"with filter {string}")
9898
public void validateRecordsTransferredToTargetTableIsEqualToNumberOfRecordsFromSourceTableWithFilter(String filter)
99-
throws IOException, InterruptedException {
99+
throws IOException, InterruptedException {
100100
String projectId = (PluginPropertyUtils.pluginProp("projectId"));
101101
String datasetName = (PluginPropertyUtils.pluginProp("dataset"));
102102
int countRecordsTarget = BigQueryClient.countBqQuery(TestSetupHooks.bqTargetTable);
103103
String selectQuery = "SELECT count(*) FROM `" + projectId + "." + datasetName + "." +
104-
TestSetupHooks.bqTargetTable + "` WHERE " + PluginPropertyUtils.pluginProp(filter);
104+
TestSetupHooks.bqTargetTable + "` WHERE " + PluginPropertyUtils.pluginProp(filter);
105105
Optional<String> result = BigQueryClient.getSoleQueryResult(selectQuery);
106106
int count = result.map(Integer::parseInt).orElse(0);
107107
BeforeActions.scenario.write("Number of records transferred with respect to filter:" + count);
@@ -110,7 +110,7 @@ public void validateRecordsTransferredToTargetTableIsEqualToNumberOfRecordsFromS
110110

111111
@Then("Validate partition date in output partitioned table")
112112
public void validatePartitionDateInOutputPartitionedTable()
113-
throws IOException, InterruptedException {
113+
throws IOException, InterruptedException {
114114
Optional<String> result = BigQueryClient
115115
.getSoleQueryResult("SELECT distinct _PARTITIONDATE as pt FROM `" +
116116
(PluginPropertyUtils.pluginProp("projectId")) + "." +
@@ -233,10 +233,10 @@ public void verifyTheBigQueryValidationErrorMessageForInvalidProperty(String pro
233233
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_CHUNKSIZE);
234234
} else if (property.equalsIgnoreCase("bucket")) {
235235
expectedErrorMessage = PluginPropertyUtils
236-
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET);
236+
.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_TEMPORARY_BUCKET);
237237
} else if (property.equalsIgnoreCase("table")) {
238238
expectedErrorMessage = PluginPropertyUtils
239-
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_TABLE_NAME);
239+
.errorProp(E2ETestConstants.ERROR_MSG_INCORRECT_TABLE_NAME);
240240
} else {
241241
expectedErrorMessage = PluginPropertyUtils.errorProp(E2ETestConstants.ERROR_MSG_BQ_INCORRECT_PROPERTY).
242242
replaceAll("PROPERTY", property.substring(0, 1).toUpperCase() + property.substring(1));
@@ -260,5 +260,4 @@ public void validateRecordsTransferredToTargetTableIsEqualToNumberOfRecordsFromS
260260
BeforeActions.scenario.write("Number of records transferred from source table to target table:" + count);
261261
Assert.assertEquals(count, countRecordsTarget);
262262
}
263-
264263
}

src/e2e-test/java/io/cdap/plugin/utils/CdfPluginPropertyLocator.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ public enum CdfPluginPropertyLocator {
3939
GCS_MOVE_DESTINATION_PATH("destPath"),
4040
PARTITION_START_DATE("partitionFrom"),
4141
PARTITION_END_DATE("partitionTo"),
42-
FILTER("filter"),
43-
OUTPUT_SCHEMA("Output Schema-macro-input");
42+
FILTER("filter");
4443

4544
public String pluginProperty;
4645
CdfPluginPropertyLocator(String property) {
@@ -79,7 +78,6 @@ public enum CdfPluginPropertyLocator {
7978
.put("gcsMoveSourcePath", CdfPluginPropertyLocator.GCS_MOVE_SOURCE_PATH)
8079
.put("gcsMoveDestinationPath", CdfPluginPropertyLocator.GCS_MOVE_DESTINATION_PATH)
8180
.put("filter", CdfPluginPropertyLocator.FILTER)
82-
.put("Output Schema-macro-input", CdfPluginPropertyLocator.OUTPUT_SCHEMA)
8381
.put("partitionFrom", CdfPluginPropertyLocator.PARTITION_START_DATE)
8482
.put("partitionTo", CdfPluginPropertyLocator.PARTITION_END_DATE)
8583
.build();

src/e2e-test/resources/errorMessage.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ errorMessageMultipleFileWithoutClearDefaultSchema=Found a row with 4 fields when
3333
errorMessageInvalidSourcePath=Invalid bucket name in path 'abc@'. Bucket name should
3434
errorMessageInvalidDestPath=Invalid bucket name in path 'abc@'. Bucket name should
3535
errorMessageInvalidEncryptionKey=CryptoKeyName.parse: formattedString not in valid format: Parameter "abc@" must be
36-
errorMessageIncorrectPartitionStartDate=10-01-2025 is not in a valid format. Enter valid date in format: yyyy-MM-dd
37-
errorMessageIncorrectPartitionEndDate=11-01-2025 is not in a valid format. Enter valid date in format: yyyy-MM-dd
36+
errorMessageIncorrectPartitionStartDate=13-01-2025 is not in a valid format. Enter valid date in format: yyyy-MM-dd
37+
errorMessageIncorrectPartitionEndDate=14-01-2025 is not in a valid format. Enter valid date in format: yyyy-MM-dd
3838
errorMessageIncorrectReferenceName=Invalid reference name 'invalidRef&^*&&*'. Supported characters are: letters, numbers, and '_', '-', '.', or '$'.
3939
errorLogsMessageInvalidFilter=Spark Program 'phase-1' failed.

src/e2e-test/resources/pluginParameters.properties

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,17 +370,17 @@ bqTargetTable=dummy
370370
bqTargetTable2=dummy
371371
bqmtTargetTable=tabA
372372
bqmtTargetTable2=tabB
373-
bqStartDate=2025-01-10
374-
bqEndDate=2025-01-11
375-
partitionFrom=2025-01-10
376-
partitionTo=2025-01-11
373+
bqStartDate=2025-01-13
374+
bqEndDate=2025-01-14
375+
partitionFrom=2025-01-113
376+
partitionTo=2025-01-14
377377
filter=Id=20
378378
bqInvalidReferenceName=invalidRef&^*&&*
379379
OutputSchema={ "type": "record", "name": "text", "fields": [{ "name": "Id", "type": "long" }, { "name": "Value", "type": "long" }, \
380380
{ "name": "UID", "type": "string" } ] }
381381
incorrectFilter=%%%%
382-
bqIncorrectFormatStartDate=10-01-2025
383-
bqIncorrectFormatEndDate=11-01-2025
382+
bqIncorrectFormatStartDate=13-01-2025
383+
bqIncorrectFormatEndDate=14-01-2025
384384
## BQMT-PLUGIN-PROPERTIES-END
385385

386386
##CLOUDBIGTABLE-PLUGIN-PROPERTIES-START

0 commit comments

Comments
 (0)