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

Revert "NO-SNOW Enable single buffering in Snowpipe Streaming by default (#924)" #981

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public class SnowflakeSinkConnectorConfig {
public static final String SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER =
"snowflake.streaming.enable.single.buffer";

public static final boolean SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER_DEFAULT = true;
public static final boolean SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER_DEFAULT = false;

Choose a reason for hiding this comment

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

So we decided not to introduce / change default values of the SDK flush timeout / flush size?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not in 2.5.0. We'll try to figure this out for the next release.

public static final String SNOWPIPE_STREAMING_MAX_CLIENT_LAG =
"snowflake.streaming.max.client.lag";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ public void testNonProxyHosts() {
@Test
public void testIllegalTopicMap() {
Map<String, String> config = getConfig();
config.put(SnowflakeSinkConnectorConfig.TOPICS_TABLES_MAP, "$@#$#@%^$12312");
config.put(TOPICS_TABLES_MAP, "$@#$#@%^$12312");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(SnowflakeSinkConnectorConfig.TOPICS_TABLES_MAP);
.hasMessageContaining(TOPICS_TABLES_MAP);
}

@Test
public void testIllegalTableName() {
Map<String, String> config = getConfig();
config.put(SnowflakeSinkConnectorConfig.TOPICS_TABLES_MAP, "topic1:!@#@!#!@");
config.put(TOPICS_TABLES_MAP, "topic1:!@#@!#!@");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.matches(
Expand All @@ -196,7 +196,7 @@ public void testIllegalTableName() {
@Test
public void testDuplicatedTopic() {
Map<String, String> config = getConfig();
config.put(SnowflakeSinkConnectorConfig.TOPICS_TABLES_MAP, "topic1:table1,topic1:table2");
config.put(TOPICS_TABLES_MAP, "topic1:table1,topic1:table2");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.matches(
Expand All @@ -209,15 +209,15 @@ public void testDuplicatedTopic() {
@Test
public void testDuplicatedTableName() {
Map<String, String> config = getConfig();
config.put(SnowflakeSinkConnectorConfig.TOPICS_TABLES_MAP, "topic1:table1,topic2:table1");
config.put(TOPICS_TABLES_MAP, "topic1:table1,topic2:table1");
connectorConfigValidator.validateConfig(config);
}

@Test
public void testNameMapCovered() {
Map<String, String> config = getConfig();
config.put(SnowflakeSinkConnectorConfig.TOPICS, "!@#,$%^,test");
config.put(SnowflakeSinkConnectorConfig.TOPICS_TABLES_MAP, "!@#:table1,$%^:table2");
config.put(TOPICS_TABLES_MAP, "!@#:table1,$%^:table2");
connectorConfigValidator.validateConfig(config);
}

Expand Down Expand Up @@ -495,7 +495,6 @@ public void testStreamingEmptyFlushTime() {
IngestionMethodConfig.SNOWPIPE_STREAMING.toString());
config.put(Utils.SF_ROLE, "ACCOUNTADMIN");
config.remove(SnowflakeSinkConnectorConfig.BUFFER_FLUSH_TIME_SEC);
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
Copy link
Contributor

Choose a reason for hiding this comment

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

we could keep that, it will be later easier to set the default back to true

assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(SnowflakeSinkConnectorConfig.BUFFER_FLUSH_TIME_SEC);
Expand All @@ -511,7 +510,6 @@ public void testStreamingFlushTimeSmall() {
config.put(
SnowflakeSinkConnectorConfig.BUFFER_FLUSH_TIME_SEC,
(StreamingUtils.STREAMING_BUFFER_FLUSH_TIME_MINIMUM_SEC - 1) + "");
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(SnowflakeSinkConnectorConfig.BUFFER_FLUSH_TIME_SEC);
Expand All @@ -525,7 +523,6 @@ public void testStreamingFlushTimeNotNumber() {
IngestionMethodConfig.SNOWPIPE_STREAMING.toString());
config.put(Utils.SF_ROLE, "ACCOUNTADMIN");
config.put(SnowflakeSinkConnectorConfig.BUFFER_FLUSH_TIME_SEC, "fdas");
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(SnowflakeSinkConnectorConfig.BUFFER_FLUSH_TIME_SEC);
Expand All @@ -538,7 +535,6 @@ public void testStreamingEmptyBufferSize() {
SnowflakeSinkConnectorConfig.INGESTION_METHOD_OPT,
IngestionMethodConfig.SNOWPIPE_STREAMING.toString());
config.put(Utils.SF_ROLE, "ACCOUNTADMIN");
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
config.remove(BUFFER_SIZE_BYTES);
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
Expand All @@ -553,7 +549,6 @@ public void testStreamingEmptyBufferCount() {
IngestionMethodConfig.SNOWPIPE_STREAMING.toString());
config.put(Utils.SF_ROLE, "ACCOUNTADMIN");
config.remove(BUFFER_COUNT_RECORDS);
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(BUFFER_COUNT_RECORDS);
Expand All @@ -567,7 +562,6 @@ public void testStreamingBufferCountNegative() {
IngestionMethodConfig.SNOWPIPE_STREAMING.toString());
config.put(Utils.SF_ROLE, "ACCOUNTADMIN");
config.put(BUFFER_COUNT_RECORDS, "-1");
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(BUFFER_COUNT_RECORDS);
Expand All @@ -581,7 +575,6 @@ public void testStreamingBufferCountValue() {
IngestionMethodConfig.SNOWPIPE_STREAMING.toString());
config.put(Utils.SF_ROLE, "ACCOUNTADMIN");
config.put(BUFFER_COUNT_RECORDS, "adssadsa");
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(BUFFER_COUNT_RECORDS);
Expand Down Expand Up @@ -973,7 +966,6 @@ public void testEmptyClientId() {
config.put(SnowflakeSinkConnectorConfig.AUTHENTICATOR_TYPE, Utils.OAUTH);
config.put(SnowflakeSinkConnectorConfig.OAUTH_CLIENT_SECRET, "client_secret");
config.put(SnowflakeSinkConnectorConfig.OAUTH_REFRESH_TOKEN, "refresh_token");
config.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");
assertThatThrownBy(() -> connectorConfigValidator.validateConfig(config))
.isInstanceOf(SnowflakeKafkaConnectorException.class)
.hasMessageContaining(SnowflakeSinkConnectorConfig.OAUTH_CLIENT_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void shouldNotPropagateStreamingClientProperties_SingleBufferDisabled() {

connectorConfig.put(BUFFER_SIZE_BYTES, "10000000");
connectorConfig.put(SNOWPIPE_STREAMING_MAX_MEMORY_LIMIT_IN_BYTES, "20000000");
connectorConfig.put(SNOWPIPE_STREAMING_ENABLE_SINGLE_BUFFER, "false");

// WHEN
StreamingClientProperties resultProperties = new StreamingClientProperties(connectorConfig);
Expand Down
Loading