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

automatically create new columns when the schema changes #11

Merged
merged 2 commits into from Apr 20, 2016

Conversation

DwayneJengSage
Copy link
Collaborator

This is needed to support mutable schemas. Bridge-EX will now compare the existing columns in a Synapse table against the column defs generated from a schema, and update the Synapse table accordingly if they are different. Has checks to prevent against column deletion and column modification. Allows column re-ordering. Optimized to not update tables if no columns are added.

This check and update is only run once per Exporter run.

Validation done:

  • added unit tests
  • Jacoco coverage checks
  • findbugs checks

Manual tests:

  • created a Synapse table with extra fields and wrong field types and sizes; verified the "deleted column" and "modified column" checks in the logs
  • created a Synapse table with missing columns (including both health data columns and common columns) and columns out of order; verified that BridgeEX creates and reorders columns appropriately
  • created a Synapse table with only swapped columns; verified that BridgeEX doesn't update the table if there are no new columns

private List<String> getColumnNameListForTable(String synapseTableId) throws SynapseException {
// Get columns from Synapse
// Helper method to detect when a schema changes and updates the Synapse table accordingly. Will reject schema
// changes that delete or modify columns. Optimized so if no columns were inserted, it won't modify the table.
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if it rejects a delete or a type change? The export fails, or is the export later put in a new table? It looks like it just skips those columns on export... ?

@alxdarksage alxdarksage merged commit 9a40153 into Sage-Bionetworks:develop Apr 20, 2016
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.

None yet

2 participants