code: private void registerOperandSubQueries(
  		SqlValidatorScope parentScope,
  		SqlCall call,
  		int operandOrdinal) {
  		SqlNode operand = call.operand(operandOrdinal);
  		if (operand == null) {
  			return;
  		}
  		if (operand.getKind().belongsTo(SqlKind.QUERY)
  			&& call.getOperator().argumentMustBeScalar(operandOrdinal)) {
  			operand =
  				SqlStdOperatorTable.SCALAR_QUERY.createCall(
  					operand.getParserPosition(),
  					operand);
  			call.setOperand(operandOrdinal, operand);
  		}
  		registerSubQueries(parentScope, operand);
  	}
docs: Registers any sub-queries inside a given call operand, and converts the
  operand to a scalar sub-query if the operator requires it.
  
  @param parentScope    Parent scope
  @param call           Call
  @param operandOrdinal Ordinal of operand within call
  @see SqlOperator#argumentMustBeScalar(int)