Search in sources :

Example 1 with ExactJoinTablesRequest

use of io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExactJoinTablesRequest in project deephaven-core by deephaven.

the class JsTable method exactJoin.

@JsMethod
public Promise<JsTable> exactJoin(JsTable rightTable, JsArray<String> columnsToMatch, @JsOptional JsArray<String> columnsToAdd) {
    if (rightTable.workerConnection != workerConnection) {
        throw new IllegalStateException("Table argument passed to join is not from the same worker as current table");
    }
    return workerConnection.newState((c, state, metadata) -> {
        ExactJoinTablesRequest request = new ExactJoinTablesRequest();
        request.setLeftId(state().getHandle().makeTableReference());
        request.setRightId(rightTable.state().getHandle().makeTableReference());
        request.setResultId(state.getHandle().makeTicket());
        request.setColumnsToMatchList(columnsToMatch);
        request.setColumnsToAddList(columnsToAdd);
        workerConnection.tableServiceClient().exactJoinTables(request, metadata, c::apply);
    }, "exactJoin(" + rightTable + ", " + columnsToMatch + ", " + columnsToAdd + ")").refetch(this, workerConnection.metadata()).then(state -> Promise.resolve(new JsTable(workerConnection, state)));
}
Also used : ExactJoinTablesRequest(io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExactJoinTablesRequest) JsMethod(jsinterop.annotations.JsMethod)

Aggregations

ExactJoinTablesRequest (io.deephaven.javascript.proto.dhinternal.io.deephaven.proto.table_pb.ExactJoinTablesRequest)1 JsMethod (jsinterop.annotations.JsMethod)1