OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShowRuntimeTableFunctionsCommand Class Reference

#include <DdlCommandExecutor.h>

+ Inheritance diagram for ShowRuntimeTableFunctionsCommand:
+ Collaboration diagram for ShowRuntimeTableFunctionsCommand:

Public Member Functions

 ShowRuntimeTableFunctionsCommand (const DdlCommandData &ddl_data, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr)
 
ExecutionResult execute (bool read_only_mode) override
 
- Public Member Functions inherited from DdlCommand
 DdlCommand (const DdlCommandData &ddl_data, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr)
 

Additional Inherited Members

- Protected Attributes inherited from DdlCommand
const DdlCommandDataddl_data_
 
std::shared_ptr
< Catalog_Namespace::SessionInfo
const > 
session_ptr_
 

Detailed Description

Definition at line 210 of file DdlCommandExecutor.h.

Constructor & Destructor Documentation

ShowRuntimeTableFunctionsCommand::ShowRuntimeTableFunctionsCommand ( const DdlCommandData ddl_data,
std::shared_ptr< Catalog_Namespace::SessionInfo const >  session_ptr 
)

Definition at line 1770 of file DdlCommandExecutor.cpp.

1773  : DdlCommand(ddl_data, session_ptr) {}
DdlCommand(const DdlCommandData &ddl_data, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr)

Member Function Documentation

ExecutionResult ShowRuntimeTableFunctionsCommand::execute ( bool  read_only_mode)
overridevirtual

Executes the DDL command corresponding to provided JSON payload.

Parameters
_returnresult of DDL command execution (if applicable)

Implements DdlCommand.

Definition at line 1775 of file DdlCommandExecutor.cpp.

References ResultSetLogicalValuesBuilder::create(), genLiteralStr(), table_functions::TableFunctionsFactory::get_table_funcs(), kTEXT, run_benchmark_import::label, and setup::name.

Referenced by heavydb.cursor.Cursor::executemany().

1775  {
1776  // valid in read_only_mode
1777 
1778  // Get all runtime table functions
1779  std::vector<TargetMetaInfo> label_infos;
1780  std::vector<RelLogicalValues::RowValues> logical_values;
1781 
1782  // label_infos -> column labels
1783  for (const auto& label : {"Runtime Table UDF"}) {
1784  label_infos.emplace_back(label, SQLTypeInfo(kTEXT, true));
1785  }
1786 
1787  // logical_values -> table data
1788  std::unordered_set<std::string> unique_names;
1789  for (auto tf :
1791  std::string name = tf.getName(true, true);
1792  if (unique_names.find(name) == unique_names.end()) {
1793  unique_names.emplace(name);
1794  logical_values.emplace_back(RelLogicalValues::RowValues{});
1795  logical_values.back().emplace_back(genLiteralStr(name));
1796  }
1797  }
1798 
1799  // Create ResultSet
1800  std::shared_ptr<ResultSet> rSet = std::shared_ptr<ResultSet>(
1801  ResultSetLogicalValuesBuilder::create(label_infos, logical_values));
1802 
1803  return ExecutionResult(rSet, label_infos);
1804 }
static std::vector< TableFunction > get_table_funcs()
static ResultSet * create(std::vector< TargetMetaInfo > &label_infos, std::vector< RelLogicalValues::RowValues > &logical_values)
Definition: sqltypes.h:66
static std::unique_ptr< RexLiteral > genLiteralStr(std::string val)
Definition: DBHandler.cpp:7263
std::vector< std::unique_ptr< const RexScalar >> RowValues
Definition: RelAlgDag.h:2226
string name
Definition: setup.in.py:72

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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