Skip to content

Implement overwrite mode #24

Draft
MaxKsyunz wants to merge 10 commits intointeg/save_mode_simplefrom
dev/save_mode_simple_override
Draft

Implement overwrite mode #24
MaxKsyunz wants to merge 10 commits intointeg/save_mode_simplefrom
dev/save_mode_simple_override

Conversation

@MaxKsyunz
Copy link
Copy Markdown

No description provided.

MaxKsyunz and others added 9 commits March 6, 2026 01:46
…itioned DML.

Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
spotless:apply was not fixing error that spotless:check was reporting.
Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
…nner/SpannerWriteBuilder.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
… "recreate"

Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
…nner/SpannerWriteBuilder.java


Temporary code. will be merged with catalog branch.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…g class.

Signed-off-by: Max Ksyunz <max.ksyunz@improving.com>
@MaxKsyunz
Copy link
Copy Markdown
Author

/gemini review

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements an overwrite mode for Spark writes to Spanner, offering 'truncate' and 'recreate' strategies. The implementation is well-structured, adding new capabilities and refactoring existing code for better organization. I have a couple of suggestions to enhance robustness and exception handling.

Comment on lines +92 to +95
} catch (InterruptedException | ExecutionException e) {
throw new SpannerConnectorException(
SpannerErrorCode.DDL_EXCEPTION, "Error recreating table " + tableName, e);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When an InterruptedException is caught, it's a best practice to restore the interrupted status of the thread by calling Thread.currentThread().interrupt(). This allows code higher up the call stack to be aware of the interruption and handle it appropriately.

Suggested change
} catch (InterruptedException | ExecutionException e) {
throw new SpannerConnectorException(
SpannerErrorCode.DDL_EXCEPTION, "Error recreating table " + tableName, e);
}
} catch (InterruptedException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new SpannerConnectorException(
SpannerErrorCode.DDL_EXCEPTION, "Error recreating table " + tableName, e);
}

…nner/SpannerWriteBuilder.java

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.

1 participant