joinWhere method

LazyFrame joinWhere(
  1. LazyFrame other,
  2. Iterable<Expr> predicates, {
  3. JoinWhereOptions options = const JoinWhereOptions(),
})

Implementation

LazyFrame joinWhere(
  LazyFrame other,
  Iterable<Expr> predicates, {
  JoinWhereOptions options = const JoinWhereOptions(),
}) {
  _runtime._requireLazy(other);
  final values = List<Expr>.unmodifiable(predicates);
  if (values.isEmpty) {
    throw ArgumentError.value(predicates, 'predicates', 'must not be empty');
  }
  for (final value in values) {
    _runtime._requireExpr(value);
  }
  final fields = options._toJson();
  final leases = _leaseAll([
    _owner,
    other._owner,
    ...values.map((x) => x._owner),
  ]);
  try {
    return _runtime._adoptLazy(
      _runtime._client.invokeSync('lazyJoinWhere', {
        'left': leases[0].handle.toString(),
        'right': leases[1].handle.toString(),
        'predicates': leases.skip(2).map((x) => x.handle.toString()).toList(),
        ...fields,
      }),
    );
  } finally {
    _releaseAll(leases);
  }
}