-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SNOW-906224: Add new ON_ERROR=SKIP_BATCH option (#597)
Introduce a new ON_ERROR option SKIP_BATCH - Skips the entire batch - Returns all the erroneous rows as part of the response, along with their indexes and error messages Pros: - Easy implementation Cons: - Worse performance: data validation will be done twice for the good rows
- Loading branch information
1 parent
8fb07f3
commit 5baaf19
Showing
7 changed files
with
342 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/java/net/snowflake/ingest/streaming/internal/IngestionStrategy.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright (c) 2023 Snowflake Computing Inc. All rights reserved. | ||
*/ | ||
|
||
package net.snowflake.ingest.streaming.internal; | ||
|
||
import java.util.Map; | ||
import net.snowflake.ingest.streaming.InsertValidationResponse; | ||
|
||
/** Interface to a batch of rows into the row buffer based on different on error options */ | ||
public interface IngestionStrategy<T> { | ||
/** | ||
* Insert a batch of rows into the row buffer | ||
* | ||
* @param rows input row | ||
* @param offsetToken offset token of the latest row in the batch | ||
* @return insert response that possibly contains errors because of insertion failures | ||
*/ | ||
InsertValidationResponse insertRows( | ||
AbstractRowBuffer<T> rowBuffer, Iterable<Map<String, Object>> rows, String offsetToken); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.