Skip to content

Conversation

@dokshina
Copy link
Contributor

@dokshina dokshina commented Oct 1, 2020

I didn't forget about

  • Tests

Closes #30

Plan is generated on router and is passed to storage
Filter functions are generated on storage
end

-- set after tuple
local after_tuple = utils.flatten(opts.after, space_format)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure it's a good place for unflatten...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we should pass raw tuple to this function as option...

But ok, feel free to ignore this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since crud returns map, user will use it as an after value for selecting next batch of data.

function executor.execute(space, index, scan_value, iter, filter_func, opts)
checks('table', 'table', '?table', 'number', 'function', {
after_tuple = '?cdata|table',
batch_size = '?number',
Copy link
Contributor

Choose a reason for hiding this comment

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

number|cdata

Copy link
Contributor

Choose a reason for hiding this comment

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

Or even number|uint64|int64

Copy link
Contributor

Choose a reason for hiding this comment

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

So, not sure checks really needed here it's internal module

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but it's very helpful for local development.
Moreover, all functions have a lot of arguments and different opts.

Copy link
Contributor

Choose a reason for hiding this comment

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

very helpful for local development.

Then do something like:

local checks = require('checks')
if os.getenv('DEV') ~= '1' then
    checks = function() end
end

And run all your tests with "DEV=1" option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #35.

return merged_parts
end

function utils.extract_sharding_key_from_scan_key(scan_key, scan_index, sharding_index)
Copy link
Contributor

Choose a reason for hiding this comment

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

It does the same as is_scan_by_full_sharding_key_eq

@dokshina dokshina marked this pull request as ready for review October 2, 2020 13:17
@dokshina dokshina merged commit 6560c23 into master Oct 2, 2020
@dokshina dokshina deleted the refactor-select-plan branch October 2, 2020 13:18
ligurio added a commit that referenced this pull request Nov 18, 2021
commit 6560c23

Author: Elizaveta Dokshina <32142520+dokshina@users.noreply.github.com>
Date:   Fri Oct 2 16:18:37 2020 +0300

Refactor select plan (#32)
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.

[4pt] Select Plan Rework

3 participants