Skip to content

Commit

Permalink
Fix data mismatch issue in Vertica Connector (#2433)
Browse files Browse the repository at this point in the history
  • Loading branch information
aimethed authored Dec 26, 2024
2 parents 1c686a9 + f525c4b commit b5da5fb
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,17 @@ public GetSplitsResponse doGetSplits(BlockAllocator allocator, GetSplitsRequest
FieldReader fieldReaderAwsRegion = request.getPartitions().getFieldReader("awsRegionSql");
String awsRegionSql = fieldReaderAwsRegion.readText().toString();

List<S3Object> s3ObjectsList = getlistExportedObjects(exportBucket, queryId);
if (s3ObjectsList.isEmpty()) {
// Execute queries on Vertica if S3 export bucket does not contain objects for given queryId
executeQueriesOnVertica(connection, sqlStatement, awsRegionSql);
// Retrieve the S3 objects list for given queryId
s3ObjectsList = getlistExportedObjects(exportBucket, queryId);
}

//execute the queries on Vertica
executeQueriesOnVertica(connection, sqlStatement, awsRegionSql);

/*
* For each generated S3 object, create a split and add data to the split.
*/
Split split;
List<S3Object> s3ObjectsList = getlistExportedObjects(exportBucket, queryId);

// Create a split for each s3 object
if(!s3ObjectsList.isEmpty())
{
for (S3Object s3Object : s3ObjectsList)
Expand Down

0 comments on commit b5da5fb

Please sign in to comment.