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

[Feature request] create_parent: add an offset in the partitions #339

Open
javiEsteban1993 opened this issue Feb 9, 2021 · 6 comments
Open
Assignees
Milestone

Comments

@javiEsteban1993
Copy link

Hi,

I needed to create partitions by id, but the first partition starts for id 0 and I needed the first partition to be for id 1, so I suggest adding an offset in the create_parent function to select the first partition, this offset will be a parameter obtained by argument.

In the create_parent function, add a new variable integer called offset initialized to 0 to keep current use, then add the following code on line 576:
v_starting_partition_id := v_max - (v_max % v_id_interval);
v_starting_partition_id := v_starting_partition_id + offset;
FOR i IN 0..p_premake LOOP

@javiEsteban1993 javiEsteban1993 changed the title create_parent: add an offset in the partitions [Feature request] create_parent: add an offset in the partitions Feb 9, 2021
@keithf4
Copy link
Collaborator

keithf4 commented Feb 10, 2021

Initially I thought the p_start_partition parameter would handle that, but apparently it still started at zero. I'll look into it when I have a chance or if you'd like to make a patch I'd be happy to review it.

@keithf4
Copy link
Collaborator

keithf4 commented Apr 7, 2021

I think one issue with this that I'm still unsure of is do you need that offset just for the first partition or do you need that offset to continue forward? Like if the interval was 10, the child tables would normally be spaced like

0
10
20
30

Do you want that offset just for the first table like this?

1
10
20
30

Or for all going forward?

1
11
21
31

If you just want the first one, I honestly don't really see the need for it. While the table may have a lower boundary of 0, that doesn't mean it has to insert that zero value. If that was a concern just for that first child table, you could add a one-off constraint to that first child to prevent it.

If it needs to be a permanent offset for the entire partition set, that I could possibly look into.

@javiEsteban1993
Copy link
Author

My idea was add an offset, because if I want to start the partition, for example with ID 15 and an interval of 10 I would like to get:
15
25
35
Then I solved it adding this:
In the create_parent function on line 576:
v_starting_partition_id := v_max - (v_max % v_id_interval);
v_starting_partition_id := v_starting_partition_id + offset;
FOR i IN 0..p_premake LOOP

@keithf4
Copy link
Collaborator

keithf4 commented Apr 7, 2021

Ok. Just wanted some clarification. Thanks!

@javiEsteban1993
Copy link
Author

For any question ask me, Thanks in advance

@keithf4
Copy link
Collaborator

keithf4 commented Jun 25, 2022

Marking this as a feature to look into for 5.0. If I get a chance to look at it before then I will try.

@keithf4 keithf4 added this to the 5.0 milestone Jun 25, 2022
@keithf4 keithf4 modified the milestones: 5.0, 5.1 Nov 29, 2022
@keithf4 keithf4 self-assigned this Nov 9, 2023
@keithf4 keithf4 modified the milestones: 5.1, Future Jan 12, 2024
@keithf4 keithf4 modified the milestones: Future, 5.2 Jan 12, 2024
@keithf4 keithf4 modified the milestones: 5.2, 5.3 Oct 16, 2024
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

2 participants