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

Destination connector implementation. #1

Merged
merged 47 commits into from
Jan 15, 2025
Merged

Destination connector implementation. #1

merged 47 commits into from
Jan 15, 2025

Conversation

parikshitg
Copy link
Collaborator

@parikshitg parikshitg commented Dec 12, 2024

Description

Destination implementation for SFTP connector.

Quick checks:

  • There is no other pull request for the same update/change.
  • I have written unit tests.
  • I have made sure that the PR is of reasonable size and can be easily reviewed.

@parikshitg parikshitg self-assigned this Dec 12, 2024
@parikshitg parikshitg marked this pull request as ready for review December 18, 2024 06:16
@parikshitg parikshitg linked an issue Dec 18, 2024 that may be closed by this pull request
2 tasks

filename, ok := record.Metadata["filename"]
if !ok {
filename = string(record.Key.Bytes())
Copy link

Choose a reason for hiding this comment

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

What if the key contains some characters that would make an invalid file name? E.g. the key could be a structured ket.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This(filename missing from metadata) should never happen, record should have the filename metadata, but just to handle this we can use hash for filename?

Copy link

Choose a reason for hiding this comment

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

That's true, the filename should not be missing, if the record came from an SFTP source. But Conduit should be able to combine different sources, and so, for example, it should be possible to sync files from S3 to an SFTP destination.

The key could actually be the file name?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Okay, so do you mean if record.Key is of type opencdc.StructuredData which is basically a map, then there should be a key "filename" which could be used here?

Copy link

Choose a reason for hiding this comment

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

I meant that the key can be a string (i.e. opencdc.RawData), similar to what we have in the S3 source.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

handled.

Copy link

Choose a reason for hiding this comment

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

Thanks! A question though: shouldn't we change the source too, to return string keys?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Agree!, changed.

@parikshitg parikshitg changed the base branch from main to feat/source January 8, 2025 10:47
@hariso
Copy link

hariso commented Jan 10, 2025

LGTM, thanks @parikshitg!

Base automatically changed from feat/source to main January 13, 2025 16:02
Copy link

@hariso hariso left a comment

Choose a reason for hiding this comment

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

LGTM!

@parikshitg parikshitg merged commit f161082 into main Jan 15, 2025
3 checks passed
@parikshitg parikshitg deleted the feat/destination branch January 15, 2025 11:09
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.

Connector: SFTP [Source/Destination]
2 participants