Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist rejected data table #294

Closed
wants to merge 4 commits into from
Closed

Conversation

jeremyprime
Copy link
Collaborator

Summary

Persist rejected data table

Description

Previously any rejected rows (rejected data table) was created as a temporary table locally and never committed to the Vertica database. This change means that every time there is at least one rejected row during a write operation it will persist that information in a rejected data table (see the README for the table name).

Note that a new ticket was created (#293) to add configuration options for this functionality later.

Related Issue

#275

Additional Reviewers

@alexr-bq
@alexey-temnikov
@jonathanl-bq
@ravjotbrar

@jeremyprime jeremyprime linked an issue Dec 8, 2021 that may be closed by this pull request
@@ -194,10 +194,10 @@ class VerticaDistributedFilesystemWritePipe(val config: DistributedFilesystemWri

def buildCopyStatement(targetTable: String, columnList: String, url: String, rejectsTableName: String, fileFormat: String): String = {
if (config.mergeKey.isDefined) {
s"COPY $targetTable FROM '$url' ON ANY NODE $fileFormat REJECTED DATA AS TABLE $rejectsTableName NO COMMIT"
s"COPY $targetTable FROM '$url' ON ANY NODE $fileFormat REJECTED DATA AS TABLE $rejectsTableName"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremyp-bq , @jonathanl-bq , do you know what was the original intent of having "NO COMMIT"? Do we have cases when we aggregate several COPY statements in a single transaction?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I think this is the only place we are executing a statement but we probably do want to keep a single commit at the end of the transaction. Although the rejects table is never committed when that is the case. However, I can look to create the rejects table in a separate statement.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually don't remember what the original intent was. I probably glanced over this too quickly.

@jonathanl-bq jonathanl-bq self-requested a review December 10, 2021 00:13
@jeremyprime
Copy link
Collaborator Author

Need to reevaluate how to best persist the rejected table data without impacting other functionality, so closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Look into how rejected rows are handled in v2 connector
4 participants