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

Improve handling of CSV static data load where identity column with separate unique index involved #106

Closed
shantstepanian opened this issue Oct 27, 2017 · 1 comment

Comments

@shantstepanian
Copy link
Contributor

shantstepanian commented Oct 27, 2017

Expected Behavior

CSV - table with unique index and PK on identity column should prefer the unique index, or allow primaryKeys attribute to override existing PK

Actual Behavior

primary key is used, and we cannot override. Will need to think about which way is best

Obevo Version where this issue was observed

6.3.0, though it exists beforehand

Steps to reproduce the behavior

Create table w/ PK on identity column and unique index
Test this out in CSV loading unit test
Ensure that we can detect identity columns in the metadata test

Use Case 2 related to this:
table exists with primary key and unique index on separate columns
CSV file is defined without the PK identity column, but with the unique index columns
In DB2, it looks like any updates on the column will fail

Ideally, we should allow overriding the PK column. But in case users don't, we should handle this elegantly. Maybe ignoring the identity PK as mentioned above would be good

@shantstepanian shantstepanian added this to the 6.4.0 milestone Oct 27, 2017
@shantstepanian shantstepanian modified the milestones: 6.4.0, 6.5.0 Nov 23, 2017
@shantstepanian shantstepanian modified the milestones: 6.5.0, 6.6.0 Feb 11, 2018
@shantstepanian shantstepanian modified the milestones: 6.6.0, 6.7.0 May 9, 2018
@shantstepanian shantstepanian changed the title CSV - table with unique index and PK on identity column should prefer the unique index, or allow primaryKeys attribute to override existing PK Improve handling of CSV static data load where identity column with separate unique index involved Dec 27, 2018
shantstepanian added a commit that referenced this issue Jan 7, 2019
CSV data loads will ignore indices that have columns not in the CSV file
@shantstepanian
Copy link
Contributor Author

We decided to only update the logic to pick the unique index in a smarter way, e.g. 1) only pick a PK or index if all of its columns are defined in the CSV file 2) give preference to the primary key if multiple PKs/unique indices satisfy this logic

We will still not allow the metadata override to be specified if a valid unique index exists. If we continue to receive feedback on needing this even after this fix is in, we will consider it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant