OmniSciDB  06b3bd477c
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JoinHashTableInterface.h File Reference
#include <llvm/IR/Value.h>
#include <cstdint>
#include <set>
#include <string>
#include "Analyzer/Analyzer.h"
#include "ColumnarResults.h"
#include "CompilationOptions.h"
#include "DataMgr/Allocators/ThrustAllocator.h"
#include "Descriptors/RowSetMemoryOwner.h"
#include "HashJoinRuntime.h"
+ Include dependency graph for JoinHashTableInterface.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TooManyHashEntries
 
class  TableMustBeReplicated
 
class  HashJoinFail
 
class  FailedToFetchColumn
 
class  FailedToJoinOnVirtualColumn
 
struct  HashJoinMatchingSet
 
struct  DecodedJoinHashBufferEntry
 
class  JoinHashTableInterface
 

Typedefs

using DecodedJoinHashBufferSet = std::set< DecodedJoinHashBufferEntry >
 
using InnerOuter = std::pair< const Analyzer::ColumnVar *, const Analyzer::Expr * >
 

Functions

std::ostream & operator<< (std::ostream &os, const DecodedJoinHashBufferEntry &e)
 
std::ostream & operator<< (std::ostream &os, const DecodedJoinHashBufferSet &s)
 
std::shared_ptr
< Analyzer::ColumnVar
getSyntheticColumnVar (std::string_view table, std::string_view column, int rte_idx, Executor *executor)
 

Typedef Documentation

Definition at line 78 of file JoinHashTableInterface.h.

using InnerOuter = std::pair<const Analyzer::ColumnVar*, const Analyzer::Expr*>

Definition at line 80 of file JoinHashTableInterface.h.

Function Documentation

std::shared_ptr<Analyzer::ColumnVar> getSyntheticColumnVar ( std::string_view  table,
std::string_view  column,
int  rte_idx,
Executor executor 
)

Definition at line 547 of file JoinHashTableInterface.cpp.

References CHECK(), kLINESTRING, kMULTIPOLYGON, kPOINT, and kPOLYGON.

Referenced by JoinHashTableInterface::getSyntheticInstance().

550  {
551  auto catalog = executor->getCatalog();
552  CHECK(catalog);
553 
554  auto tmeta = catalog->getMetadataForTable(std::string(table));
555  CHECK(tmeta);
556 
557  auto cmeta = catalog->getMetadataForColumn(tmeta->tableId, std::string(column));
558  CHECK(cmeta);
559 
560  auto ti = cmeta->columnType;
561 
562  if (ti.is_geometry() && ti.get_type() != kPOINT) {
563  int geoColumnId{0};
564  switch (ti.get_type()) {
565  case kLINESTRING: {
566  geoColumnId = cmeta->columnId + 2;
567  break;
568  }
569  case kPOLYGON: {
570  geoColumnId = cmeta->columnId + 3;
571  break;
572  }
573  case kMULTIPOLYGON: {
574  geoColumnId = cmeta->columnId + 4;
575  break;
576  }
577  default:
578  CHECK(false);
579  }
580  cmeta = catalog->getMetadataForColumn(tmeta->tableId, geoColumnId);
581  CHECK(cmeta);
582  ti = cmeta->columnType;
583  }
584 
585  auto cv =
586  std::make_shared<Analyzer::ColumnVar>(ti, tmeta->tableId, cmeta->columnId, rte_idx);
587  return cv;
588 }
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::ostream& operator<< ( std::ostream &  os,
const DecodedJoinHashBufferEntry e 
)

Definition at line 254 of file JoinHashTableInterface.cpp.

References DecodedJoinHashBufferEntry::key, and DecodedJoinHashBufferEntry::payload.

254  {
255  os << " {{";
256  bool first = true;
257  for (auto k : e.key) {
258  if (!first) {
259  os << ",";
260  } else {
261  first = false;
262  }
263  os << k;
264  }
265  os << "}, ";
266  os << "{";
267  first = true;
268  for (auto p : e.payload) {
269  if (!first) {
270  os << ", ";
271  } else {
272  first = false;
273  }
274  os << p;
275  }
276  os << "}}";
277  return os;
278 }
std::set< int32_t > payload
std::vector< int64_t > key
std::ostream& operator<< ( std::ostream &  os,
const DecodedJoinHashBufferSet s 
)

Definition at line 280 of file JoinHashTableInterface.cpp.

280  {
281  os << "{\n";
282  bool first = true;
283  for (auto e : s) {
284  if (!first) {
285  os << ",\n";
286  } else {
287  first = false;
288  }
289  os << e;
290  }
291  if (!s.empty()) {
292  os << "\n";
293  }
294  os << "}\n";
295  return os;
296 }