-
Notifications
You must be signed in to change notification settings - Fork 326
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
Arrow builder is not an Array #9358
Conversation
Shouldn't we make it non-array completely by returning I think, reading the PR description, we should not match:
and as far as I remember, if we respond |
Depends. I would also have to manually enable all the related methods, e.g. |
What do you mean manually enable? I don't see any Catch-22 scenario here. The builder is a separate type with its own API. Why would we pretend it is an array when we don't really use it that way anyway? |
That's basically the same question I asked here. Why? |
@@ -14,6 +14,7 @@ | |||
import com.oracle.truffle.api.library.ExportLibrary; | |||
import com.oracle.truffle.api.library.ExportMessage; | |||
import org.enso.interpreter.arrow.LogicalLayout; | |||
import org.graalvm.collections.Pair; |
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.
though Jaroslav said org.graalvm.collections
was going away?
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.
Great observation. Thank you James. The question is how Pair
gets on classpath? Probably as a result of some transitive dependencies. We should update the dependencies of Arrow language to not use a dependency with such a huge transitive closure, but rather more direct one which doesn't contain org.graalvm.collections
as transitive dependency.
I don't know off-hand how such change should look like, but it'd be a good change.
In that case I misunderstood the conversation during the meeting because I got the impression that all the complaints were about |
} | ||
|
||
@ExportMessage | ||
Object readArrayElement(long index) |
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.
This implementation (together with isArrayElementReadable
) guarantees that builder.at 1
is going to yield an exception.
I believe the complaints were about I believe you effectively disabled
Given no method defined by Array.enso can succeed (except |
...guage-arrow/src/main/java/org/enso/interpreter/arrow/runtime/ArrowFixedSizeArrayBuilder.java
Outdated
Show resolved
Hide resolved
...guage-arrow/src/main/java/org/enso/interpreter/arrow/runtime/ArrowFixedSizeArrayBuilder.java
Outdated
Show resolved
Hide resolved
@GenerateInline(value = false) | ||
abstract class WriteToBuilderNode extends Node { | ||
|
||
public abstract void executeWrite(ArrowFixedSizeArrayBuilder receiver, long index, Object value) |
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.
Yes, this looks OK.
Pull Request Description
Follow up on #9150 - making sure that Arrow builder is not accidentally treated as an Array by disallowing reading elements.
Important Notes
Also making sure that the length of the resulting Arrow Array is consistent with what user requested.
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.