You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Neal Richardson (Jira)" <ji...@apache.org> on 2021/06/21 21:01:00 UTC
[jira] [Commented] (ARROW-13117) [R] Retain schema in new
Expressions
[ https://issues.apache.org/jira/browse/ARROW-13117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17366834#comment-17366834 ]
Neal Richardson commented on ARROW-13117:
-----------------------------------------
I don't think I agree with your expectation. {{Expression}} objects should have no type (though ${{type()}} shouldn't error) until it is bound to a Schema. So {{Expression$create("add_checked", x, y)$type()}} should return NULL IMO.
> [R] Retain schema in new Expressions
> ------------------------------------
>
> Key: ARROW-13117
> URL: https://issues.apache.org/jira/browse/ARROW-13117
> Project: Apache Arrow
> Issue Type: Improvement
> Components: R
> Reporter: Ian Cook
> Assignee: Ian Cook
> Priority: Major
> Labels: pull-request-available
> Fix For: 5.0.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> When a new Expression is created, {{schema}} should be retained from the expression(s) it was created from. That way, the {{type()}} and {{type_id()}} methods of the new Expression will work. For example, currently this happens:
> {code:r}
> > x <- Expression$field_ref("x")
> > x$schema <- Schema$create(x = int32())
> >
> > y <- Expression$field_ref("y")
> > y$schema <- Schema$create(y = int32())
> >
> > Expression$create("add_checked", x, y)$type()
> Error: !is.null(schema) is not TRUE {code}
> This is what we want to happen:
> {code:r}
> > Expression$create("add_checked", x, y)$type()
> Int32
> int32
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)