OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParserNode.cpp File Reference

Functions for ParserNode classes. More...

#include "ParserNode.h"
#include "Shared/base64.h"
#include <boost/algorithm/string.hpp>
#include <boost/core/null_deleter.hpp>
#include <boost/filesystem.hpp>
#include <boost/function.hpp>
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>
#include <rapidjson/writer.h>
#include <cassert>
#include <cmath>
#include <limits>
#include <random>
#include <regex>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <typeinfo>
#include "Analyzer/RangeTableEntry.h"
#include "Catalog/Catalog.h"
#include "Catalog/DataframeTableDescriptor.h"
#include "Catalog/SharedDictionaryValidator.h"
#include "DataMgr/FileMgr/FileBuffer.h"
#include "Fragmenter/InsertOrderFragmenter.h"
#include "Fragmenter/SortedOrderFragmenter.h"
#include "Fragmenter/TargetValueConvertersFactories.h"
#include "Geospatial/Compression.h"
#include "Geospatial/GeosValidation.h"
#include "Geospatial/Types.h"
#include "ImportExport/ForeignDataImporter.h"
#include "ImportExport/Importer.h"
#include "LockMgr/LockMgr.h"
#include "QueryEngine/CalciteAdapter.h"
#include "QueryEngine/CalciteDeserializerUtils.h"
#include "QueryEngine/ErrorHandling.h"
#include "QueryEngine/Execute.h"
#include "QueryEngine/ExtensionFunctionsWhitelist.h"
#include "QueryEngine/JsonAccessors.h"
#include "QueryEngine/RelAlgExecutor.h"
#include "QueryEngine/TableFunctions/SystemFunctions/os/ML/MLModel.h"
#include "QueryEngine/TableOptimizer.h"
#include "ReservedKeywords.h"
#include "Shared/DbObjectKeys.h"
#include "Shared/StringTransform.h"
#include "Shared/SysDefinitions.h"
#include "Shared/measure.h"
#include "Shared/shard_key.h"
#include "TableArchiver/TableArchiver.h"
#include "Utils/FsiUtils.h"
#include "gen-cpp/CalciteServer.h"

Go to the source code of this file.

Namespaces

 Parser
 
 Parser::anonymous_namespace{ParserNode.cpp}
 
 Parser::Compress
 

Typedefs

using TableDefFuncPtr = boost::function< void(TableDescriptor &, const Parser::NameValueAssign *, const std::list< ColumnDescriptor > &columns)>
 
using DataframeDefFuncPtr = boost::function< void(DataframeTableDescriptor &, const Parser::NameValueAssign *, const std::list< ColumnDescriptor > &columns)>
 
using Parser::SubstituteMap = std::map< std::string, std::string >
 

Functions

bool Parser::check_session_interrupted (const QuerySessionId &query_session, Executor *executor)
 
std::vector< int > Parser::getTableChunkKey (const TableDescriptor *td, Catalog_Namespace::Catalog &catalog)
 
bool Parser::should_translate_strings (const std::shared_ptr< Analyzer::Expr > &lhs_expr, const std::shared_ptr< Analyzer::Expr > &rhs_expr)
 
SQLTypeInfo const & Parser::get_str_dict_cast_type (const SQLTypeInfo &lhs_type_info, const SQLTypeInfo &rhs_type_info, const Executor *executor)
 
SQLTypeInfo Parser::common_string_type (const SQLTypeInfo &lhs_type_info, const SQLTypeInfo &rhs_type_info, const Executor *executor)
 
bool Parser::anonymous_namespace{ParserNode.cpp}::bool_from_string_literal (const Parser::StringLiteral *str_literal)
 
void Parser::anonymous_namespace{ParserNode.cpp}::parse_copy_params (const std::list< std::unique_ptr< NameValueAssign >> &options_, import_export::CopyParams &copy_params, std::vector< std::string > &warnings, std::string &deferred_copy_from_partitions_)
 
bool Parser::anonymous_namespace{ParserNode.cpp}::expr_is_null (const Analyzer::Expr *expr)
 
std::string Parser::anonymous_namespace{ParserNode.cpp}::unescape (std::string s)
 
void Parser::anonymous_namespace{ParserNode.cpp}::parse_options (const rapidjson::Value &payload, std::list< std::unique_ptr< NameValueAssign >> &nameValueList, bool stringToNull=false, bool stringToInteger=false)
 
Literal * Parser::anonymous_namespace{ParserNode.cpp}::parse_insert_literal (const rapidjson::Value &literal)
 
ArrayLiteral * Parser::anonymous_namespace{ParserNode.cpp}::parse_insert_array_literal (const rapidjson::Value &array)
 
void Parser::anonymous_namespace{ParserNode.cpp}::validate_shard_column_type (const ColumnDescriptor &cd)
 
size_t Parser::anonymous_namespace{ParserNode.cpp}::shard_column_index (const std::string &name, const std::list< ColumnDescriptor > &columns)
 
size_t Parser::anonymous_namespace{ParserNode.cpp}::sort_column_index (const std::string &name, const std::list< ColumnDescriptor > &columns)
 
void Parser::anonymous_namespace{ParserNode.cpp}::set_string_field (rapidjson::Value &obj, const std::string &field_name, const std::string &field_value, rapidjson::Document &document)
 
std::string Parser::anonymous_namespace{ParserNode.cpp}::serialize_key_metainfo (const ShardKeyDef *shard_key_def, const std::vector< SharedDictionaryDef > &shared_dict_defs)
 
template<typename LITERAL_TYPE , typename ASSIGNMENT , typename VALIDATE = DefaultValidate<LITERAL_TYPE>>
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_property_value (const NameValueAssign *p, ASSIGNMENT op, VALIDATE validate=VALIDATE())
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_storage_type (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_frag_size_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_frag_size_dataframe_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_chunk_size_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_chunk_size_dataframe_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_delimiter_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_header_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_page_size_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_rows_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_skip_rows_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_partions_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_shard_count_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_vacuum_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_sort_column_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_rollback_epochs_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
void Parser::anonymous_namespace{ParserNode.cpp}::get_table_definitions (TableDescriptor &td, const std::unique_ptr< NameValueAssign > &p, const std::list< ColumnDescriptor > &columns)
 
void Parser::anonymous_namespace{ParserNode.cpp}::get_table_definitions_for_ctas (TableDescriptor &td, const std::unique_ptr< NameValueAssign > &p, const std::list< ColumnDescriptor > &columns)
 
void Parser::anonymous_namespace{ParserNode.cpp}::get_dataframe_definitions (DataframeTableDescriptor &df_td, const std::unique_ptr< NameValueAssign > &p, const std::list< ColumnDescriptor > &columns)
 
void Parser::anonymous_namespace{ParserNode.cpp}::parse_elements (const rapidjson::Value &payload, std::string element_name, std::string &table_name, std::list< std::unique_ptr< TableElement >> &table_element_list)
 
std::unique_ptr< ColumnDef > Parser::column_from_json (const rapidjson::Value &element)
 
std::list< ColumnDef > Parser::get_columns_from_json_payload (const std::string &payload_key, const rapidjson::Value &payload)
 
std::string Parser::write_model_params_to_json (const std::string &predicted, const std::vector< std::string > &features, const std::string &training_query, const double data_split_train_fraction, const double data_split_eval_fraction, const std::vector< int64_t > &feature_permutations)
 
std::shared_ptr< ResultSetParser::getResultSet (QueryStateProxy query_state_proxy, const std::string select_stmt, std::vector< TargetMetaInfo > &targets, bool validate_only=false, std::vector< size_t > outer_fragment_indices={}, bool allow_interrupt=false)
 
shared::TableKey Parser::anonymous_namespace{ParserNode.cpp}::get_table_key (const std::vector< std::string > &table)
 
lockmgr::LockedTableDescriptors Parser::anonymous_namespace{ParserNode.cpp}::acquire_query_table_locks (const std::string &insert_table_db_name, const std::string &query_str, const QueryStateProxy &query_state_proxy, const std::optional< std::string > &insert_table_name={})
 
bool Parser::anonymous_namespace{ParserNode.cpp}::user_can_access_table (const Catalog_Namespace::SessionInfo &session_info, const TableDescriptor *td, const AccessPrivileges access_priv)
 
bool Parser::repair_type (std::list< std::unique_ptr< NameValueAssign >> &options)
 
void Parser::check_alter_table_privilege (const Catalog_Namespace::SessionInfo &session, const TableDescriptor *td)
 
std::string Parser::anonymous_namespace{ParserNode.cpp}::generateUniqueTableName (std::string name)
 
void Parser::anonymous_namespace{ParserNode.cpp}::recordRename (SubstituteMap &sMap, std::string oldName, std::string newName)
 
std::string Parser::anonymous_namespace{ParserNode.cpp}::loadTable (Catalog_Namespace::Catalog &catalog, SubstituteMap &sMap, std::string tableName)
 
bool Parser::anonymous_namespace{ParserNode.cpp}::hasData (SubstituteMap &sMap, std::string tableName)
 
void Parser::anonymous_namespace{ParserNode.cpp}::checkNameSubstition (SubstituteMap &sMap)
 
void Parser::anonymous_namespace{ParserNode.cpp}::disable_foreign_tables (const TableDescriptor *td)
 
void Parser::set_column_descriptor (ColumnDescriptor &cd, const ColumnDef *coldef)
 
std::vector< std::string > Parser::splitObjectHierName (const std::string &hierName)
 
std::string Parser::extractObjectNameFromHierName (const std::string &objectHierName, const std::string &objectType, const Catalog_Namespace::Catalog &cat)
 
static std::pair
< AccessPrivileges,
DBObjectType
Parser::parseStringPrivs (const std::string &privs, const DBObjectType &objectType, const std::string &object_name)
 
static DBObject Parser::createObject (const std::string &objectName, DBObjectType objectType)
 
static void Parser::verifyObject (Catalog_Namespace::Catalog &sessionCatalog, const std::string &objectName, DBObjectType objectType, const std::string &command)
 
static void Parser::checkStringLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p)
 
static bool Parser::readBooleanLiteral (const std::string &option_name, const std::unique_ptr< NameValueAssign > &p)
 
std::optional< std::string > Parser::anonymous_namespace{ParserNode.cpp}::get_string_option (const NameValueAssign *option, const std::string &option_name)
 
std::unique_ptr< Parser::StmtParser::create_stmt_for_query (const std::string &queryStr, const Catalog_Namespace::SessionInfo &session_info)
 
std::unique_ptr< Parser::StmtParser::create_stmt_for_json (const std::string &query_json)
 
void Parser::execute_stmt_for_json (const std::string &query_json, std::shared_ptr< Catalog_Namespace::SessionInfo const > session_ptr, bool read_only_mode)
 
int32_t Parser::validate_and_get_fragment_size (const std::string &fragment_size_str)
 

Variables

size_t g_leaf_count {0}
 
bool g_test_drop_column_rollback {false}
 
bool g_enable_string_functions
 
bool g_enable_fsi
 
bool g_enable_legacy_delimited_import {true}
 
bool g_enable_fsi_regex_import {true}
 
bool g_enable_add_metadata_columns {true}
 
bool g_enable_ml_functions
 
static const std::map< const
std::string, const
TableDefFuncPtr
Parser::anonymous_namespace{ParserNode.cpp}::tableDefFuncMap
 
static const std::map< const
std::string, const
DataframeDefFuncPtr
Parser::anonymous_namespace{ParserNode.cpp}::dataframeDefFuncMap
 
static constexpr char const * Parser::anonymous_namespace{ParserNode.cpp}::EMPTY_NAME {""}
 
const std::string Parser::Compress::sGZIP = "gzip"
 
const std::string Parser::Compress::sUNGZIP = "gunzip"
 
const std::string Parser::Compress::sLZ4 = "lz4"
 
const std::string Parser::Compress::sUNLZ4 = "unlz4"
 
const std::string Parser::Compress::sNONE = "none"
 

Detailed Description

Functions for ParserNode classes.

Definition in file ParserNode.cpp.

Typedef Documentation

using DataframeDefFuncPtr = boost::function<void(DataframeTableDescriptor&, const Parser::NameValueAssign*, const std::list<ColumnDescriptor>& columns)>

Definition at line 104 of file ParserNode.cpp.

using TableDefFuncPtr = boost::function<void(TableDescriptor&, const Parser::NameValueAssign*, const std::list<ColumnDescriptor>& columns)>

Definition at line 99 of file ParserNode.cpp.

Variable Documentation

bool g_enable_add_metadata_columns {true}
bool g_enable_fsi

Definition at line 96 of file Catalog.cpp.

bool g_enable_fsi_regex_import {true}
bool g_enable_legacy_delimited_import {true}
bool g_enable_ml_functions

Definition at line 122 of file Execute.cpp.

bool g_enable_string_functions

Definition at line 43 of file RelAlgTranslator.cpp.

bool g_test_drop_column_rollback {false}

Definition at line 80 of file ParserNode.cpp.

Referenced by Parser::DropColumnStmt::execute().