private IMemMNode getTableDeviceNode(final String table, final Object[] deviceId)
      throws PathNotExistException {
    IMemMNode cur = storageGroupMNode;
    IMemMNode next;

    next = cur.getChild(table);
    if (next == null) {
      throw new PathNotExistException(
          storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
          true);
    } else if (next.isMeasurement()) {
      throw new PathNotExistException(
          storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
          true);
    }
    cur = next;

    for (int i = 0; i < deviceId.length; i++) {
      next = cur.getChild(deviceId[i] == null ? null : String.valueOf(deviceId[i]));
      if (next == null) {
        throw new PathNotExistException(
            storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
            true);
      } else if (next.isMeasurement()) {
        if (i == deviceId.length - 1) {
          return next;
        } else {
          throw new PathNotExistException(
              storageGroupMNode.getFullPath() + PATH_SEPARATOR + table + Arrays.toString(deviceId),
              true);
        }
      }
      cur = next;
    }
    return cur;
  }
Get node by the path

@return last node in given seriesPath
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java