public Map<String, Integer> getColumnNameIndexMap() {
    if (columnToTsBlockIndexMap == null || columnToTsBlockIndexMap.isEmpty()) {
      return columnToTsBlockIndexMap;
    }

    if (columnNameIndexMap == null) {
      columnNameIndexMap = new HashMap<>();
      for (ColumnHeader columnHeader : columnHeaders) {
        columnNameIndexMap.put(
            columnHeader.getColumnNameWithAlias(),
            columnToTsBlockIndexMap.get(columnHeader.getColumnName()));
      }
    }
    return columnNameIndexMap;
  }
The header of query result dataset.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/common/header/DatasetHeader.java