docs: private DruidRel<?> getLeftRelWithFilter()
    {
      final DruidRel<?> druidRight = (DruidRel) this.right;
  
      // Build list of acceptable values from right side.
      final Set<List<String>> valuess = new HashSet<>();
      final List<RexNode> conditions = druidRight.runQuery().accumulate(
          new ArrayList<>(),
          new Accumulator<List<RexNode>, Object[]>()
          {
            int numRows;
  
            @Override
            public List<RexNode> accumulate(final List<RexNode> theConditions, final Object[] row)
            {
              final List<String> values = new ArrayList<>(rightKeys.size());
  
              for (int i : rightKeys) {
                final Object value = row[i];
                if (value == null) {
                  // NULLs are not supposed to match NULLs in a join. So ignore them.
                  continue;
                }
                final String stringValue = DimensionHandlerUtils.convertObjectToString(value);
                values.add(stringValue);
              }
  
              if (valuess.add(values)) {
                if (++numRows > maxSemiJoinRowsInMemory) {
                  throw new ResourceLimitExceededException(
                      StringUtils.format("maxSemiJoinRowsInMemory[%,d] exceeded", maxSemiJoinRowsInMemory)
                  );
                }
                final List<RexNode> subConditions = new ArrayList<>();
  
                for (int i = 0; i < values.size(); i++) {
                  final String value = values.get(i);
                  // NULLs are not supposed to match NULLs in a join. So ignore them.
                  if (value != null) {
                    subConditions.add(
                        getCluster().getRexBuilder().makeCall(
                            SqlStdOperatorTable.EQUALS,
                            leftExpressions.get(i),
                            getCluster().getRexBuilder().makeLiteral(value)
                        )
                    );
                  }
                  theConditions.add(makeAnd(subConditions));
                }
              }
              return theConditions;
            }
          }
      );
  
      valuess.clear();
  
      if (!conditions.isEmpty()) {
        // Add a filter to the left side.
        final PartialDruidQuery leftPartialQuery = left.getPartialDruidQuery();
        final Filter whereFilter = leftPartialQuery.getWhereFilter();
        final Filter newWhereFilter;
  
        if (whereFilter != null) {
          newWhereFilter = whereFilter.copy(
              whereFilter.getTraitSet(),
              whereFilter.getInput(),
              RexUtil.flatten(
                  getCluster().getRexBuilder(),
                  makeAnd(ImmutableList.of(whereFilter.getCondition(), makeOr(conditions)))
              )
          );
        } else {
          newWhereFilter = LogicalFilter.create(
              leftPartialQuery.getScan(),
              makeOr(conditions) // already in flattened form
          );
        }
  
        PartialDruidQuery newPartialQuery = PartialDruidQuery.create(leftPartialQuery.getScan())
                                                             .withWhereFilter(newWhereFilter)
                                                             .withSelectProject(leftPartialQuery.getSelectProject())
                                                             .withSelectSort(leftPartialQuery.getSelectSort());
  
        if (leftPartialQuery.getAggregate() != null) {
          newPartialQuery = newPartialQuery.withAggregate(leftPartialQuery.getAggregate());
        }
  
        if (leftPartialQuery.getHavingFilter() != null) {
          newPartialQuery = newPartialQuery.withHavingFilter(leftPartialQuery.getHavingFilter());
        }
  
        if (leftPartialQuery.getAggregateProject() != null) {
          newPartialQuery = newPartialQuery.withAggregateProject(leftPartialQuery.getAggregateProject());
        }
  
        if (leftPartialQuery.getSort() != null) {
          newPartialQuery = newPartialQuery.withSort(leftPartialQuery.getSort());
        }
  
        if (leftPartialQuery.getSortProject() != null) {
          newPartialQuery = newPartialQuery.withSortProject(leftPartialQuery.getSortProject());
        }
  
        return left.withPartialQuery(newPartialQuery);
      } else {
        return null;
      }
    }