-
Notifications
You must be signed in to change notification settings - Fork 0
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
Conversation
destination/destination.go
Outdated
|
||
filename, ok := record.Metadata["filename"] | ||
if !ok { | ||
filename = string(record.Key.Bytes()) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree!, changed.
…ctor-sftp into feat/destination
…ctor-sftp into feat/destination
LGTM, thanks @parikshitg! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Description
Destination implementation for SFTP connector.
Quick checks: