OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringTransform.cpp File Reference
#include "StringTransform.h"
#include "Logger/Logger.h"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <numeric>
#include <random>
#include <regex>
#include <string>
#include <cmath>
#include <vector>
#include <boost/filesystem.hpp>
#include <iomanip>
+ Include dependency graph for StringTransform.cpp:

Go to the source code of this file.

Functions

void apply_shim (std::string &result, const boost::regex &reg_expr, const std::function< void(std::string &, const boost::smatch &)> &shim_fn)
 
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::string format_num_bytes (const size_t bytes)
 
template<>
std::string to_string (char const *&&v)
 
template<>
std::string to_string (std::string &&v)
 
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...
 
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)
 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::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)
 
bool remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string (std::string &str) noexcept
 sanitize an SQL string 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...
 
std::string simple_sanitize (const std::string &str)
 simple sanitize string (replace control characters with space) More...
 

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 36 of file StringTransform.cpp.

References find_string_literals(), and inside_string_literal().

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

38  {
39  boost::smatch what;
40  std::vector<std::pair<size_t, size_t>> lit_pos = find_string_literals(result);
41  auto start_it = result.cbegin();
42  auto end_it = result.cend();
43  while (true) {
44  if (!boost::regex_search(start_it, end_it, what, reg_expr)) {
45  break;
46  }
47  const auto next_start =
48  inside_string_literal(what.position(), what.length(), lit_pos);
49  if (next_start) {
50  start_it = result.cbegin() + *next_start;
51  } else {
52  shim_fn(result, what);
53  lit_pos = find_string_literals(result);
54  start_it = result.cbegin();
55  end_it = result.cend();
56  }
57  }
58 }
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:

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

Definition at line 60 of file StringTransform.cpp.

References CHECK_GT, LOG, and logger::WARNING.

Referenced by apply_shim().

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

+ Here is the caller graph for this function:

std::string format_num_bytes ( const size_t  bytes)

Definition at line 104 of file StringTransform.cpp.

References CHECK_GE, CHECK_LE, and to_string().

Referenced by ExecutorResourceMgr_Namespace::ExecutorResourcePool::add_chunk_requests_to_allocated_pool(), ExecutorResourceMgr_Namespace::ExecutorResourcePool::allocate_resources(), ExecutorResourceMgr_Namespace::ExecutorResourcePool::can_currently_satisfy_chunk_request(), ExecutorResourceMgr_Namespace::ExecutorResourcePool::deallocate_resources(), DBHandler::init_executor_resource_mgr(), ExecutorResourceMgr_Namespace::ResourceGrant::print(), ExecutorResourceMgr_Namespace::ExecutorResourcePool::remove_chunk_requests_from_allocated_pool(), and ExecutorResourceMgr_Namespace::ResourceGrant::to_string().

104  {
105  const size_t units_per_k_unit{1024};
106  const std::vector<std::string> byte_units = {" bytes", "KB", "MB", "GB", "TB", "PB"};
107  const std::vector<size_t> bytes_per_scale_unit = {size_t(1),
108  size_t(1) << 10,
109  size_t(1) << 20,
110  size_t(1) << 30,
111  size_t(1) << 40,
112  size_t(1) << 50,
113  size_t(1) << 60};
114  if (bytes < units_per_k_unit) {
115  return std::to_string(bytes) + " bytes";
116  }
117  CHECK_GE(bytes, units_per_k_unit);
118  const size_t byte_scale = log(bytes) / log(units_per_k_unit);
119  CHECK_GE(byte_scale, size_t(1));
120  CHECK_LE(byte_scale, size_t(5));
121  const size_t scaled_bytes_left_of_decimal = bytes / bytes_per_scale_unit[byte_scale];
122  const size_t scaled_bytes_right_of_decimal = bytes % bytes_per_scale_unit[byte_scale];
123  const size_t fractional_digits = static_cast<double>(scaled_bytes_right_of_decimal) /
124  bytes_per_scale_unit[byte_scale] * 100.;
125  return std::to_string(scaled_bytes_left_of_decimal) + "." +
126  std::to_string(fractional_digits) + " " + byte_units[byte_scale];
127 }
#define CHECK_GE(x, y)
Definition: Logger.h:306
std::string to_string(char const *&&v)
#define CHECK_LE(x, y)
Definition: Logger.h:304

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string generate_random_string ( const size_t  len)

Definition at line 152 of file StringTransform.cpp.

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

152  {
153  static char charset[] =
154  "0123456789"
155  "abcdefghijklmnopqrstuvwxyz"
156  "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
157 
158  static std::mt19937 prng{std::random_device{}()};
159  static std::uniform_int_distribution<size_t> dist(0, strlen(charset) - 1);
160 
161  std::string str;
162  str.reserve(len);
163  for (size_t i = 0; i < len; i++) {
164  str += charset[dist(prng)];
165  }
166  return str;
167 }

+ 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 290 of file StringTransform.cpp.

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

290  {
291  std::stringstream ss;
292  ss << std::quoted(filename, quote, escape); // TODO: prevents string_view Jun 2020
293  return ss.str();
294 }

+ Here is the caller graph for this function:

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

Definition at line 89 of file StringTransform.cpp.

References gpu_enabled::accumulate().

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

89  {
90  constexpr std::regex::flag_type flags =
91  std::regex::ECMAScript | std::regex::icase | std::regex::optimize;
92  static const std::initializer_list<std::pair<std::regex, std::string>> rules{
93  {std::regex(
94  R"(\b((?:password|s3_access_key|s3_secret_key|s3_session_token|username|credential_string)\s*=\s*)'.+?')",
95  flags),
96  "$1'XXXXXXXX'"},
97  {std::regex(R"((\\set_license\s+)\S+)", flags), "$1XXXXXXXX"}};
98  return std::accumulate(
99  rules.begin(), rules.end(), query_str, [](auto& str, auto& rule) {
100  return std::regex_replace(str, rule.first, rule.second);
101  });
102 }
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 235 of file StringTransform.cpp.

Referenced by apply_shim().

238  {
239  const auto end = start + length;
240  for (const auto& literal_position : literal_positions) {
241  if (literal_position.first <= start && end <= literal_position.second) {
242  return literal_position.second;
243  }
244  }
245  return std::nullopt;
246 }

+ Here is the caller graph for this function:

bool remove_unquoted_newlines_linefeeds_and_tabs_from_sql_string ( std::string &  str)
noexcept

sanitize an SQL string

Definition at line 250 of file StringTransform.cpp.

251  {
252  char inside_quote = 0;
253  bool previous_c_was_backslash = false;
254  for (auto& c : str) {
255  // if this character is a quote of either type
256  if (c == '\'' || c == '\"') {
257  // ignore if previous character was a backslash
258  if (!previous_c_was_backslash) {
259  // start or end of a quoted region
260  if (inside_quote == c) {
261  // end region
262  inside_quote = 0;
263  } else if (inside_quote == 0) {
264  // start region
265  inside_quote = c;
266  }
267  }
268  } else if (inside_quote == 0) {
269  // outside quoted region
270  if (c == '\n' || c == '\t' || c == '\r') {
271  // replace these with space
272  c = ' ';
273  }
274  // otherwise leave alone, including quotes of a different type
275  }
276  // handle backslashes, except for double backslashes
277  if (c == '\\') {
278  previous_c_was_backslash = !previous_c_was_backslash;
279  } else {
280  previous_c_was_backslash = false;
281  }
282  }
283  // if we didn't end a region, there were unclosed or mixed-nested quotes
284  // accounting for backslashes should mean that this should only be the
285  // case with truly malformed strings which Calcite will barf on anyway
286  return (inside_quote == 0);
287 }
std::string simple_sanitize ( const std::string &  str)

simple sanitize string (replace control characters with space)

Definition at line 298 of file StringTransform.cpp.

298  {
299  auto sanitized_str{str};
300  for (auto& c : sanitized_str) {
301  c = (c < 32) ? ' ' : c;
302  }
303  return sanitized_str;
304 }
std::vector<std::string> split ( std::string_view  str,
std::string_view  delim,
std::optional< size_t >  maxsplit 
)

split apart a string into a vector of substrings

Definition at line 173 of file StringTransform.cpp.

References run_benchmark_import::result.

Referenced by foreign_storage::anonymous_namespace{LogFileBufferParser.cpp}::add_nonce_values(), run_benchmark::benchmark(), create_table.SyntheticTable::createDataAndImportTable(), AlterTableCommand::execute(), ai.heavy.jdbc.HeavyAIStatement::executeQuery(), anonymous_namespace{DBHandler.cpp}::extract_projection_tokens_for_completion(), anonymous_namespace{TableArchiver.cpp}::find_render_group_columns(), 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(), QueryRunner::QueryRunner::runMultipleStatements(), Parser::splitObjectHierName(), tf_geo_multi_rasterize__cpu_template(), com.mapd.parser.server.ExtensionFunctionSignatureParser::toSignature(), anonymous_namespace{TableArchiver.cpp}::update_or_drop_column_ids_in_page_headers(), and ddl_utils::anonymous_namespace{DdlUtils.cpp}::validate_literal().

175  {
176  std::vector<std::string> result;
177 
178  // Use an explicit delimiter.
179  if (!delim.empty()) {
180  std::string::size_type i = 0, j = 0;
181  while ((i = str.find(delim, i)) != std::string::npos &&
182  (!maxsplit || result.size() < maxsplit.value())) {
183  result.emplace_back(str, j, i - j);
184  i += delim.size();
185  j = i;
186  }
187  result.emplace_back(str, j, std::string::npos);
188  return result;
189 
190  // Treat any number of consecutive whitespace characters as a delimiter.
191  } else {
192  bool prev_ws = true;
193  std::string::size_type i = 0, j = 0;
194  for (; i < str.size(); ++i) {
195  if (prev_ws) {
196  if (!isspace(str[i])) {
197  // start of word
198  prev_ws = false;
199  j = i;
200  }
201  } else {
202  if (isspace(str[i])) {
203  // start of space
204  result.emplace_back(str, j, i - j);
205  prev_ws = true;
206  j = i;
207  if ((maxsplit && result.size() == maxsplit.value())) {
208  // stop early if maxsplit was reached
209  result.emplace_back(str, j, std::string::npos);
210  return result;
211  }
212  }
213  }
214  }
215  if (!prev_ws) {
216  result.emplace_back(str, j, std::string::npos);
217  }
218  return result;
219  }
220 }

+ 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 231 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(), getCurrentStackTrace(), import_export::RasterImporter::initializeFiltering(), TableFunctionsFactory_declbracket.Bracket::parse(), import_export::parse_add_metadata_columns(), Data_Namespace::ProcMeminfoParser::ProcMeminfoParser(), QueryRunner::QueryRunner::runMultipleStatements(), and DBHandler::sql_execute_impl().

231  {
232  return std::string(sv_strip(str));
233 }
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 139 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(), com.mapd.utility.db_vendors.PostGis_types::get_wkt(), and DBHandler::sql_execute_impl().

140  {
141  // return substring with a post_fix
142  // assume input str is valid and we perform substring starting from str's initial pos
143  // (=0)
144  const auto str_size = str.size();
145  if (substr_length >= str_size) {
146  return {str, ""};
147  }
148  std::string_view substr(str.c_str(), substr_length);
149  return {substr, "..."};
150 }

+ Here is the caller graph for this function:

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

return trimmed string_view

Definition at line 222 of file StringTransform.cpp.

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

222  {
223  std::string::size_type i, j;
224  for (i = 0; i < str.size() && std::isspace(str[i]); ++i) {
225  }
226  for (j = str.size(); j > i && std::isspace(str[j - 1]); --j) {
227  }
228  return str.substr(i, j - i);
229 }

+ Here is the caller graph for this function:

template<>
std::string to_string ( char const *&&  v)

Definition at line 130 of file StringTransform.cpp.

Referenced by lockmgr::TableSchemaLockContainer< ReadLock >::acquireTableDescriptor(), lockmgr::TableSchemaLockContainer< WriteLock >::acquireTableDescriptor(), import_export::TypedImportBuffer::add_value(), Catalog_Namespace::Catalog::addColumn(), Catalog_Namespace::Catalog::addColumnNontransactional(), import_export::TypedImportBuffer::addDefaultValues(), Catalog_Namespace::Catalog::addFrontendViewToMapNoLock(), Catalog_Namespace::Catalog::addLinkToMap(), Catalog_Namespace::Catalog::addReferenceToForeignDict(), CgenState::addStringConstant(), TableFunctionManager::allocate_output_buffers(), Catalog_Namespace::Catalog::alterColumnTypeTransactional(), Catalog_Namespace::Catalog::alterPhysicalTableMetadata(), Catalog_Namespace::SysCatalog::alterUser(), Parser::InsertValuesStmt::analyze(), data_conversion::StringViewToArrayEncoder< ScalarEncoderType >::appendArrayDatums(), query_state::StdLog::appendNameValuePairs(), foreign_storage::LazyParquetChunkLoader::appendRowGroups(), Archive::archive_error(), import_export::QueryExporterGDAL::beginExport(), run_benchmark::benchmark(), bind_function(), Catalog_Namespace::Catalog::buildDashboardsMapUnlocked(), Catalog_Namespace::Catalog::buildDictionaryMapUnlocked(), Catalog_Namespace::Catalog::buildLinksMapUnlocked(), Catalog_Namespace::SysCatalog::buildObjectDescriptorMapUnlocked(), ResultSetReductionJIT::cacheKey(), GeoRaster< T, Z >::calculate_bins_and_scales(), CardinalityCacheKey::CardinalityCacheKey(), 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(), BoundingBoxIntersectJoinHashTable::codegenMatchingSet(), RangeJoinHashTable::codegenMatchingSetWithOffset(), GroupByAndAggregate::codegenOutputSlot(), BaselineJoinHashTable::codegenSlot(), CodeGenerator::codgenAdjustFixedEncNull(), CodeGenerator::colByteStream(), TableFunctionCompilationContext::compile(), UdfCompiler::compileToLLVMIR(), BloscCompressor::compress(), Geospatial::compress_coords(), anonymous_namespace{BoundingBoxIntersectJoinHashTable.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(), Catalog_Namespace::Catalog::createTableFromDiskUnlocked(), 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(), Geo::decompress_x_coord(), Geo::decompress_y_coord(), Catalog_Namespace::Catalog::delDictionaryNontransactional(), 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::Catalog::dropColumnNontransactional(), Catalog_Namespace::SysCatalog::dropDatabase(), Catalog_Namespace::Catalog::dropForeignServer(), migrations::MigrationMgr::dropRenderGroupColumns(), 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(), data_conversion::StringViewToStringNoneEncoder::encodeAndAppendData(), data_conversion::StringViewToStringDictEncoder< IdType >::encodeAndAppendData(), 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::executeSimpleInsert(), File_Namespace::FileMgr::FileMgr(), import_export::delimited_parser::find_end(), foreign_storage::anonymous_namespace{RegexFileBufferParser.cpp}::find_last_end_of_line(), format_num_bytes(), 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(), UdfCompiler::generateAST(), 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(), get_device_string(), DateTimeUtils::get_extract_timestamp_precision_scale(), Parser::anonymous_namespace{ParserNode.cpp}::get_frag_size_def(), 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::Catalog::getNextAddedColumnId(), import_export::RasterImporter::getRawPixels(), Catalog_Namespace::SysCatalog::getRoles(), flatbuffer::NestedArray< char >::getValue(), 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(), BoundingBoxIntersectJoinHashTable::initHashTableOnCpu(), anonymous_namespace{HashTable.cpp}::inner_to_string(), Catalog_Namespace::anonymous_namespace{SysCatalog.cpp}::insertOrUpdateObjectPrivileges(), Executor::interrupt(), ResultSet::isGeoColOnGpu(), TableFunctionExecutionContext::launchCpuCode(), QueryExecutionContext::launchGpuCode(), TableFunctionExecutionContext::launchGpuCode(), TableFunctionExecutionContext::launchPreCodeOnCpu(), DBObject::loadKey(), main(), anonymous_namespace{ExtensionFunctionsBinding.cpp}::match_arguments(), migrations::MigrationMgr::migrateDateInDaysMetadata(), Catalog_Namespace::SysCatalog::migrateDBAccessPrivileges(), Catalog_Namespace::Catalog::NoTableFoundException::NoTableFoundException(), numeric_type_name(), import_export::anonymous_namespace{Importer.cpp}::ogr_to_type(), Geospatial::GeoTypesError::OGRErrorToStr(), TableFunctions_Namespace::OneHotEncoder_Namespace::one_hot_encode(), 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(), TargetExprCodegenBuilder::operator()(), 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(), AlterTableAlterColumnCommand::prepareGeoColumns(), anonymous_namespace{Types.cpp}::process_poly_ring(), DictionaryValueConverter< TARGET_TYPE >::processBuffer(), foreign_storage::TextFileBufferParser::processGeoColumn(), query_template(), 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::reloadDictionariesFromDiskUnlocked(), Catalog_Namespace::Catalog::reloadForeignTableUnlocked(), 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(), Catalog_Namespace::Catalog::renamePhysicalTables(), DBHandler::replace_dashboard(), Catalog_Namespace::Catalog::replaceDashboard(), Catalog_Namespace::Catalog::restoreOldOwners(), Catalog_Namespace::Catalog::restoreOldOwnersInMemory(), TableArchiver::restoreTable(), ArrowResultSet::resultSetArrowLoopback(), Catalog_Namespace::SysCatalog::revokeAllOnDatabase_unsafe(), QueryRewriter::rewriteColumnarUpdate(), anonymous_namespace{TableArchiver.cpp}::run(), ExecutionKernel::runImpl(), Catalog_Namespace::SysCatalog::runUpdateQueriesAndChangeOwnership(), import_export::QueryExporter::safeColumnName(), 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(), Catalog_Namespace::Catalog::sqliteGetColumnsForTableUnlocked(), 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(), InputColDescriptor::toString(), HashTable::toString(), table_functions::TableFunctionOutputRowSizer::toString(), ColSlotContext::toString(), ExpressionRange::toString(), RexAbstractInput::toString(), anonymous_namespace{Datum.cpp}::toString(), toString(), DBObject::toString(), Analyzer::ColumnVar::toString(), Analyzer::Var::toString(), QueryMemoryDescriptor::toString(), RexOperator::toString(), Analyzer::UOper::toString(), SortField::toString(), Array< T >::toString(), Analyzer::InValues::toString(), Analyzer::InIntegerSet::toString(), RexRef::toString(), RexAgg::toString(), RexInput::toString(), Column< T >::toString(), Analyzer::LikelihoodExpr::toString(), flatbuffer::Column< Geo::MultiLineString, GeoMultiLineString >::toString(), Analyzer::ExtractExpr::toString(), Analyzer::DateaddExpr::toString(), RelAggregate::toString(), Analyzer::DatediffExpr::toString(), Analyzer::DatetruncExpr::toString(), flatbuffer::NestedArray< char >::toString(), RelJoin::toString(), Geo::Point2D::toString(), RelFilter::toString(), RelLeftDeepInnerJoin::toString(), RelCompound::toString(), RelSort::toString(), Column< GeoPoint >::toString(), RelModify::toString(), Column< TextEncodingDict >::toString(), ColumnList< T >::toString(), ColumnList< Array< T > >::toString(), RelTableFunction::toString(), ColumnList< TextEncodingDict >::toString(), Analyzer::OrderEntry::toString(), Analyzer::GeoTransformOperator::toString(), anonymous_namespace{HashJoin.cpp}::toStringFlat(), transform_point(), RelAlgTranslator::translateArrayFunction(), RelAlgTranslator::translateGeoFunctionArg(), RelAlgTranslator::translateHPTLiteral(), Executor::unregisterActiveModule(), anonymous_namespace{TableArchiver.cpp}::update_or_drop_column_ids_in_page_headers(), 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::Catalog::updateViewUnlocked(), Catalog_Namespace::UserMetadata::userLoggable(), DateDaysOverflowValidator::validate(), CommandLineOptions::validate(), Parser::validate_and_get_fragment_size(), 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().

130  {
131  return std::string(v);
132 }
template<>
std::string to_string ( std::string &&  v)

Definition at line 135 of file StringTransform.cpp.

135  {
136  return std::move(v);
137 }