You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have many pieces of code that has if (flat) { ... } else { // unflat ... } branches. This does not seem necessary if the flatten operator, which is the only operator that flattens correctly sets the selectedSize of the DataChunk it is flattening to 1 and set the selectedPos correctly. This would get rid of all these branches from many places. However, I don't expect all such branches to go away because some code may still need to identify the flat data chunk. For example in binary comparison expressions one of the two sides are assumed to be flat, so that code still needs to check which side is flat. So we might need to keep the isFlat() function, which would return true if the selectedSize = 1.
The flatten operator would need to change and make sure that if it receives an already selected data chunk to flatten, it copies those original selected vectors. At a high level, its pseudocode should look like this:
Flatten : PhysicalOp {
void getNextTuples() {
bool[] prevSelectedPos = dataChunkToFlatten->copySelectedState();
uint64_t prevSelectedSize = dataChunkToFlatten->selectedSize;
dataChunkToFlatten->selectedSize = 1;
for (int i = 0; i < prevSelectedSize; ++i) { // this would not be a for loop but be incremented with each call to getNextTuples()
dataChunkToFlatten->selectedPos[0] = prevSelectedPos[i];
}
}
}
And then many but not all if (isFlat()) code paths would be removed.
I'm labeling this as phase 1 but this can be addressed later.
The text was updated successfully, but these errors were encountered:
Currently we have many pieces of code that has if (flat) { ... } else { // unflat ... } branches. This does not seem necessary if the flatten operator, which is the only operator that flattens correctly sets the selectedSize of the DataChunk it is flattening to 1 and set the selectedPos correctly. This would get rid of all these branches from many places. However, I don't expect all such branches to go away because some code may still need to identify the flat data chunk. For example in binary comparison expressions one of the two sides are assumed to be flat, so that code still needs to check which side is flat. So we might need to keep the isFlat() function, which would return true if the selectedSize = 1.
The flatten operator would need to change and make sure that if it receives an already selected data chunk to flatten, it copies those original selected vectors. At a high level, its pseudocode should look like this:
And then many but not all if (isFlat()) code paths would be removed.
I'm labeling this as phase 1 but this can be addressed later.
The text was updated successfully, but these errors were encountered: