Open devinrsmith opened 2 months ago
When applying the request, I'm pretty sure the table it's applying to has the preview columns already: https://github.com/deephaven/deephaven-core/blob/77cbe4c44ecf030fce946df333a60f246d4c8057/server/src/main/java/io/deephaven/server/table/ops/UpdateOrSelectGrpcImpl.java#L49
Source table can be found via the PREVIEW_PARENT_TABLE
attribute: https://github.com/deephaven/deephaven-core/blob/77cbe4c44ecf030fce946df333a60f246d4c8057/engine/table/src/main/java/io/deephaven/engine/table/impl/preview/ColumnPreviewManager.java#L115
So I think it needs to check if there's a source table, apply the custom columns to that, and then apply previews again before returning the table?
Doesn't seem to be a UI issue though, as we don't know the custom column contains another column in it's express at all, we're just sending the spec as a string to the server.
So, the thought is to change the server side implementation to detect that there's a parent to apply to?
It's the web UI that is calling
/*
* Create a table that has preview columns applied to an existing source table.
*/
rpc ApplyPreviewColumns(ApplyPreviewColumnsRequest) returns (ExportedTableCreationResponse) {}
though?
In which case, I might argue it should still be web UI to keep reference to parent? It's technically possible that a caller in another context would actually want to refer to an ArrayPreview type, and so unconditionally grabbing the parent on the server side might be incorrect.
Or maybe, makes it the responsibility of the JS layer; still, not sure if we'd want to unconditionally unwrap parent of said table.
This is a longstanding bug, inherited (where it was by design) from DHE, and up until now DHC has applied it consistently with DHE.
It isnt the web UI calling that, but the JS API, under the assumption that it needs to be done so that we don't end up with tables where the client either can't read the contents, or the ui can't display them.
With #5890 merged, we can change this, since we can support more types on the client. See also https://github.com/deephaven/deephaven-core/issues/5708, https://github.com/deephaven/deephaven-core/issues/2102.
The fix will probably be to apply it conditionally at the time of the subscription being created. Making it optional will mean exposing more flags when creating subscriptions from the UI, both to let it be enabled/disabled, but also (2102 above) supporting limits on arrays to be sent, etc.
I'm unable to use a byte[] column type in custom column formulas. Here's the setup:
Now, create a custom column in the web UI column name
foo_str
and the formulanew java.lang.String(foo_bytes)
. The relevant error (only visible in server logs):It looks like the web client is trying to build off of the web UIs derivation of the table (ie, the ArrayPreview column type) as opposed to the original table (ie, the byte[] column type).
Here's the full server side exception: