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

[BugFix] Fix SDK write failure for non-default tables #298

Merged
merged 3 commits into from
Oct 26, 2023

Conversation

zaorangyang
Copy link
Contributor

@zaorangyang zaorangyang commented Oct 26, 2023

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Which issues of this PR fixes :

Fixes #

Problem Summary(Required) :

For the Stream Load SDK, if the table to be written to is a non-default table, the DefaultStreamLoader.send method still requests SR to write data to the default table, causing the stream load job to fail. This PR fixes this issue.
image

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr will affect users' behaviors
  • This pr needs user documentation (for new or modified features or behaviors)
  • I have added documentation for my new feature or new function

Signed-off-by: Zaorang Yang <zaorangy@gmail.com>
@@ -174,6 +174,17 @@ public StreamLoadTableProperties getTableProperties(String uniqueKey) {
return tablePropertiesMap.getOrDefault(uniqueKey, defaultTableProperties);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can remove getTableProperties(String database, String table) and getTableProperties(String uniqueKey) to avoid misusing

Comment on lines 127 to 128
columns(streamLoadTableProperties.getColumns());
enableUpsertDelete(streamLoadTableProperties.isEnableUpsertDelete());
Copy link
Collaborator

Choose a reason for hiding this comment

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

columns and upsertDelete may be different for different tables, so it's better not to copy them?

@@ -114,6 +118,20 @@ private Builder() {

}

// This function does not copy the uniqueKey and properties attributes because the uniqueKey
// is generated in the StreamLoadTableProperties constructor, and the properties are automatically
// populated during the build process.
Copy link
Collaborator

Choose a reason for hiding this comment

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

only db, table, and columns are populated in the build process. What about other properties such as timeout

Signed-off-by: Zaorang Yang <zaorangy@gmail.com>
Signed-off-by: Zaorang Yang <zaorangy@gmail.com>
@banmoy banmoy merged commit aaa02bd into StarRocks:main Oct 26, 2023
4 checks passed
banmoy pushed a commit that referenced this pull request Dec 4, 2023
Signed-off-by: Zaorang Yang <zaorangy@gmail.com>
banmoy pushed a commit that referenced this pull request Dec 4, 2023
Signed-off-by: Zaorang Yang <zaorangy@gmail.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.

2 participants