-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
java csv destination #505
java csv destination #505
Conversation
843b954
to
33b88a6
Compare
6e9d104
to
1300a65
Compare
@@ -36,8 +34,4 @@ | |||
public static String ARGS_CATALOG_DESC = "input path for the catalog"; | |||
public static String ARGS_PATH_DESC = "path to the json-encoded state file"; | |||
|
|||
// todo (cgardens) - this mount path should be passed in by the worker and read as an arg or | |||
// environment variable by the runner. | |||
public static Path LOCAL_MOUNT = Path.of("/local"); |
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.
removed the need for an integration to know about this.
|
||
// todo (cgardens) - we currently don't leverage discover in our destinations, so skipping | ||
// implementing it... for now. | ||
@Override |
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.
are we okay with this choice? i don't want to write instantly dead code unless we think it will not be dead very soon.
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.
We should probably only support it for sources in bash.sh then. It doesn't seem necessary as a separate operation. Presumably being aware of the contents of the destination is something the sync/write operation needs to know internally without the need to expose it outside of the integration.
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 think as we become cooler, it will be something we'll want. if we allow complex mapping of fields in source to fields in destination we will need, but for now. i think it's not helpful.
"description": "Path to the directory where csv files will be written. Must start with the local mount \"/local\". Any other directory appended on the end will be placed inside that local mount.", | ||
"type": "string", | ||
"examples": ["/local"], | ||
"pattern": "(^\\/local\\/.*)|(^\\/local$)" |
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.
enforce that destination path uses the local mount.
@@ -0,0 +1,34 @@ | |||
# Local CSV |
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.
will replace local-csv.md with this one once we switch to this integration. it would be nice, if we could put this doc in the airbyte-integrations/csv-destination
.
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public abstract class FailureTrackingConsumer<T> implements DestinationConsumer<T> { |
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.
not in love with the name of this class. would love suggestions.
@@ -4,4 +4,4 @@ set -e | |||
|
|||
# wrap run script in a script so that we can lazy evaluate the value of APPLICATION. APPLICATION is | |||
# set by the dockerfile that inherits base-java, so it cannot be evaluated when base-java is built. | |||
bin/"$APPLICATION" "$@" | |||
cat <&0 | bin/"$APPLICATION" "$@" |
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.
Shouldn't the integration runner be responsible for this?
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.
discussed offline. agreed this was right. also agreed to add a comment explaining what's happening. which i did.
@@ -51,6 +51,9 @@ function main() { | |||
# todo: state should be optional: --state "$STATE_FILE" | |||
eval "$AIRBYTE_READ_CMD" --config "$CONFIG_FILE" --catalog "$CATALOG_FILE" | |||
;; | |||
write) |
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.
we should pass in an env var for source/dest so only one of read and write are valid at this level and show an error if the wrong one is called.
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.
agreed. let's do this in a separate PR.
airbyte-integrations/csv-destination/src/main/resources/spec.json
Outdated
Show resolved
Hide resolved
...ns/csv-destination/src/main/java/io/airbyte/integrations/destination/csv/CsvDestination.java
Outdated
Show resolved
Hide resolved
|
||
// todo (cgardens) - we currently don't leverage discover in our destinations, so skipping | ||
// implementing it... for now. | ||
@Override |
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.
We should probably only support it for sources in bash.sh then. It doesn't seem necessary as a separate operation. Presumably being aware of the contents of the destination is something the sync/write operation needs to know internally without the need to expose it outside of the integration.
|
||
} | ||
|
||
public static void main(String[] args) throws Exception { |
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.
Maybe add a comment here so people know this is for local development and testing, not the actual entrypoint to the integration?
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 changed. this is the actual entrypoint of the destination now. this moved because the version where IntegrationRunner was the entrypoint got into reflection and jar hell.
This reverts commit 020e1f8.
What
FailureTrackingConsumer
that makes it easy to write a destination consumer that passes in whether or not any failures occurred into close.e.g.
Checklist
Pass in the local mount path from the dockerfile / .env (instead of assuming it is "/local")handle this in the configuration.Recommended reading order
FailureTrackingConsumer.java
CsvDestination.java
spec.json
component.ts