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

Transformation order and result varies #60

Open
tuukka opened this issue Oct 6, 2015 · 0 comments
Open

Transformation order and result varies #60

tuukka opened this issue Oct 6, 2015 · 0 comments

Comments

@tuukka
Copy link

tuukka commented Oct 6, 2015

The order and thus result of transformation execution seems to vary between runs, especially if I switch between Java 7 and Java 8. The written order of the transformations may matter as well, but it's not deterministic.

I tried 4 ways to write a transformation that updates an agency id and removes a route from the same agency:

{remove above update, update above remove} x {remove using old agency id, remove using new agency id}

{"op":"remove", "match":{"file":"routes.txt", "agency_id":"4", "route_short_name":"8001"}}
{"op":"update", "match":{"file":"agency.txt", "agency_id":"4"}, "update":{"agency_id":"VR"}}

{"op":"update", "match":{"file":"agency.txt", "agency_id":"4"}, "update":{"agency_id":"VR"}}
{"op":"remove", "match":{"file":"routes.txt", "agency_id":"4", "route_short_name":"8001"}}

{"op":"remove", "match":{"file":"routes.txt", "agency_id":"VR", "route_short_name":"8001"}}
{"op":"update", "match":{"file":"agency.txt", "agency_id":"4"}, "update":{"agency_id":"VR"}}

{"op":"update", "match":{"file":"agency.txt", "agency_id":"VR"}, "update":{"agency_id":"VR"}}
{"op":"remove", "match":{"file":"routes.txt", "agency_id":"4", "route_short_name":"8001"}}

On one Java 7 test run, all of these happened to work and removed the route. On another run, only the first one succeeded.

On three Java 8 test runs, the versions using old agency id failed. So perhaps it's deterministic here?

This is the command I used for testing: java -server -jar onebusaway-gtfs-transformer-cli.jar --transform matka.rule matka.zip matka ; grep -q ,8001, matka/routes.txt && echo "fail"

This is the GTFS data I work with: http://dev.hsl.fi/tmp/matka.zip

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

No branches or pull requests

1 participant