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

scan: extention types filters #423

Merged

Conversation

DifferentialOrange
Copy link
Member

@DifferentialOrange DifferentialOrange commented Mar 11, 2024

This patch clarifies the state of extension types in filters. (Any non-indexed condition or condition for any non-iterating index is a filter. All condition index except for the first one are non-iterating.)

State before the PR:

  • decimal: was allowed, but precision loss had happened,
  • uuid: supported in Add support for UUID keys comparison #86,
  • datetime: had failed with non-informative internal error,
  • interval: had failed with non-informative internal error.

State after the path:

  • decimal: works fine now, no precision loss,
  • uuid: unchanged,
  • datetime: fully supported,
  • interval: usage forbidden with explicit error since type is non-comparable.

box.error is not covered here since they cannot be used in space format.

This PR also fixes passing errors from storages, since it was required to forbid intervals in conditions.

See commits for more info.

Closes #373

@DifferentialOrange DifferentialOrange force-pushed the DifferentialOranage/gh-373-datetime-conditions branch 4 times, most recently from 5be3dea to d0d6ce7 Compare March 12, 2024 09:38
The test was missing from PR #419, which had solved the original issue.

Follows #418
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOranage/gh-373-datetime-conditions branch 4 times, most recently from 442164d to 2aa73df Compare March 12, 2024 16:18
@DifferentialOrange DifferentialOrange changed the title scan: support datetime filters scan: extention types filters Mar 12, 2024
@DifferentialOrange DifferentialOrange marked this pull request as ready for review March 12, 2024 16:23
@DifferentialOrange DifferentialOrange requested review from better0fdead and removed request for better0fdead March 12, 2024 16:27
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOranage/gh-373-datetime-conditions branch 2 times, most recently from 01b5976 to c0a7295 Compare March 13, 2024 07:56
Copy link
Contributor

@better0fdead better0fdead left a comment

Choose a reason for hiding this comment

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

Hi, thx for patch. See small comments below.

crud/common/utils.lua Show resolved Hide resolved
test/entrypoint/srv_select/storage_init.lua Show resolved Hide resolved
test/entrypoint/srv_select/storage_init.lua Show resolved Hide resolved
test/entrypoint/srv_select/storage_init.lua Show resolved Hide resolved
test/entrypoint/srv_select/storage_init.lua Show resolved Hide resolved
test/integration/read_scenario.lua Outdated Show resolved Hide resolved
test/integration/read_scenario.lua Show resolved Hide resolved
test/entrypoint/srv_select/storage_init.lua Show resolved Hide resolved
test/integration/read_scenario.lua Show resolved Hide resolved
.github/workflows/test_on_push.yaml Show resolved Hide resolved
Before this patch, datetime conditions were supported only in iterators,
but not filters. (Any non-indexed condition or condition for any
non-iterating index is a filter. Any condition index except for
the first one is non-iterating.) This patch introduce datetime
comparison support to filter codegen library, similar to uuid one.

Part of #373
Before this patch, decimals were cast to numbers in filters through
`tostring` in codegen. This patch fixes this precision loss.

Part of #373
Versions 2.2--2.7 have reached their end of life in 2020-2021 [1].

1. https://www.tarantool.io/ru/doc/latest/release/eol_versions/
Before this patch, returning any errors from storages for merger
operations (`crud.select`, `crud.pairs`, `readview:select`,
`readview:pairs`) had resulted in non-informative
"Invalid merge source 0x556bb6885a00" errors. This patch fixes the issue
by replacing error return with error throw.

Part of #373
As for Tarantool 3.0 and older, datetime intervals are
not comparable [1]. They are also don't supported in indexes. This patch
explicitly forbids to use them in conditions.
1. tarantool/tarantool#7659

Closes #373
@DifferentialOrange DifferentialOrange force-pushed the DifferentialOranage/gh-373-datetime-conditions branch from c0a7295 to 771904f Compare March 14, 2024 08:21
@DifferentialOrange DifferentialOrange merged commit f790d54 into master Mar 14, 2024
42 of 44 checks passed
@DifferentialOrange DifferentialOrange deleted the DifferentialOranage/gh-373-datetime-conditions branch March 14, 2024 14:11
DifferentialOrange added a commit that referenced this pull request Apr 3, 2024
Overview

  This release introduces roles for Tarantool 3 configuration (supported
  for versions 3.0.2, 3.1.0 and newer).

Added
* Asynchronous bootstrap support for storages (#412).
* Tarantool 3 roles for setting up crud routers and storages (#415).
* Ability to configure crud through Tarantool 3 roles
  configuration (#415).

Changed
* Explicitly forbid datetime interval conditions (#373).
* Storage initialization is now asynchronous by default for
  Tarantool 3.0+ (#412).
* Additionally check backoff error on storage info fetch (#427).

Fixed
* Working with datetime conditions in case of non-indexed fields or
  non-iterating indexes (#373).
* Precision loss for decimal conditions in case of non-indexed fields or
  non-iterating indexes (#373).
* Passing errors from storages for merger operations (`crud.select`,
  `crud.pairs`, `readview:select`, `readview:pairs`) (#423).
* Working with `nil` operand conditions in case of non-indexed fields or
  non-iterating indexes (#422).
@DifferentialOrange DifferentialOrange mentioned this pull request Apr 3, 2024
DifferentialOrange added a commit that referenced this pull request Apr 4, 2024
Overview

  This release introduces roles for Tarantool 3 configuration (supported
  for versions 3.0.2, 3.1.0 and newer).

Added
* Asynchronous bootstrap support for storages (#412).
* Tarantool 3 roles for setting up crud routers and storages (#415).
* Ability to configure crud through Tarantool 3 roles
  configuration (#415).

Changed
* Explicitly forbid datetime interval conditions (#373).
* Storage initialization is now asynchronous by default for
  Tarantool 3.0+ (#412).
* Additionally check backoff error on storage info fetch (#427).

Fixed
* Working with datetime conditions in case of non-indexed fields or
  non-iterating indexes (#373).
* Precision loss for decimal conditions in case of non-indexed fields or
  non-iterating indexes (#373).
* Passing errors from storages for merger operations (`crud.select`,
  `crud.pairs`, `readview:select`, `readview:pairs`) (#423).
* Working with `nil` operand conditions in case of non-indexed fields or
  non-iterating indexes (#422).
DifferentialOrange added a commit that referenced this pull request May 20, 2024
Overview

  This release introduces roles for Tarantool 3 configuration (supported
  for versions 3.0.2, 3.1.0 and newer).

Added
* Asynchronous bootstrap support for storages (#412).
* Tarantool 3 roles for setting up crud routers and storages (#415).
* Ability to configure crud through Tarantool 3 roles
  configuration (#415).

Changed
* Explicitly forbid datetime interval conditions (#373).
* Storage initialization is now asynchronous by default for
  Tarantool 3.0+ (#412).
* Additionally check backoff error on storage info fetch (#427).

Fixed
* Working with datetime conditions in case of non-indexed fields or
  non-iterating indexes (#373).
* Precision loss for decimal conditions in case of non-indexed fields or
  non-iterating indexes (#373).
* Passing errors from storages for merger operations (`crud.select`,
  `crud.pairs`, `readview:select`, `readview:pairs`) (#423).
* Working with `nil` operand conditions in case of non-indexed fields or
  non-iterating indexes (#422).
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.

Failed to select with datetime conditions
2 participants