OmniSciDB  ba1bac9284
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 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)
 
void generateNullValues (const std::vector< Frag > &fragments, std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array, const SQLTypeInfo &columnType)
 
template<typename T >
void setNullValues (const std::vector< Frag > &fragments, std::shared_ptr< arrow::ChunkedArray > arr_col_chunked_array)
 
template<typename T >
void setNulls (int8_t *data, int count)
 
void generateSentinelValues (int8_t *data, const SQLTypeInfo &columnType, size_t count)
 
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, bool is_empty)
 
- 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 738 of file ArrowForeignStorage.cpp.

Constructor & Destructor Documentation

ArrowForeignStorage::ArrowForeignStorage ( )
inline

Definition at line 740 of file ArrowForeignStorage.cpp.

740 {}

Member Function Documentation

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

Implements PersistentForeignStorageInterface.

Definition at line 846 of file ArrowForeignStorage.cpp.

References logger::INFO, and LOG.

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

Reimplemented from PersistentForeignStorageInterface.

Definition at line 822 of file ArrowForeignStorage.cpp.

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

825  {
826  td.hasDeletedCol = false;
827  this->name = name;
828  auto table = tables[name];
829  for (auto& field : table->schema()->fields()) {
830  ColumnDescriptor cd;
831  cd.columnName = field->name();
832  cd.columnType = getOmnisciType(*field->type());
833  cols.push_back(cd);
834  }
835 }
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:31
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 837 of file ArrowForeignStorage.cpp.

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

842  {
843  parseArrowTable(catalog, table_key, info, td, cols, mgr, *(tables[name].get()));
844 }
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 757 of file ArrowForeignStorage.cpp.

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


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