@Override
  public SessionDataSet executeLastDataQueryForOneDevice(
      String db, String device, List<String> sensors, boolean isLegalPathNodes)
      throws StatementExecutionException, IoTDBConnectionException {
    Pair<SessionDataSet, TEndPoint> pair;
    try {
      pair =
          getSessionConnection(device)
              .executeLastDataQueryForOneDevice(
                  db, device, sensors, isLegalPathNodes, queryTimeoutInMs);
      if (pair.right != null) {
        handleRedirection(device, pair.right);
      }
      return pair.left;
    } catch (IoTDBConnectionException e) {
      if (enableRedirection
          && !deviceIdToEndpoint.isEmpty()
          && deviceIdToEndpoint.get(device) != null) {
        logger.warn(SESSION_CANNOT_CONNECT, deviceIdToEndpoint.get(device));
        deviceIdToEndpoint.remove(device);

        // reconnect with default connection
        return defaultSessionConnection.executeLastDataQueryForOneDevice(
                db, device, sensors, isLegalPathNodes, queryTimeoutInMs)
            .left;
      } else {
        throw e;
      }
    }
  }
query eg. select last status from root.ln.wf01.wt01; <PrefixPath> + <suffixPath> = <TimeSeries>

@param paths timeSeries. eg.root.ln.d1.s1,root.ln.d1.s2
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java