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

Bugfix/1509/disallow appending different rangeindexes in dynamic schema #1514

Conversation

alexowens90
Copy link
Collaborator

Fixes #1509

While fixing, noticed that the added test test_append_range_index_from_zero would also not have passed, so fixed this too.

vasil-pashov and others added 9 commits April 2, 2024 14:55
#### Reference Issues/PRs
Closes: #1428 

#### What does this implement or fix?
Create an empty-index type. This required change in the Python and in
the C++ layer.
* In the C++ layer an new index type was added.
(IndexDescriptor::EMPTY). It does not allocate a filed in the storage
(similar to how row range index does not allocate a field). The checks
for index compatibility are relaxed, the empty index is compatible with
all other index types and it gets overridden the first time a non-empty
index is written (either through update or append). On write we check if
the dataframe contains 0 rows and if so it gets assigned an empty index.
* The logic in the python layer is dodgy and needs discussion. In the
current state the normalization metadata and the index descriptor are
stored separately. There is one proto message describing both DateTime
index and Ranged Index. The current change made it so that in case of 0
rows the python layer passes RowRange index to the C++ layer which
checks if there are any rows in the DF. If there are rows Row range
index is used, otherwise empty index is used. Note the
`is_not_range_index` proto field. IMO it needs some refactoring in
further PRs. It's used in the python layer to check if the first column
is index or not.
#### Any other comments?

Merge this after: #1436

#### Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->

---------

Co-authored-by: Vasil Pashov <vasil.pashov@man.com>
Refactor index.hpp

Move the functions in a .cpp file. Add explicit template instantiations
for the CRTP base class in the cpp file.

#### Checklist

<details>
  <summary>
   Checklist for code changes...
  </summary>
 
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
 - [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>

<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->

---------

Co-authored-by: Vasil Pashov <vasil.pashov@man.com>
@alexowens90 alexowens90 changed the base branch from master to feature/empty_index April 22, 2024 11:31
@alexowens90 alexowens90 force-pushed the bugfix/1509/disallow-appending-different-rangeindexes-in-dynamic-schema branch from 5f7abd3 to 6fbe507 Compare April 22, 2024 11:32
Base automatically changed from feature/empty_index to master April 25, 2024 08:26
@alexowens90
Copy link
Collaborator Author

Superseded by #1529

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.

Dynamic schema allows appending non-matching RangeIndexes
2 participants