Skip to content

Commit

Permalink
minor fix to the logic to handle IN clause with filename and column name
Browse files Browse the repository at this point in the history
minor fix to the logic to handle IN clause with filename and column name
  • Loading branch information
ashitsalesforce committed Jan 18, 2025
1 parent f45ed4b commit c620a63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ public AbstractQueryVisitor(AbstractExtractAction action, Controller controller,
this.action = action;
}

private boolean isGetSoqlMethodCalledOnce = false;
@Override
public final void visit() throws DataAccessObjectException, OperationException {
isGetSoqlMethodCalledOnce = false;
try {
if (getProgressMonitor().isCanceled()) return;
String soql = getSoqlForNextBatch();
isGetSoqlMethodCalledOnce = true;
while (soql != null) {
final int size = executeQuery(soql);
if (size == 0) {
Expand Down Expand Up @@ -132,7 +135,6 @@ protected boolean writeStatus() {
private CSVFileReader csvReader = null;
private String inClauseColName = null;
private int numRows = 0;
private boolean isGetSoqlForNextBatchCalled = false;
private int maxSoqlCharLength = DEFAULT_MAX_SOQL_CHAR_LENGTH;
private String getSoqlForNextBatch() throws OperationException {
List<String> inClauseFileAndColumnNameList = parseInClauseForFileAndColumnName(soql);
Expand Down Expand Up @@ -182,10 +184,11 @@ private String getSoqlForNextBatch() throws OperationException {
csvReader = null;
}
return batchSoql;
} else if (!isGetSoqlForNextBatchCalled) {
isGetSoqlForNextBatchCalled = true;
} else if (!isGetSoqlMethodCalledOnce) {
// return the full soql for the first time
return soql;
} else {
// return null to indicate that there are no more batches
return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@ public ProcessExtractTestBase(Map<String, String> config) {
super(config);
}

@Parameterized.Parameters(name = "{0}")
public static Collection<Object[]> getParameters() {
return Arrays.asList(
// partner API
TestVariant.forSettings(TestSetting.BULK_API_DISABLED, TestSetting.BULK_V2_API_DISABLED)
// Bulk API
, TestVariant.forSettings(TestSetting.BULK_API_ENABLED, TestSetting.BULK_V2_API_DISABLED)
// Bulk V2 Query API
, TestVariant.forSettings(TestSetting.BULK_V2_API_ENABLED)
);
}

protected class ExtractContactGenerator extends ContactGenerator {
private final String uniqueLastName;

Expand Down

0 comments on commit c620a63

Please sign in to comment.