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

Editor: Extra fields added to tables during export #284

Open
landonreed opened this issue Apr 22, 2020 · 1 comment
Open

Editor: Extra fields added to tables during export #284

landonreed opened this issue Apr 22, 2020 · 1 comment
Labels

Comments

@landonreed
Copy link
Contributor

Observed behavior

A GTFS feed that is loaded and snapshotted for the RDBMS-backed editor will contain additional fields not attached to the originally imported tables. E.g., the editor-specific route_branding_url field will be added to the routes table on export.

Expected behavior

Ideally a GTFS feed making a round trip would contain no additional fields/modifications. There is a related issue #283 that modifies stop_sequence values.

Steps to reproduce the problem

  1. Import any GTFS feed
  2. Load into editor
  3. Snapshot and publish feed.
  4. Download GTFS and observe addition of routes#route_branding_url field.

Notes on configuration and files required to reproduce the issue

n/a

@landonreed landonreed added the bug label Apr 22, 2020
@landonreed
Copy link
Contributor Author

As discussed outside of GH, there may be a potential fix here with pg_stats to determine which columns have all null values and skip those on the export of the table from the GTFS Editor: https://dba.stackexchange.com/a/2932/206444.

E.g.:

vacuum analyze; -- if needed
select schemaname, tablename, attname
from pg_stats
where most_common_vals is null
and most_common_freqs is null
and histogram_bounds is null
and correlation is null
and null_frac = 1;

@landonreed landonreed pinned this issue Apr 22, 2020
@landonreed landonreed unpinned this issue Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant