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

SNOW-1692749: no schema evolution it + refactor #960

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

sfc-gh-wtrefon
Copy link
Contributor

Overview

SNOW-1692749

Pre-review checklist

  • This change should be part of a Behavior Change Release. See go/behavior-change.
  • This change has passed Merge gate tests
  • Snowpipe Changes
  • Snowpipe Streaming Changes
  • This change is TEST-ONLY
  • This change is README/Javadocs only
  • This change is protected by a config parameter <PARAMETER_NAME> eg snowflake.ingestion.method.
    • Yes - Added end to end and Unit Tests.
    • No - Suggest why it is not param protected
  • Is his change protected by parameter <PARAMETER_NAME> on the server side?
    • The parameter/feature is not yet active in production (partial rollout or PrPr, see Changes for Unreleased Features and Fixes).
    • If there is an issue, it can be safely mitigated by turning the parameter off. This is also verified by a test (See go/ppp).

Comment on lines +47 to +55
void shouldInsertRecords(String description, String message, boolean withSchema)
throws Exception {
service.insert(
Arrays.asList(
createKafkaRecord(message, 0, withSchema), createKafkaRecord(message, 1, withSchema)));
waitForOffset(2);
service.insert(Collections.singletonList(createKafkaRecord(message, 2, withSchema)));
waitForOffset(3);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i do not compare the values still, will do in next PR (smaller PRs). There is some small bug i think in ingestSDK and the int64 is not properly saved.

@sfc-gh-wtrefon sfc-gh-wtrefon changed the title SNOW-1692749: no schema evolution it SNOW-1692749: no schema evolution it + refactor Oct 16, 2024
@sfc-gh-wtrefon sfc-gh-wtrefon marked this pull request as ready for review October 16, 2024 15:17
@sfc-gh-wtrefon sfc-gh-wtrefon requested a review from a team as a code owner October 16, 2024 15:17
+ RECORD_CONTENT_OBJECT_SCHEMA);
}

private static final String RECORD_CONTENT_OBJECT_SCHEMA =
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we move it to the top?

waitForOffset(3);
}

private static Stream<Arguments> prepareData() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we don't have strict guidelines on that, but what do you think about keeping the @MethoudSource parameters just above the test method so we have a clear view of the data and the test scenario?

service.insert(
Arrays.asList(
createKafkaRecord(message, 0, withSchema), createKafkaRecord(message, 1, withSchema)));
waitForOffset(2);
Copy link
Contributor

@sfc-gh-akowalczyk sfc-gh-akowalczyk Oct 17, 2024

Choose a reason for hiding this comment

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

just a question, as we inserted messages with offsets 0 and 1, why do we wait for the offset 2?

According to the java doc com.snowflake.kafka.connector.internal.SnowflakeSinkService#getOffset:

retrieve offset of last loaded record for given pipe name

so I would expect to see 1 here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because the consumer offsets points to the offset it should start reading. This is always +1 bigger that the offset consumed.

Copy link
Contributor

@sfc-gh-akowalczyk sfc-gh-akowalczyk left a comment

Choose a reason for hiding this comment

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

Just a few ordering suggestions

@sfc-gh-wtrefon sfc-gh-wtrefon enabled auto-merge (squash) October 17, 2024 08:51
@sfc-gh-wtrefon sfc-gh-wtrefon merged commit b6ffff3 into master Oct 17, 2024
76 of 80 checks passed
@sfc-gh-wtrefon sfc-gh-wtrefon deleted the wtrefon/SNOW-1692749-no-schema-evolution-IT branch October 17, 2024 10:28
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.

3 participants