odps-sdk/odps-sdk-core/src/main/java/com/aliyun/odps/sqa/v2/SQLExecutorImpl.java [339:368]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private List<Record> getCommandResult(Long offset, Long countLimit, Long sizeLimit,
                                        boolean limitEnabled) throws OdpsException {
    if (offset != null && offset < 0L) {
      throw new IllegalArgumentException("illegal argument. offset = " + offset);
    }
    if (countLimit != null && countLimit < 0L) {
      throw new IllegalArgumentException("illegal argument. countLimit = " + countLimit);
    }
    Command command = queryInfo.getCommandInfo().getCommand();
    if (command.isSync()) {
      RecordIter recordIterator = command.run(odps, queryInfo.getCommandInfo());
      if (recordIterator == null) {
        return Collections.emptyList();
      }
      recordIterator.setCountLimit(countLimit == null ? -1L : countLimit);
      recordIterator.setOffset(offset == null ? 0L : offset);
      List<Record> records = new ArrayList<>();
      while (recordIterator.hasNext()) {
        Record record = recordIterator.next();
        records.add(record);
      }
      return records;
    }
    Instance instance = queryInfo.getCommandInfo().getInstance();
    instance.waitForSuccess();
    instance = queryInfo.getCommandInfo().getInstance();
    String res = instance.getTaskResults().get(queryInfo.getCommandInfo().getTaskName());

    return CommandUtil.toRecord(res, command.getResultHeaders().get(0));
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



odps-sdk/odps-sdk-core/src/main/java/com/aliyun/odps/sqa/SQLExecutorImpl.java [929:959]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  private List<Record> getCommandResult(Long offset, Long countLimit, Long sizeLimit,
      boolean limitEnabled) throws OdpsException {
    if (offset != null && offset < 0L) {
      throw new IllegalArgumentException("illegal argument. offset = " + offset);
    }
    if (countLimit != null && countLimit < 0L) {
      throw new IllegalArgumentException("illegal argument. countLimit = " + countLimit);
    }
    Command command = queryInfo.getCommandInfo().getCommand();
    // 同步直接阻塞返回结果
    if (command.isSync()) {
      RecordIter recordIterator = command.run(odps, queryInfo.getCommandInfo());
      if (recordIterator == null) {
        return Collections.emptyList();
      }
      recordIterator.setCountLimit(countLimit == null ? -1L : countLimit);
      recordIterator.setOffset(offset == null ? 0L : offset);
      List<Record> records = new ArrayList<>();
      while (recordIterator.hasNext()) {
        Record record = recordIterator.next();
        records.add(record);
      }
      return records;
    }
    Instance instance = queryInfo.getCommandInfo().getInstance();
    instance.waitForSuccess();
    instance = queryInfo.getCommandInfo().getInstance();
    String res = instance.getTaskResults().get(queryInfo.getCommandInfo().getTaskName());

    return CommandUtil.toRecord(res, command.getResultHeaders().get(0));
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



