message: fixed a bug in advance method
diff: #include "tx_join.hpp"
  #include "arrow/compute/api.h"
  #include <glog/logging.h>
  +#include <chrono>
  namespace twisterx::join {
  @@ -11,12 +12,18 @@ void advance(std::vector<CPP_KEY_TYPE> *subset,
  int64_t *current_index, //always int32_t
  std::shared_ptr<JOIN_COLUMN_ARRAY> data_column,
  CPP_KEY_TYPE *key) {
  + subset->clear();
  + if (*current_index == sorted_indices->length()) {
  + return;
  + }
  int64_t data_index = sorted_indices->Value(*current_index);
  *key = data_column->Value(data_index);
  - subset->clear();
  while (*current_index < sorted_indices->length() && data_column->Value(data_index) == *key) {
  subset->push_back(data_index);
  (*current_index)++;
  + if (*current_index == sorted_indices->length()) {
  + break;
  + }
  data_index = sorted_indices->Value(*current_index);
  }
  }
  @@ -34,19 +41,25 @@ void join(std::shared_ptr<arrow::Table> left_tab, std::shared_ptr<arrow::Table>
  auto right_join_column =
  std::static_pointer_cast<JOIN_COLUMN_ARRAY>(right_tab->column(right_join_column_idx)->chunk(0));
  + auto t1 = std::chrono::high_resolution_clock::now();
  arrow::compute::FunctionContext ctx_left;
  std::shared_ptr<arrow::Array> left_index_sorted_column;
  auto status = arrow::compute::SortToIndices(&ctx_left, *left_join_column, &left_index_sorted_column);
  if (status != arrow::Status::OK()) {
  // error
  }
  + auto t2 = std::chrono::high_resolution_clock::now();
  + LOG(INFO) << "left sorting time : " << std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
  + t1 = std::chrono::high_resolution_clock::now();
  arrow::compute::FunctionContext ctx;
  std::shared_ptr<arrow::Array> right_index_sorted_column;
  status = arrow::compute::SortToIndices(&ctx, *right_join_column, &right_index_sorted_column);
  if (status != arrow::Status::OK()) {
  // error
  }
  + t2 = std::chrono::high_resolution_clock::now();
  + LOG(INFO) << "right sorting time : " << std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
  // creating joined schema
  std::vector<std::shared_ptr<arrow::Field>> fields;
  @@ -60,6 +73,8 @@ void join(std::shared_ptr<arrow::Table> left_tab, std::shared_ptr<arrow::Table>
  std::unordered_map<int64_t, std::vector<int64_t >> join_relations;
  + t1 = std::chrono::high_resolution_clock::now();
  +
  advance<JOIN_COLUMN_ARRAY, ARROW_KEY_TYPE, CPP_KEY_TYPE>(&left_subset,
  std::static_pointer_cast<arrow::Int64Array>(
  left_index_sorted_column),
  @@ -113,7 +128,9 @@ void join(std::shared_ptr<arrow::Table> left_tab, std::shared_ptr<arrow::Table>
  &right_key);
  }
  }
  - LOG(INFO) << "done";
  + t2 = std::chrono::high_resolution_clock::now();
  + LOG(INFO) << "join only time : " << std::chrono::duration_cast<std::chrono::milliseconds>(t2 - t1).count();
  + LOG(INFO) << "done and produced : " << join_relations.size();
  }
  }
  \ No newline at end of file
  