|
10 | 10 | import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.partitionedtable_pb.GetTableRequest; |
11 | 11 | import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.partitionedtable_pb.MergeRequest; |
12 | 12 | import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.partitionedtable_pb.PartitionedTableDescriptor; |
| 13 | +import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.DropColumnsRequest; |
13 | 14 | import io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.ticket_pb.TypedTicket; |
14 | 15 | import io.deephaven.web.client.api.barrage.WebBarrageUtils; |
15 | 16 | import io.deephaven.web.client.api.barrage.def.ColumnDefinition; |
|
23 | 24 | import io.deephaven.web.shared.data.RangeSet; |
24 | 25 | import io.deephaven.web.shared.fu.JsConsumer; |
25 | 26 | import jsinterop.annotations.JsIgnore; |
| 27 | +import jsinterop.annotations.JsMethod; |
26 | 28 | import jsinterop.annotations.JsProperty; |
27 | 29 | import jsinterop.annotations.JsType; |
28 | 30 | import jsinterop.base.Js; |
@@ -284,13 +286,21 @@ public Column[] getColumns() { |
284 | 286 | } |
285 | 287 |
|
286 | 288 | /** |
287 | | - * A Table object containing all currently known keys used for this partitioned table. |
| 289 | + * Fetch a table containing all the valid keys of the partitioned table. |
288 | 290 | * |
289 | | - * @return Table |
| 291 | + * @return Promise of a Table |
290 | 292 | */ |
291 | | - @JsProperty |
292 | | - public JsTable getKeyTable() { |
293 | | - return keys; |
| 293 | + @JsMethod |
| 294 | + public Promise<JsTable> getKeyTable() { |
| 295 | + return connection.newState((c, state, metadata) -> { |
| 296 | + DropColumnsRequest drop = new DropColumnsRequest(); |
| 297 | + drop.setColumnNamesList(new String[]{descriptor.getConstituentColumnName()}); |
| 298 | + drop.setSourceId(keys.state().getHandle().makeTableReference()); |
| 299 | + drop.setResultId(state.getHandle().makeTicket()); |
| 300 | + connection.tableServiceClient().dropColumns(drop, metadata, c::apply); |
| 301 | + }, "drop constituent column") |
| 302 | + .refetch(this, connection.metadata()) |
| 303 | + .then(state -> Promise.resolve(new JsTable(connection, state))); |
294 | 304 | } |
295 | 305 |
|
296 | 306 | /** |
|
0 commit comments