OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArrowForeignStorage Class Reference
+ Inheritance diagram for ArrowForeignStorage:
+ Collaboration diagram for ArrowForeignStorage:

Public Member Functions

 ArrowForeignStorage ()
 
void prepareTable (const int db_id, const std::string &type, TableDescriptor &td, std::list< ColumnDescriptor > &cols) override
 
void registerTable (Catalog_Namespace::Catalog *catalog, std::pair< int, int > table_key, const std::string &type, const TableDescriptor &td, const std::list< ColumnDescriptor > &cols, Data_Namespace::AbstractBufferMgr *mgr) override
 
std::string getType () const override
 
- Public Member Functions inherited from ArrowForeignStorageBase
void append (const std::vector< ForeignStorageColumnBuffer > &column_buffers) override
 
void read (const ChunkKey &chunk_key, const SQLTypeInfo &sql_type, int8_t *dest, const size_t numBytes) override
 
int8_t * tryZeroCopy (const ChunkKey &chunk_key, const SQLTypeInfo &sql_type, const size_t numBytes) override
 
void dropTable (const int db_id, const int table_id) override
 
void parseArrowTable (Catalog_Namespace::Catalog *catalog, std::pair< int, int > table_key, const std::string &type, const TableDescriptor &td, const std::list< ColumnDescriptor > &cols, Data_Namespace::AbstractBufferMgr *mgr, const arrow::Table &table)
 
std::shared_ptr
< arrow::ChunkedArray > 
createDictionaryEncodedColumn (StringDictionary *dict, const ColumnDescriptor &c, std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array)
 
std::shared_ptr
< arrow::ChunkedArray > 
convertArrowDictionary (StringDictionary *dict, const ColumnDescriptor &c, std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array)
 
template<typename T , typename ChunkType >
std::shared_ptr
< arrow::ChunkedArray > 
createDecimalColumn (const ColumnDescriptor &c, std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array)
 
std::shared_ptr
< arrow::ChunkedArray > 
replaceNullValues (const SQLTypeInfo &columnType, std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array)
 
template<typename T >
std::shared_ptr
< arrow::ChunkedArray > 
replaceNullValuesImpl (std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array)
 
void getSizeAndOffset (const Frag &frag, const std::shared_ptr< arrow::Array > &chunk, size_t i, int &size, int &offset)
 
int64_t makeFragment (const Frag &frag, ArrowFragment &arrowFrag, const std::vector< std::shared_ptr< arrow::Array >> &chunks, bool is_varlen)
 
- Public Member Functions inherited from PersistentForeignStorageInterface
virtual ~PersistentForeignStorageInterface ()
 

Public Attributes

std::string name
 
- Public Attributes inherited from ArrowForeignStorageBase
std::map< std::array< int, 3 >
, std::vector< ArrowFragment > > 
m_columns
 

Static Public Attributes

static std::map< std::string,
std::shared_ptr< arrow::Table > > 
tables
 

Detailed Description

Definition at line 768 of file ArrowForeignStorage.cpp.

Constructor & Destructor Documentation

ArrowForeignStorage::ArrowForeignStorage ( )
inline

Definition at line 770 of file ArrowForeignStorage.cpp.

770 {}

Member Function Documentation

std::string ArrowForeignStorage::getType ( ) const
overridevirtual

Implements PersistentForeignStorageInterface.

Definition at line 879 of file ArrowForeignStorage.cpp.

References logger::INFO, and LOG.

879  {
880  LOG(INFO) << "CSV backed temporary tables has been activated. Create table `with "
881  "(storage_type='CSV:path/to/file.csv');`\n";
882  return "ARROW";
883 }
#define LOG(tag)
Definition: Logger.h:285
void ArrowForeignStorage::prepareTable ( const int  db_id,
const std::string &  type,
TableDescriptor td,
std::list< ColumnDescriptor > &  cols 
)
overridevirtual

Reimplemented from PersistentForeignStorageInterface.

Definition at line 855 of file ArrowForeignStorage.cpp.

References ColumnDescriptor::columnName, ColumnDescriptor::columnType, field(), getOmnisciType(), TableDescriptor::hasDeletedCol, name, and tables.

858  {
859  td.hasDeletedCol = false;
860  this->name = name;
861  auto table = tables[name];
862  for (auto& field : table->schema()->fields()) {
863  ColumnDescriptor cd;
864  cd.columnName = field->name();
865  cd.columnType = getOmnisciType(*field->type());
866  cols.push_back(cd);
867  }
868 }
static SQLTypeInfo getOmnisciType(const arrow::DataType &type)
static std::map< std::string, std::shared_ptr< arrow::Table > > tables
const rapidjson::Value & field(const rapidjson::Value &obj, const char field[]) noexcept
Definition: JsonAccessors.h:33
specifies the content in-memory of a row in the column metadata table
SQLTypeInfo columnType
std::string columnName

+ Here is the call graph for this function:

void ArrowForeignStorage::registerTable ( Catalog_Namespace::Catalog catalog,
std::pair< int, int >  table_key,
const std::string &  type,
const TableDescriptor td,
const std::list< ColumnDescriptor > &  cols,
Data_Namespace::AbstractBufferMgr *  mgr 
)
overridevirtual

Implements PersistentForeignStorageInterface.

Definition at line 870 of file ArrowForeignStorage.cpp.

References name, ArrowForeignStorageBase::parseArrowTable(), and tables.

875  {
876  parseArrowTable(catalog, table_key, info, td, cols, mgr, *(tables[name].get()));
877 }
static std::map< std::string, std::shared_ptr< arrow::Table > > tables
void parseArrowTable(Catalog_Namespace::Catalog *catalog, std::pair< int, int > table_key, const std::string &type, const TableDescriptor &td, const std::list< ColumnDescriptor > &cols, Data_Namespace::AbstractBufferMgr *mgr, const arrow::Table &table)

+ Here is the call graph for this function:

Member Data Documentation

std::map< std::string, std::shared_ptr< arrow::Table > > ArrowForeignStorage::tables
static
Initial value:
=
std::map<std::string, std::shared_ptr<arrow::Table>>()

Definition at line 787 of file ArrowForeignStorage.cpp.

Referenced by prepareTable(), registerTable(), releaseArrowTable(), and setArrowTable().


The documentation for this class was generated from the following file: