-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Split EmptyExec
into PlaceholderRowExec
#8446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @razeghi71
I only have one naming question: which one is preferred? placeholder/Placeholder
or place_holder/PlaceHolder
I tend to think of Placeholder as one word but totally okay with the other one. If you're also okay with |
Great! Other places also use Placeholder like |
We do have I'll rename |
EmptyExec
into PlaceHolderRowExec
EmptyExec
into PlaceholderRowExec
Thank you @razeghi71 -- I hope to review this PR tomorrow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @razeghi71 -- this PR good to me. I do think it is worth considering a different name for this node (even though I know you and @waynexia have been working to ensure consistent use of PlaceHolder). However I don't think it is required and this is an improvement.
let me know what you think
|
||
fn data(&self) -> Result<Vec<RecordBatch>> { | ||
Ok({ | ||
let n_field = self.schema.fields.len(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the schema can ever have more than 0 fields 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does, In this case for example:
CREATE TABLE test (c INT) as values(0);
SELECT COUNT(*) from test;
|
||
/// Execution plan for empty relation with produce_one_row=true | ||
#[derive(Debug)] | ||
pub struct PlaceholderRowExec { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about calling this OneRowExec
? Perhaps that would make the use case of this node more clear than the name PlaceholderRowExec
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with PlaceholderRow
because it's always a row of null values, with columns named placeholder_{n}
that get projected later. But if OneRowExec
sounds better to you, I can definitely switch it up. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think PlaceHolderExec is fine
I took the liberty of merging up from main to resolve a conflict on this PR |
* add PlaceHolderRowExec * Change produce_one_row=true calls to use PlaceHolderRowExec * remove produce_one_row from EmptyExec, changes in proto serializer, working tests * PlaceHolder => Placeholder --------- Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
Which issue does this PR close?
Closes #8355
Rationale for this change
Explained in the issue. Please note that I've previously tried to do this using
MemoryExec
in #8412, but sinceMemoryExec
doesn't have a serializer and it wasn't trivial to implement one, I took the original way proposed in the issue.I named it
PlaceHolderRowExec
instead ofOneRowExec
as this is really more like a place holder with null values for columns until a projection gets applied to it and transform it to another format.What changes are included in this PR?
In this PR I'm splitting
EmptyExec
case ofproduce_one_row=true
toPlaceHolderRowExec
. What I didn't do here is that I didn't split the same case inEmptyRelation
, probably better to do it in a separate PR.Are these changes tested?
Yes. the tests can be find the
PlaceHolderRowExec
file. Also the integration tests are changed to reflect this change.Are there any user-facing changes?
When showing the physical plan, instead of
EmptyExec produce_one_row=value
there are now two different cases:EmptyExec
andPlaceHolderRowExec