OmniSciDB  ca0c39ec8f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringTransform.h File Reference
#include <boost/config.hpp>
#include <optional>
#include <string_view>
#include "Shared/clean_boost_regex.hpp"
#include <algorithm>
#include <iomanip>
#include <sstream>
#include <string>
#include <vector>
+ Include dependency graph for StringTransform.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 anonymous_namespace{StringTransform.h}
 

Functions

void apply_shim (std::string &result, const boost::regex &reg_expr, const std::function< void(std::string &, const boost::smatch &)> &shim_fn)
 
template<typename... Ts>
std::string cat (Ts &&...args)
 
std::vector< std::pair< size_t,
size_t > > 
find_string_literals (const std::string &query)
 
std::string hide_sensitive_data_from_query (std::string const &query_str)
 
std::optional< size_t > inside_string_literal (const size_t start, const size_t length, const std::vector< std::pair< size_t, size_t >> &literal_positions)
 
template<typename T >
std::string join (T const &container, std::string const &delim)
 
template<typename T >
std::string to_string (T &&v)
 
template<>
std::string to_string (char const *&&v)
 
template<>
std::string to_string (std::string &&v)
 
std::string to_upper (const std::string &str)
 
std::string to_lower (const std::string &str)
 
std::string generate_random_string (const size_t len)
 
std::vector< std::string > split (std::string_view str, std::string_view delim={}, std::optional< size_t > maxsplit=std::nullopt)
 split apart a string into a vector of substrings More...
 
std::string_view sv_strip (std::string_view str)
 return trimmed string_view More...
 
std::string strip (std::string_view str)
 trim any whitespace from the left and right ends of a string More...
 
std::pair< std::string_view,
const char * > 
substring (const std::string &str, size_t substr_length)
 return substring of str with postfix if str.size() > substr_length More...
 
bool remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string (std::string &str) noexcept
 sanitize an SQL string More...
 
std::string simple_sanitize (const std::string &str)
 simple sanitize string (replace control characters with space) More...
 
std::string get_quoted_string (const std::string &filename, char quote= '"', char escape = '\\')
 Quote a string while escaping any existing quotes in the string. More...
 
template<typename T >
decltype(auto) anonymous_namespace{StringTransform.h}::stringlike (T &&parm)
 
template<typename... Types>
std::string concat (Types &&...parms)
 
template<typename... Types>
std::string concat_with (std::string_view with, Types &&...parms)
 

Function Documentation

void apply_shim ( std::string &  result,
const boost::regex &  reg_expr,
const std::function< void(std::string &, const boost::smatch &)> &  shim_fn 
)

Definition at line 32 of file StringTransform.cpp.

References find_string_literals(), and inside_string_literal().

Referenced by anonymous_namespace{CalciteAdapter.cpp}::pg_shim_impl().

34  {
35  boost::smatch what;
36  std::vector<std::pair<size_t, size_t>> lit_pos = find_string_literals(result);
37  auto start_it = result.cbegin();
38  auto end_it = result.cend();
39  while (true) {
40  if (!boost::regex_search(start_it, end_it, what, reg_expr)) {
41  break;
42  }
43  const auto next_start =
44  inside_string_literal(what.position(), what.length(), lit_pos);
45  if (next_start) {
46  start_it = result.cbegin() + *next_start;
47  } else {
48  shim_fn(result, what);
49  lit_pos = find_string_literals(result);
50  start_it = result.cbegin();
51  end_it = result.cend();
52  }
53  }
54 }
std::vector< std::pair< size_t, size_t > > find_string_literals(const std::string &query)
std::optional< size_t > inside_string_literal(const size_t start, const size_t length, const std::vector< std::pair< size_t, size_t >> &literal_positions)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename... Ts>
std::string cat ( Ts &&...  args)

Definition at line 41 of file StringTransform.h.

References run_benchmark_import::args.

Referenced by CachedSessionStore::add(), AlterForeignTableCommand::alterOptions(), Catalog_Namespace::SysCatalog::changeDatabaseOwner(), AlterForeignServerCommand::changeForeignServerOwner(), DBHandler::check_table_load_privileges(), Catalog_Namespace::SessionInfo::checkDBAccessPrivileges(), DBHandler::checkpoint(), DBHandler::clone_session(), anonymous_namespace{InputMetadata.cpp}::collect_table_infos(), QueryCompilationDescriptor::compile(), DBHandler::connect(), Fragmenter_Namespace::copyDataOfShard(), DBHandler::create_dashboard(), DBHandler::create_link(), Parser::create_stmt_for_query(), Catalog_Namespace::SysCatalog::createDatabase(), QueryRunner::QueryRunner::createStatement(), dateTimeParse(), DBHandler::delete_dashboards(), anonymous_namespace{RelAlgExecutor.cpp}::do_table_reordering(), Catalog_Namespace::SysCatalog::dropDatabase(), ShowUserDetailsCommand::execute(), RefreshForeignTablesCommand::execute(), DBHandler::execute_rel_alg(), anonymous_namespace{GroupByAndAggregate.cpp}::expr_is_rowid(), Executor::fetchChunks(), Executor::fetchUnionChunks(), ColumnFetcher::freeLinearizedBuf(), ColumnFetcher::freeTemporaryCpuLinearizedIdxBuf(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), DBHandler::get_dashboard_impl(), DBHandler::get_dashboards(), DBHandler::get_db_object_privs(), anonymous_namespace{FromTableReordering.cpp}::get_join_qual_cost(), DBHandler::get_link_view(), DBHandler::get_table_details_impl(), DBHandler::get_table_epoch(), DBHandler::get_table_epoch_by_name(), DBHandler::get_table_epochs(), DBHandler::get_tables_meta_impl(), DBHandler::get_valid_groups(), QueryRunner::QueryRunner::getCalcitePlan(), Catalog_Namespace::SysCatalog::getCatalog(), lockmgr::TableLockMgrImpl< TableDataLockMgr >::getClusterTableMutex(), Calcite::getCompletionHints(), RangeJoinHashTable::getInstance(), QueryRunner::QueryRunner::getLoader(), ColumnFetcher::getOneTableColumnFragment(), QueryRunner::QueryRunner::getParsedGlobalQueryHints(), QueryRunner::QueryRunner::getParsedQueryHint(), QueryRunner::QueryRunner::getParsedQueryHints(), QueryRunner::QueryRunner::getQueryInfoForDataRecyclerTest(), QueryRunner::QueryRunner::getRaExecutionSequence(), QueryRunner::QueryRunner::getRelAlgTranslator(), QueryRunner::QueryRunner::getRootNodeFromParsedQuery(), InputTableInfoCache::getTableInfo(), DBHandler::has_object_privilege(), DBHandler::hasTableAccessPrivileges(), DBHandler::import_table(), import_export::Importer::importDelimited(), import_export::Importer::importGDALGeo(), QueryRunner::ImportDriver::importGeoTable(), DBHandler::importGeoTableSingle(), DBHandler::insert_chunks(), DBHandler::insert_data(), Fragmenter_Namespace::InsertDataLoader::insertChunks(), Fragmenter_Namespace::InsertDataLoader::insertData(), DBHandler::internal_connect(), DBHandler::interrupt(), ColumnFetcher::linearizeColumnFragments(), migrations::MigrationMgr::migrateDateInDaysMetadata(), HashJoin::normalizeColumnPair(), HashJoin::normalizeColumnPairs(), DBHandler::parse_to_ra(), DBHandler::prepare_loader_generic(), Calcite::processImpl(), QueryRunner::QueryRunner::QueryRunner(), AlterForeignTableCommand::renameColumn(), AlterForeignServerCommand::renameForeignServer(), AlterForeignTableCommand::renameTable(), DBHandler::replace_dashboard(), rewrite_overlaps_conjunction(), QueryRewriter::rewriteColumnarUpdate(), QueryRunner::anonymous_namespace{QueryRunner.cpp}::run_select_query_with_filter_push_down(), QueryRunner::QueryRunner::runDDLStatement(), QueryRunner::QueryRunner::runSelectQuery(), QueryRunner::QueryRunner::runSQLWithAllowingInterrupt(), DBHandler::set_table_epoch(), DBHandler::set_table_epoch_by_name(), DBHandler::set_table_epochs(), AlterForeignServerCommand::setForeignServerDataWrapper(), AlterForeignServerCommand::setForeignServerOptions(), DBHandler::sql_execute_impl(), DBHandler::switch_database(), Catalog_Namespace::SysCatalog::switchDatabase(), anonymous_namespace{QueryMemoryDescriptor.cpp}::target_expr_proj_indices(), RexAbstractInput::toString(), RexOperator::toString(), RexSubQuery::toString(), RexInput::toString(), RexCase::toString(), RexFunctionOperator::toString(), SortField::toString(), RexWindowFunctionOperator::toString(), RexRef::toString(), RexAgg::toString(), RelScan::toString(), RelProject::toString(), RelAggregate::toString(), RelJoin::toString(), RelTranslatedJoin::toString(), RelFilter::toString(), RelCompound::toString(), RelSort::toString(), RelModify::toString(), RelTableFunction::toString(), RelLogicalUnion::toString(), anonymous_namespace{RelAlgExecutor.cpp}::translate_scalar_sources_for_update(), DateTimeParser::updateDateTimeAndStr(), DBHandler::user_can_access_table(), Parser::anonymous_namespace{ParserNode.cpp}::user_can_access_table(), DBHandler::validateDashboardIdsForSharing(), and QueryRunner::QueryRunner::validateDDLStatement().

41  {
42  std::ostringstream oss;
43  (oss << ... << std::forward<Ts>(args));
44  return oss.str();
45 }
template<typename... Types>
std::string concat ( Types &&...  parms)

Definition at line 180 of file StringTransform.h.

References File_Namespace::append(), and anonymous_namespace{StringTransform.h}::stringlike().

180  {
181  struct Joiner {
182  Joiner() {}
183 
184  std::string txt;
185 
186  void append(std::string_view moretxt) { txt += moretxt; }
187  }; // struct Joiner
188  Joiner j{};
189  (j.append(stringlike(std::forward<Types>(parms))), ...);
190  return std::move(j.txt);
191 }
size_t append(FILE *f, const size_t size, const int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
Definition: File.cpp:168

+ Here is the call graph for this function:

template<typename... Types>
std::string concat_with ( std::string_view  with,
Types &&...  parms 
)

Definition at line 194 of file StringTransform.h.

References File_Namespace::append(), join(), and anonymous_namespace{StringTransform.h}::stringlike().

194  {
195  struct JoinerWith {
196  JoinerWith(std::string_view join) : join(join), first(true) {}
197 
198  std::string_view join;
199  bool first;
200  std::string txt;
201 
202  void append(std::string_view moretxt) {
203  if (!first) {
204  txt += join;
205  } else {
206  first = false;
207  }
208  txt += moretxt;
209  }
210  }; // struct JoinerWith
211  JoinerWith j{with};
212  (j.append(stringlike(std::forward<Types>(parms))), ...);
213  return std::move(j.txt);
214 }
size_t append(FILE *f, const size_t size, const int8_t *buf)
Appends the specified number of bytes to the end of the file f from buf.
Definition: File.cpp:168
std::string join(T const &container, std::string const &delim)
bool g_enable_smem_group_by true

+ Here is the call graph for this function:

std::vector<std::pair<size_t, size_t> > find_string_literals ( const std::string &  query)

Definition at line 56 of file StringTransform.cpp.

References CHECK_GT, LOG, and logger::WARNING.

Referenced by apply_shim().

56  {
57  boost::regex literal_string_regex{R"(([^']+)('(?:[^']+|'')+'))", boost::regex::perl};
58  boost::smatch what;
59  auto it = query.begin();
60  auto prev_it = it;
61  std::vector<std::pair<size_t, size_t>> positions;
62  while (true) {
63  try {
64  if (!boost::regex_search(it, query.end(), what, literal_string_regex)) {
65  break;
66  }
67  } catch (const std::exception& e) {
68  LOG(WARNING) << "Error processing literals: " << e.what()
69  << "\nContinuing query parse...";
70  // boost::regex throws an exception about the complexity of matching when
71  // the wrong type of quotes are used or they're mismatched. Let the query
72  // through unmodified, the parser will throw a much more informative error.
73  // This can also throw on very long queries
74  break;
75  }
76  CHECK_GT(what[1].length(), 0);
77  prev_it = it;
78  it += what.length();
79  positions.emplace_back(prev_it + what[1].length() - query.begin(),
80  it - query.begin());
81  }
82  return positions;
83 }
#define LOG(tag)
Definition: Logger.h:216
#define CHECK_GT(x, y)
Definition: Logger.h:234

+ Here is the caller graph for this function:

std::string generate_random_string ( const size_t  len)

Definition at line 123 of file StringTransform.cpp.

Referenced by CachedSessionStore::add(), DBHandler::createInMemoryCalciteSession(), Catalog_Namespace::SysCatalog::syncUserWithRemoteProvider(), and Catalog_Namespace::SysCatalog::updateBlankPasswordsToRandom().

123  {
124  static char charset[] =
125  "0123456789"
126  "abcdefghijklmnopqrstuvwxyz"
127  "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
128 
129  static std::mt19937 prng{std::random_device{}()};
130  static std::uniform_int_distribution<size_t> dist(0, strlen(charset) - 1);
131 
132  std::string str;
133  str.reserve(len);
134  for (size_t i = 0; i < len; i++) {
135  str += charset[dist(prng)];
136  }
137  return str;
138 }

+ Here is the caller graph for this function:

std::string get_quoted_string ( const std::string &  filename,
char  quote = '"',
char  escape = '\\' 
)

Quote a string while escaping any existing quotes in the string.

Definition at line 261 of file StringTransform.cpp.

Referenced by TableArchiver::dumpTable(), Catalog_Namespace::Catalog::quoteIfRequired(), TableArchiver::restoreTable(), and anonymous_namespace{TableArchiver.cpp}::simple_file_cat().

261  {
262  std::stringstream ss;
263  ss << std::quoted(filename, quote, escape); // TODO: prevents string_view Jun 2020
264  return ss.str();
265 }

+ Here is the caller graph for this function:

std::string hide_sensitive_data_from_query ( std::string const &  query_str)

Definition at line 85 of file StringTransform.cpp.

References gpu_enabled::accumulate().

Referenced by query_state::StdLog::log(), and Calcite::processImpl().

85  {
86  constexpr std::regex::flag_type flags =
87  std::regex::ECMAScript | std::regex::icase | std::regex::optimize;
88  static const std::initializer_list<std::pair<std::regex, std::string>> rules{
89  {std::regex(
90  R"(\b((?:password|s3_access_key|s3_secret_key|s3_session_token|username|credential_string)\s*=\s*)'.+?')",
91  flags),
92  "$1'XXXXXXXX'"},
93  {std::regex(R"((\\set_license\s+)\S+)", flags), "$1XXXXXXXX"}};
94  return std::accumulate(
95  rules.begin(), rules.end(), query_str, [](auto& str, auto& rule) {
96  return std::regex_replace(str, rule.first, rule.second);
97  });
98 }
DEVICE auto accumulate(ARGS &&...args)
Definition: gpu_enabled.h:42

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::optional<size_t> inside_string_literal ( const size_t  start,
const size_t  length,
const std::vector< std::pair< size_t, size_t >> &  literal_positions 
)

Definition at line 206 of file StringTransform.cpp.

Referenced by apply_shim().

209  {
210  const auto end = start + length;
211  for (const auto& literal_position : literal_positions) {
212  if (literal_position.first <= start && end <= literal_position.second) {
213  return literal_position.second;
214  }
215  }
216  return std::nullopt;
217 }

+ Here is the caller graph for this function:

template<typename T >
std::string join ( T const &  container,
std::string const &  delim 
)

Definition at line 61 of file StringTransform.h.

Referenced by heavydb.thrift.ttypes.TDBException::__repr__(), generate_TableFunctionsFactory_init.Declaration::__str__(), generate_TableFunctionsFactory_init.Bracket::__str__(), generate_TableFunctionsFactory_init.ArgNode::__str__(), generate_TableFunctionsFactory_init.ComposedNode::__str__(), generate_TableFunctionsFactory_init::add_method(), foreign_storage::ParquetArrayDetectEncoder::appendToDetectBuffer(), ResultSetReductionJIT::cacheKey(), anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog(), concat_with(), DBHandler::connect_impl(), org.apache.calcite.sql2rel.SqlToRelConverter::convertFrom(), org.apache.calcite.sql2rel.SqlToRelConverter::convertMerge(), anonymous_namespace{RelLeftDeepInnerJoin.cpp}::create_left_deep_join(), DBHandler::create_table(), Catalog_Namespace::Catalog::deleteCustomExpressions(), Catalog_Namespace::Catalog::dumpCreateServer(), Catalog_Namespace::Catalog::dumpCreateTableUnlocked(), Catalog_Namespace::Catalog::dumpSchema(), TableArchiver::dumpTable(), RefreshForeignTablesCommand::execute(), RelAlgExecutor::executeRelAlgQueryNoRetry(), generate_TableFunctionsFactory_init::find_signatures(), generate_TableFunctionsFactory_init::format_annotations(), generate_TableFunctionsFactory_init::format_function_args(), anonymous_namespace{SerializeToSql.cpp}::from_to_string(), tests.conftest::gen_string(), generate_loop_ref::generate(), create_table.SyntheticTable::generateData(), anonymous_namespace{RelAlgExecutor.cpp}::get_data_sink(), anonymous_namespace{RelAlgOptimizer.cpp}::get_field_name(), anonymous_namespace{RelAlgExecutor.cpp}::get_join_source_used_inputs(), anonymous_namespace{RelAlgExecutor.cpp}::get_join_type(), get_left_deep_join_root(), anonymous_namespace{RelAlgOptimizer.cpp}::get_live_ins(), run_benchmark::get_machine_info(), get_qualified_column_hints(), anonymous_namespace{RelAlgOptimizer.cpp}::get_visible_projects(), table_functions::TableFunction::getArgNames(), table_functions::TableFunction::getArgTypes(), ExtensionFunctionsWhitelist::getLLVMDeclarations(), table_functions::TableFunction::getSignature(), anonymous_namespace{SerializeToSql.cpp}::group_by_to_string(), hoist_filter_cond_to_cross_join(), QueryRunner::ImportDriver::importGeoTable(), anonymous_namespace{RelAlgDag.cpp}::isRenamedInput(), anonymous_namespace{SerializeToSql.cpp}::join_condition_to_string(), org.apache.calcite.sql.validate.SqlValidatorImpl::lookupJoinHints(), make-m2-proxy::make_settings(), generate_TableFunctionsFactory_init.Bracket::normalize(), org.apache.calcite.rel.rules.DynamicFilterJoinRule::onMatch(), org.apache.calcite.rel.rules.OuterJoinOptViaNullRejectionRule::onMatch(), operator<<(), import_export::parse_add_metadata_columns(), generate_TableFunctionsFactory_init::parse_annotations(), org.apache.calcite.rel.rules.DynamicFilterJoinRule::performSelectivePushDown(), org.apache.calcite.sql.validate.SqlValidatorImpl.Permute::Permute(), anonymous_namespace{RelAlgOptimizer.cpp}::pick_always_live_col_idx(), anonymous_namespace{RelAlgOptimizer.cpp}::propagate_input_renumbering(), anonymous_namespace{RelAlgOptimizer.cpp}::redirect_inputs_of(), QueryMemoryDescriptor::reductionKey(), org.apache.calcite.sql2rel.SqlToRelConverter.Blackboard::register(), org.apache.calcite.sql.validate.SqlValidatorImpl::registerFrom(), TableArchiver::restoreTable(), com.mapd.calcite.parser.HeavyDBParser::rewriteSimpleUpdateAsSelect(), make-m2-proxy::simple_xml(), sink_projected_boolean_expr_to_join(), start_calcite_server_as_daemon(), org.apache.calcite.sql2rel.SqlToRelConverter::substituteSubQuery(), Catalog_Namespace::SysCatalog::syncUserWithRemoteProvider(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), anonymous_namespace{SerializeToSql.cpp}::targets_to_string(), generate_TableFunctionsFactory_init.Bracket::tostring(), org.apache.calcite.sql2rel.SqlToRelConverter::translateIn(), shared::validate_sort_options(), DBHandler::validateDashboardIdsForSharing(), foreign_storage::ForeignDataWrapperFactory::validateDataWrapperType(), org.apache.calcite.sql.validate.SqlValidatorImpl::validateJoin(), org.apache.calcite.sql.validate.SqlValidatorImpl::validateQualifiedCommonColumn(), foreign_storage::AbstractFileStorageDataWrapper::validateServerOptions(), RelAlgVisitor< std::vector< unsigned > >::visit(), generate_TableFunctionsFactory_init.AstPrinter::visit_annotation_node(), generate_TableFunctionsFactory_init.AstPrinter::visit_arg_node(), generate_TableFunctionsFactory_init.AstPrinter::visit_composed_node(), generate_TableFunctionsFactory_init.AstPrinter::visit_template_node(), generate_TableFunctionsFactory_init.AstPrinter::visit_udtf_node(), ScalarExprToSql::visitFunctionOper(), anonymous_namespace{RelAlgOptimizer.cpp}::RexProjectInputRedirector::visitInput(), anonymous_namespace{RelAlgOptimizer.cpp}::RexInputCollector::visitInput(), anonymous_namespace{RelAlgOptimizer.cpp}::RexInputRedirector::visitInput(), ScalarExprToSql::visitInValues(), anonymous_namespace{RelAlgOptimizer.cpp}::RexRebindInputsVisitor::visitNode(), ScalarExprToSql::visitWindowFunction(), anonymous_namespace{ExternalExecutor.cpp}::vt_create(), and anonymous_namespace{SerializeToSql.cpp}::where_to_string().

61  {
62  std::stringstream ss;
63  if (!container.empty()) {
64  ss << *container.cbegin();
65  for (auto itr = std::next(container.cbegin()); itr != container.cend(); ++itr) {
66  ss << delim << *itr;
67  }
68  }
69  return ss.str();
70 }
bool remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string ( std::string &  str)
noexcept

sanitize an SQL string

Definition at line 221 of file StringTransform.cpp.

222  {
223  char inside_quote = 0;
224  bool previous_c_was_backslash = false;
225  for (auto& c : str) {
226  // if this character is a quote of either type
227  if (c == '\'' || c == '\"') {
228  // ignore if previous character was a backslash
229  if (!previous_c_was_backslash) {
230  // start or end of a quoted region
231  if (inside_quote == c) {
232  // end region
233  inside_quote = 0;
234  } else if (inside_quote == 0) {
235  // start region
236  inside_quote = c;
237  }
238  }
239  } else if (inside_quote == 0) {
240  // outside quoted region
241  if (c == '\n' || c == '\t' || c == '\r') {
242  // replace these with space
243  c = ' ';
244  }
245  // otherwise leave alone, including quotes of a different type
246  }
247  // handle backslashes, except for double backslashes
248  if (c == '\\') {
249  previous_c_was_backslash = !previous_c_was_backslash;
250  } else {
251  previous_c_was_backslash = false;
252  }
253  }
254  // if we didn't end a region, there were unclosed or mixed-nested quotes
255  // accounting for backslashes should mean that this should only be the
256  // case with truly malformed strings which Calcite will barf on anyway
257  return (inside_quote == 0);
258 }
std::string simple_sanitize ( const std::string &  str)

simple sanitize string (replace control characters with space)

Definition at line 269 of file StringTransform.cpp.

269  {
270  auto sanitized_str{str};
271  for (auto& c : sanitized_str) {
272  c = (c < 32) ? ' ' : c;
273  }
274  return sanitized_str;
275 }
std::vector<std::string> split ( std::string_view  str,
std::string_view  delim = {},
std::optional< size_t >  maxsplit = std::nullopt 
)

split apart a string into a vector of substrings

Definition at line 144 of file StringTransform.cpp.

References run_benchmark_import::result.

Referenced by foreign_storage::anonymous_namespace{LogFileBufferParser.cpp}::add_nonce_values(), create_table.SyntheticTable::createDataAndImportTable(), Parser::AlterTableStmt::delegate(), ai.heavy.jdbc.HeavyAIStatement::executeQuery(), anonymous_namespace{DBHandler.cpp}::extract_projection_tokens_for_completion(), generate_TableFunctionsFactory_init::find_signatures(), foreign_storage::anonymous_namespace{InternalCatalogDataWrapper.cpp}::get_data_sources(), get_qualified_column_hints(), table_functions::TableFunction::getCursorFields(), ColumnDescriptor::getDefaultValueLiteral(), com.mapd.parser.server.ExtensionFunction::getPrettyArgNames(), import_export::RasterImporter::getRawBandNamesForFormat(), QueryPlanDagExtractor::handleTranslatedJoin(), import_export::RasterImporter::initializeFiltering(), AutomaticIRMetadataGuard::makeBaseFilename(), AutomaticIRMetadataGuard::makeQueryEngineFilename(), import_export::parse_add_metadata_columns(), TrackingProcessor::process(), Data_Namespace::ProcMeminfoParser::ProcMeminfoParser(), run_benchmark::read_query_files(), TableArchiver::restoreTable(), anonymous_namespace{TableArchiver.cpp}::rewrite_column_ids_in_page_headers(), QueryRunner::QueryRunner::runMultipleStatements(), Parser::splitObjectHierName(), com.mapd.parser.server.ExtensionFunctionSignatureParser::toSignature(), and ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal().

146  {
147  std::vector<std::string> result;
148 
149  // Use an explicit delimiter.
150  if (!delim.empty()) {
151  std::string::size_type i = 0, j = 0;
152  while ((i = str.find(delim, i)) != std::string::npos &&
153  (!maxsplit || result.size() < maxsplit.value())) {
154  result.emplace_back(str, j, i - j);
155  i += delim.size();
156  j = i;
157  }
158  result.emplace_back(str, j, std::string::npos);
159  return result;
160 
161  // Treat any number of consecutive whitespace characters as a delimiter.
162  } else {
163  bool prev_ws = true;
164  std::string::size_type i = 0, j = 0;
165  for (; i < str.size(); ++i) {
166  if (prev_ws) {
167  if (!isspace(str[i])) {
168  // start of word
169  prev_ws = false;
170  j = i;
171  }
172  } else {
173  if (isspace(str[i])) {
174  // start of space
175  result.emplace_back(str, j, i - j);
176  prev_ws = true;
177  j = i;
178  if ((maxsplit && result.size() == maxsplit.value())) {
179  // stop early if maxsplit was reached
180  result.emplace_back(str, j, std::string::npos);
181  return result;
182  }
183  }
184  }
185  }
186  if (!prev_ws) {
187  result.emplace_back(str, j, std::string::npos);
188  }
189  return result;
190  }
191 }

+ Here is the caller graph for this function:

std::string strip ( std::string_view  str)

trim any whitespace from the left and right ends of a string

Definition at line 202 of file StringTransform.cpp.

References sv_strip().

Referenced by import_export::anonymous_namespace{ExpressionParser.cpp}::Function_bool::Eval(), foreign_storage::anonymous_namespace{InternalCatalogDataWrapper.cpp}::get_data_sources(), import_export::RasterImporter::initializeFiltering(), generate_TableFunctionsFactory_init.Bracket::parse(), import_export::parse_add_metadata_columns(), Data_Namespace::ProcMeminfoParser::ProcMeminfoParser(), QueryRunner::QueryRunner::runMultipleStatements(), and DBHandler::sql_execute_impl().

202  {
203  return std::string(sv_strip(str));
204 }
std::string_view sv_strip(std::string_view str)
return trimmed string_view

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::pair<std::string_view, const char*> substring ( const std::string &  str,
size_t  substr_length 
)

return substring of str with postfix if str.size() > substr_length

Definition at line 110 of file StringTransform.cpp.

Referenced by anonymous_namespace{RelAlgOptimizer.cpp}::add_new_indices_for(), anonymous_namespace{RelAlgOptimizer.cpp}::cleanup_dead_nodes(), ai.heavy.jdbc.HeavyAIEscapeFunctions::createFunctionMap(), ct_substr__cpu_(), fold_filters(), and com.mapd.utility.db_vendors.PostGis_types::get_wkt().

111  {
112  // return substring with a post_fix
113  // assume input str is valid and we perform substring starting from str's initial pos
114  // (=0)
115  const auto str_size = str.size();
116  if (substr_length >= str_size) {
117  return {str, ""};
118  }
119  std::string_view substr(str.c_str(), substr_length);
120  return {substr, "..."};
121 }

+ Here is the caller graph for this function:

std::string_view sv_strip ( std::string_view  str)

return trimmed string_view

Definition at line 193 of file StringTransform.cpp.

Referenced by import_export::import_thread_delimited(), foreign_storage::CsvFileBufferParser::parseBuffer(), and strip().

193  {
194  std::string::size_type i, j;
195  for (i = 0; i < str.size() && std::isspace(str[i]); ++i) {
196  }
197  for (j = str.size(); j > i && std::isspace(str[j - 1]); --j) {
198  }
199  return str.substr(i, j - i);
200 }

+ Here is the caller graph for this function:

std::string to_lower ( const std::string &  str)
inline

Definition at line 97 of file StringTransform.h.

References shared::transform().

Referenced by anonymous_namespace{DBHandler.cpp}::check_valid_column_names(), StringDictionaryTranslationMgr::codegen(), CodeGenerator::codegenPerRowStringOper(), anonymous_namespace{DBHandler.cpp}::column_ids_by_names(), import_export::anonymous_namespace{ExpressionParser.cpp}::Function_bool::Eval(), Parser::AlterTableParamStmt::execute(), table_functions::TableFunctionsFactory::get_table_funcs(), table_functions::TableFunction::getName(), import_export::parse_add_metadata_columns(), anonymous_namespace{CalciteAdapter.cpp}::pg_shim_impl(), Data_Namespace::ProcMeminfoParser::ProcMeminfoParser(), and anonymous_namespace{TableArchiver.cpp}::run().

97  {
98  auto str_lc = str;
99  std::transform(str_lc.begin(), str_lc.end(), str_lc.begin(), ::tolower);
100  return str_lc;
101 }
OUTPUT transform(INPUT const &input, FUNC const &func)
Definition: misc.h:296

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
std::string to_string ( T &&  v)

Definition at line 73 of file StringTransform.h.

73  {
74  std::ostringstream oss;
75  oss << v;
76  return oss.str();
77 }
template<>
std::string to_string ( char const *&&  v)

Definition at line 101 of file StringTransform.cpp.

Referenced by lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor(), lockmgr::TableSchemaLockContainer< WriteLock >::acquireTableDescriptor(), import_export::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), import_export::TypedImportBuffer::addDefaultValues(), Catalog_Namespace::Catalog::addFrontendViewToMapNoLock(), Catalog_Namespace::Catalog::addLinkToMap(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), CgenState::addStringConstant(), anonymous_namespace{TargetExprBuilder.cpp}::agg_fn_base_names(), Catalog_Namespace::Catalog::alterPhysicalTableMetadata(), Catalog_Namespace::SysCatalog::alterUser(), Parser::InsertValuesStmt::analyze(), query_state::StdLog::appendNameValuePairs(), foreign_storage::LazyParquetChunkLoader::appendRowGroups(), Archive::archive_error(), import_export::QueryExporterGDAL::beginExport(), bind_function(), Catalog_Namespace::Catalog::buildDashboardsMapUnlocked(), Catalog_Namespace::Catalog::buildDictionaryMapUnlocked(), Catalog_Namespace::Catalog::buildLinksMapUnlocked(), Catalog_Namespace::SysCatalog::buildObjectDescriptorMapUnlocked(), StringDictionaryProxy::buildUnionTranslationMapToOtherProxy(), ResultSetReductionJIT::cacheKey(), Catalog_Namespace::SysCatalog::changeDatabaseOwner(), Catalog_Namespace::Catalog::changeForeignServerOwner(), ddl_utils::SqlType::check_type(), anonymous_namespace{DBETypes.cpp}::checkColumnRange(), foreign_storage::SingleTextFileReader::checkForMoreRows(), anonymous_namespace{Execute.cpp}::checkWorkUnitWatchdog(), spatial_type::Transform::codegen(), anonymous_namespace{GpuSharedMemoryUtils.cpp}::codegen_smem_dest_slot_ptr(), GroupByAndAggregate::codegenAggColumnPtr(), TargetExprCodegen::codegenAggregate(), CodeGenerator::codegenArrayAt(), CodeGenerator::codegenHoistedConstantsLoads(), CodeGenerator::codegenHoistedConstantsPlaceholders(), BaselineJoinHashTable::codegenMatchingSet(), OverlapsJoinHashTable::codegenMatchingSet(), RangeJoinHashTable::codegenMatchingSetWithOffset(), GroupByAndAggregate::codegenOutputSlot(), BaselineJoinHashTable::codegenSlot(), CodeGenerator::codgenAdjustFixedEncNull(), CodeGenerator::colByteStream(), TableFunctionCompilationContext::compile(), UdfCompiler::compileToLLVMIR(), BloscCompressor::compress(), Geospatial::compress_coords(), anonymous_namespace{OverlapsJoinHashTable.cpp}::compute_bucket_sizes(), DBHandler::convertRows(), File_Namespace::FileMgr::coreInit(), create_dev_group_by_buffers(), DBHandler::create_table(), Catalog_Namespace::Catalog::createCustomExpression(), Catalog_Namespace::Catalog::createDashboard(), Catalog_Namespace::Catalog::createDashboardSystemRoles(), Catalog_Namespace::SysCatalog::createDatabase(), Catalog_Namespace::Catalog::createForeignServerNoLocks(), foreign_storage::ForeignDataWrapperFactory::createForeignTableProxy(), Catalog_Namespace::Catalog::createLink(), Catalog_Namespace::Catalog::createTable(), RelAlgExecutor::createTableFunctionWorkUnit(), Catalog_Namespace::SysCatalog::createUser(), ct_synthesize_new_dict__cpu_(), anonymous_namespace{DBHandler.cpp}::dashboard_exists(), anonymous_namespace{ArrowImporter.h}::data_conversion_error(), DatumToString(), ArrowResultSet::deallocateArrowResultBuffer(), BloscCompressor::decompress(), Catalog_Namespace::Catalog::delDictionary(), Catalog_Namespace::Catalog::deleteCustomExpressions(), Catalog_Namespace::Catalog::deleteMetadataForDashboards(), Catalog_Namespace::SysCatalog::deleteObjectDescriptorMap(), Catalog_Namespace::anonymous_namespace{SysCatalog.cpp}::deleteObjectPrivileges(), Catalog_Namespace::Catalog::deleteTableCatalogMetadata(), import_export::RasterImporter::detect(), DecimalOverflowValidator::do_validate(), Catalog_Namespace::Catalog::dropColumn(), Catalog_Namespace::SysCatalog::dropDatabase(), Catalog_Namespace::Catalog::dropForeignServer(), Catalog_Namespace::SysCatalog::dropUserUnchecked(), Catalog_Namespace::Catalog::dumpCreateTableUnlocked(), Catalog_Namespace::Catalog::dumpSchema(), TableArchiver::dumpTable(), foreign_storage::TypedParquetInPlaceEncoder< V, V >::elementToString(), anonymous_namespace{ResultSetReductionJIT.cpp}::emit_write_projection(), FixedLengthEncoder< T, V >::encodeDataAndUpdateStats(), anonymous_namespace{ArrowImporter.h}::error_context(), CudaMgr_Namespace::errorMessage(), ShowUserDetailsCommand::execute(), Parser::CreateTableAsSelectStmt::execute(), Parser::CopyTableStmt::execute(), Catalog_Namespace::Catalog::executeDropTableSqliteQueries(), RelAlgExecutor::executeRelAlgQueryNoRetry(), RelAlgExecutor::executeSimpleInsert(), File_Namespace::FileMgr::FileMgr(), import_export::delimited_parser::find_end(), foreign_storage::anonymous_namespace{RegexFileBufferParser.cpp}::find_last_end_of_line(), import_export::anonymous_namespace{RasterImporter.cpp}::gdal_data_type_to_sql_type(), Geospatial::anonymous_namespace{GDAL.cpp}::gdal_error_handler(), anonymous_namespace{JoinLoopTest.cpp}::generate_descriptors(), generate_series__cpu_1(), UdfCompiler::generateAST(), TableFunctionCompilationContext::generateCastsForInputTypes(), TableFunctionCompilationContext::generateEntryPoint(), Catalog_Namespace::Catalog::generatePhysicalTableName(), Parser::anonymous_namespace{ParserNode.cpp}::generateUniqueTableName(), Geospatial::GeoPoint::GeoPoint(), anonymous_namespace{ArrowResultSetConverter.cpp}::get_arrow_type(), get_column_stats(), DBHandler::get_dashboard(), DBHandler::get_dashboard_grantees(), File_Namespace::get_data_file_path(), DateTimeUtils::get_dateadd_high_precision_adjusted_scale(), DateTimeUtils::get_dateadd_timestamp_precision_scale(), DBHandler::get_db_object_privs(), DateTimeUtils::get_extract_timestamp_precision_scale(), import_export::Detector::get_headers(), DBHandler::get_link_view(), foreign_storage::anonymous_namespace{LogFileBufferParser.cpp}::get_node_name(), get_nvidia_compute_capability(), ThriftClientConnection::get_protocol(), HitTestTypes::get_rowid_regex(), anonymous_namespace{Execute.cpp}::get_table_name(), DateTimeUtils::get_timestamp_precision_scale(), SQLTypeInfo::get_type_name(), DBHandler::get_valid_groups(), getArrowImportType(), import_export::RasterImporter::getBandName(), Fragmenter_Namespace::InsertOrderFragmenter::getChunkMetadata(), lockmgr::TableLockMgrImpl< TableDataLockMgr >::getClusterTableMutex(), Parser::LocalQueryConnector::getColumnDescriptors(), getCurrentStackTrace(), Catalog_Namespace::Catalog::getCustomExpressionFromStorage(), DataRecyclerUtil::getDeviceIdentifierString(), CudaMgr_Namespace::CudaMgr::getDeviceProperties(), RelAlgExecutor::getErrorMessageFromCode(), ColSlotContext::getFlatBufferSize(), Catalog_Namespace::Catalog::getForeignServersForUser(), Catalog_Namespace::Catalog::getForeignTableFromStorage(), Catalog_Namespace::SysCatalog::getGranteesOfSharedDashboards(), Catalog_Namespace::Catalog::getMetadataForDashboard(), Catalog_Namespace::SysCatalog::getMetadataForDBById(), Catalog_Namespace::SysCatalog::getMetadataForObject(), Catalog_Namespace::SysCatalog::getMetadataForUserById(), Catalog_Namespace::SysCatalog::getMetadataWithDefaultDB(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::getMinMaxBoundsAsStrings(), foreign_storage::FloatPointValidator< T >::getMinMaxBoundsAsStrings(), Catalog_Namespace::SysCatalog::getRoles(), DBHandler::has_object_privilege(), import_export::RasterImporter::import(), import_export::import_thread_delimited(), import_export::import_thread_shapefile(), import_export::Importer::importGDALRaster(), import_export::ForeignDataImporter::importGeneralS3(), DBHandler::importGeoTableSingle(), RangeJoinHashTable::initHashTableOnCpu(), OverlapsJoinHashTable::initHashTableOnCpu(), anonymous_namespace{HashTable.cpp}::inner_to_string(), Catalog_Namespace::anonymous_namespace{SysCatalog.cpp}::insertOrUpdateObjectPrivileges(), Executor::interrupt(), ResultSet::isGeoColOnGpu(), TableFunctionExecutionContext::launchCpuCode(), TableFunctionExecutionContext::launchGpuCode(), QueryExecutionContext::launchGpuCode(), TableFunctionExecutionContext::launchPreCodeOnCpu(), DBObject::loadKey(), main(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), migrations::MigrationMgr::migrateDateInDaysMetadata(), Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges(), numeric_type_name(), import_export::anonymous_namespace{Importer.cpp}::ogr_to_type(), Geospatial::GeoTypesError::OGRErrorToStr(), File_Namespace::open(), import_export::Importer::openGDALDataSource(), anonymous_namespace{ArrowImporter.h}::ArrowValue< float >::operator DATA_TYPE(), anonymous_namespace{ArrowImporter.h}::ArrowValue< double >::operator DATA_TYPE(), anonymous_namespace{ArrowImporter.h}::ArrowValue< int64_t >::operator DATA_TYPE(), logger::JsonEncoder::operator()(), operator<<(), heavyai::JSON::operator[](), Executor::optimizeAndCodegenCPU(), import_export::parse_add_metadata_columns(), Parser::anonymous_namespace{ParserNode.cpp}::parse_copy_params(), OutOfMemory::parse_error_str(), parse_stats_requests_json(), import_export::delimited_parser::parse_string_array(), anonymous_namespace{CalciteAdapter.cpp}::pg_shim_impl(), DBHandler::prepare_loader_generic(), anonymous_namespace{Types.cpp}::process_poly_ring(), DictionaryValueConverter< TARGET_TYPE >::processBuffer(), foreign_storage::TextFileBufferParser::processGeoColumn(), query_template_impl(), ra_exec_unit_desc_for_caching(), foreign_storage::SingleTextFileReader::readRegion(), Catalog_Namespace::SysCatalog::reassignObjectOwners(), Catalog_Namespace::Catalog::reassignOwners(), Catalog_Namespace::SysCatalog::recordExecutedMigration(), Catalog_Namespace::Catalog::recordOwnershipOfObjectsInObjectPermissions(), Executor::redeclareFilterFunction(), ResultSetReductionJIT::reduceOneEntryBaseline(), ResultSetReductionJIT::reduceOneEntryTargetsNoCollisions(), QueryMemoryDescriptor::reductionKey(), Executor::registerActiveModule(), PerfectJoinHashTable::reifyForDevice(), BaselineJoinHashTable::reifyForDevice(), Catalog_Namespace::Catalog::reloadTableMetadataUnlocked(), AutomaticIRMetadataGuard::rememberOurInstructions(), Catalog_Namespace::Catalog::renameColumn(), Catalog_Namespace::SysCatalog::renameDatabase(), File_Namespace::renameForDelete(), Catalog_Namespace::Catalog::renameLegacyDataWrappers(), Catalog_Namespace::SysCatalog::renameObjectsInDescriptorMap(), Catalog_Namespace::Catalog::renamePhysicalTable(), DBHandler::replace_dashboard(), Catalog_Namespace::Catalog::replaceDashboard(), Catalog_Namespace::Catalog::restoreOldOwners(), Catalog_Namespace::Catalog::restoreOldOwnersInMemory(), TableArchiver::restoreTable(), ArrowResultSet::resultSetArrowLoopback(), Catalog_Namespace::SysCatalog::revokeAllOnDatabase_unsafe(), anonymous_namespace{TableArchiver.cpp}::rewrite_column_ids_in_page_headers(), QueryRewriter::rewriteColumnarUpdate(), anonymous_namespace{TableArchiver.cpp}::run(), ExecutionKernel::runImpl(), Catalog_Namespace::SysCatalog::runUpdateQueriesAndChangeOwnership(), import_export::QueryExporter::safeColumnName(), import_export::RenderGroupAnalyzer::seedFromExistingTableContents(), serialize_column_ref(), serialize_table_ref(), ddl_utils::set_default_encoding(), anonymous_namespace{DdlCommandExecutor.cpp}::set_headers_with_type(), foreign_storage::set_node_name(), Catalog_Namespace::Catalog::setColumnDictionary(), Catalog_Namespace::Catalog::setColumnSharedDictionary(), Catalog_Namespace::Catalog::setForeignServerProperty(), Catalog_Namespace::Catalog::setForeignTableProperty(), Executor::skipFragment(), import_export::anonymous_namespace{RasterImporter.cpp}::sql_type_to_gdal_data_type(), start_calcite_server_as_daemon(), query_state::StdLogData::StdLogData(), anonymous_namespace{StringTransform.h}::stringlike(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::suggest_decimal_mapping(), Catalog_Namespace::anonymous_namespace{Catalog.cpp}::table_epochs_to_string(), anonymous_namespace{ResultSetReductionJIT.cpp}::target_info_key(), ThriftSerializers::target_meta_info_to_thrift(), import_export::anonymous_namespace{QueryExporterCSV.cpp}::target_value_to_string(), DBHandler::thrift_to_copyparams(), foreign_storage::anonymous_namespace{AbstractTextFileDataWrapper.cpp}::throw_fragment_id_out_of_bounds_error(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::throw_missing_metadata_error(), foreign_storage::throw_number_of_columns_mismatch_error(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::throw_row_group_larger_than_fragment_size_error(), foreign_storage::throw_unexpected_number_of_items(), foreign_storage::ParquetFixedLengthArrayEncoder::throwEmptyArrayException(), foreign_storage::ParquetFixedLengthArrayEncoder::throwWrongSizeArray(), logger::JsonEncoder::timer(), StatsRequestPredicate::to_string(), Parser::InSubquery::to_string(), Parser::InValues::to_string(), dict_ref_t::toString(), InputDescriptor::toString(), HashTable::toString(), RexAbstractInput::toString(), InputColDescriptor::toString(), table_functions::TableFunctionOutputRowSizer::toString(), ColSlotContext::toString(), ExpressionRange::toString(), anonymous_namespace{Datum.cpp}::toString(), toString(), Array< T >::toString(), Analyzer::ColumnVar::toString(), DBObject::toString(), RexOperator::toString(), Analyzer::Var::toString(), QueryMemoryDescriptor::toString(), RexInput::toString(), Analyzer::UOper::toString(), SortField::toString(), Column< T >::toString(), Analyzer::InValues::toString(), RexRef::toString(), Analyzer::InIntegerSet::toString(), RexAgg::toString(), Column< TextEncodingDict >::toString(), ColumnList< T >::toString(), ColumnList< Array< T > >::toString(), ColumnList< TextEncodingDict >::toString(), Analyzer::LikelihoodExpr::toString(), RelAggregate::toString(), Analyzer::ExtractExpr::toString(), Analyzer::DateaddExpr::toString(), RelJoin::toString(), Analyzer::DatediffExpr::toString(), Analyzer::DatetruncExpr::toString(), RelFilter::toString(), RelLeftDeepInnerJoin::toString(), RelCompound::toString(), RelSort::toString(), RelModify::toString(), RelTableFunction::toString(), Analyzer::OrderEntry::toString(), Analyzer::GeoTransformOperator::toString(), anonymous_namespace{HashJoin.cpp}::toStringFlat(), transform_point(), RelAlgTranslator::translateArrayFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateHPTLiteral(), Executor::unregisterActiveModule(), Catalog_Namespace::SysCatalog::updateBlankPasswordsToRandom(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), Catalog_Namespace::Catalog::updateCustomExpression(), Catalog_Namespace::Catalog::updateDeletedColumnIndicator(), Catalog_Namespace::Catalog::updateDictionaryNames(), Catalog_Namespace::Catalog::updateFixlenArrayColumns(), Catalog_Namespace::Catalog::updateForeignTableRefreshTimes(), Catalog_Namespace::Catalog::updateGeoColumns(), Catalog_Namespace::Catalog::updateLogicalToPhysicalTableMap(), Catalog_Namespace::SysCatalog::updateObjectDescriptorMap(), Catalog_Namespace::Catalog::updatePageSize(), Catalog_Namespace::SysCatalog::updateSupportUserDeactivation(), Catalog_Namespace::Catalog::updateTableDescriptorSchema(), Catalog_Namespace::UserMetadata::userLoggable(), DateDaysOverflowValidator::validate(), CommandLineOptions::validate(), foreign_storage::Csv::anonymous_namespace{CsvShared.cpp}::validate_and_get_string_with_length(), foreign_storage::anonymous_namespace{CsvFileBufferParser.cpp}::validate_and_get_string_with_length(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_equal_schema(), ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal(), foreign_storage::anonymous_namespace{LazyParquetChunkLoader.cpp}::validate_max_repetition_and_definition_level(), system_validator::validate_table_epochs(), foreign_storage::IntegralFixedLengthBoundsValidator< T >::validateValue(), foreign_storage::FloatPointValidator< T >::validateValue(), ColSlotContext::varlenOutputElementSize(), and ScalarExprToSql::visitUOper().

101  {
102  return std::string(v);
103 }
template<>
std::string to_string ( std::string &&  v)

Definition at line 106 of file StringTransform.cpp.

106  {
107  return std::move(v);
108 }
std::string to_upper ( const std::string &  str)
inline

Definition at line 91 of file StringTransform.h.

References shared::transform().

Referenced by ExtensionFunctionsWhitelist::addCommon(), Catalog_Namespace::Catalog::addTableToMap(), Catalog_Namespace::Catalog::addToColumnMap(), DBHandler::alterSession(), DBHandler::alterSystemClear(), Catalog_Namespace::SysCatalog::buildMapsUnlocked(), Catalog_Namespace::SysCatalog::buildRoleMapUnlocked(), Catalog_Namespace::Catalog::buildTablesMapUnlocked(), Catalog_Namespace::SysCatalog::createDatabase(), Catalog_Namespace::SysCatalog::createRole_unsafe(), system_validator::DistributedValidate::DistributedValidate(), Catalog_Namespace::Catalog::dropColumn(), Catalog_Namespace::SysCatalog::dropRole_unsafe(), CreateForeignServerCommand::execute(), anonymous_namespace{DBHandler.cpp}::extract_projection_tokens_for_completion(), ExtensionFunctionsWhitelist::get(), Analyzer::TrimStringOper::get_and_validate_trim_op_kind(), DBHandler::get_completion_hints(), ExtensionFunctionsWhitelist::get_ext_funcs(), foreign_storage::anonymous_namespace{AbstractFileStorageDataWrapper.cpp}::get_file_roll_off_value(), get_kmeans_init_type(), get_ml_framework(), get_raster_agg_type(), DBHandler::get_uc_compatible_table_names_by_column(), ExtensionFunctionsWhitelist::get_udf(), Catalog_Namespace::Catalog::getDictionary(), ShowTableDetailsCommand::getFilteredTableNames(), Catalog_Namespace::Catalog::getForeignTableUnlocked(), Catalog_Namespace::SysCatalog::getGrantee(), Catalog_Namespace::Catalog::getMutableMetadataForTableUnlocked(), DdlCommandExecutor::getSessionParameter(), shared::FileOrderBase< LocalFileComparator >::getSortBy(), Catalog_Namespace::is_reserved_sql_keyword(), just_whitelisted_keyword_hints(), parseStorageType(), foreign_storage::OptionsContainer::populateOptionsMap(), Catalog_Namespace::Catalog::removeFromColumnMap(), Catalog_Namespace::Catalog::removeTableFromMap(), Catalog_Namespace::Catalog::renameColumn(), Catalog_Namespace::SysCatalog::renameDatabase(), Catalog_Namespace::Catalog::renamePhysicalTable(), Catalog_Namespace::Catalog::setForeignServerDataWrapper(), Catalog_Namespace::Catalog::setUncappedTableEpoch(), should_suggest_column_hints(), StringToDatum(), Catalog_Namespace::SysCatalog::syncUserWithRemoteProvider(), Catalog_Namespace::SysCatalog::updateUserRoleName(), ddl_utils::validate_and_set_default_value(), ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal(), and shared::validate_sort_options().

91  {
92  auto str_uc = str;
93  std::transform(str_uc.begin(), str_uc.end(), str_uc.begin(), ::toupper);
94  return str_uc;
95 }
OUTPUT transform(INPUT const &input, FUNC const &func)
Definition: misc.h:296

+ Here is the call graph for this function: