OmniSciDB  72c90bc290
 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 263 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 2012 of file DdlCommandExecutor.cpp.

2015  : 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 2017 of file DdlCommandExecutor.cpp.

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

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

2017  {
2018  auto execute_read_lock = legacylockmgr::getExecuteReadLock();
2019 
2020  // valid in read_only_mode
2021 
2022  // Get all runtime table functions
2023  std::vector<TargetMetaInfo> label_infos;
2024  std::vector<RelLogicalValues::RowValues> logical_values;
2025 
2026  // label_infos -> column labels
2027  for (const auto& label : {"Runtime Table UDF"}) {
2028  label_infos.emplace_back(label, SQLTypeInfo(kTEXT, true));
2029  }
2030 
2031  // logical_values -> table data
2032  std::unordered_set<std::string> unique_names;
2033  for (auto tf :
2035  std::string name = tf.getName(true, true);
2036  if (unique_names.find(name) == unique_names.end()) {
2037  unique_names.emplace(name);
2038  logical_values.emplace_back(RelLogicalValues::RowValues{});
2039  logical_values.back().emplace_back(genLiteralStr(name));
2040  }
2041  }
2042 
2043  // Create ResultSet
2044  std::shared_ptr<ResultSet> rSet = std::shared_ptr<ResultSet>(
2045  ResultSetLogicalValuesBuilder::create(label_infos, logical_values));
2046 
2047  return ExecutionResult(rSet, label_infos);
2048 }
static std::vector< TableFunction > get_table_funcs()
auto getExecuteReadLock()
static ResultSet * create(std::vector< TargetMetaInfo > &label_infos, std::vector< RelLogicalValues::RowValues > &logical_values)
Definition: sqltypes.h:79
static std::unique_ptr< RexLiteral > genLiteralStr(std::string val)
Definition: DBHandler.cpp:7752
std::vector< std::unique_ptr< const RexScalar >> RowValues
Definition: RelAlgDag.h:2656
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: