OmniSciDB  a5dc49c757
 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 <numeric>
#include <random>
#include <regex>
#include <cmath>
#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, std::vector< std::pair< size_t, size_t >> const &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 31 of file StringTransform.cpp.

References find_string_literals(), and inside_string_literal().

Referenced by pg_shim().

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

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

References CHECK_GT.

Referenced by apply_shim().

57  {
58  boost::regex literal_string_regex{R"(([^']+)('(?:[^']+|'')*'))", boost::regex::perl};
59  boost::smatch what;
60  auto it = query.begin();
61  auto prev_it = it;
62  std::vector<std::pair<size_t, size_t>> positions;
63  while (true) {
64  try {
65  if (!boost::regex_search(it, query.end(), what, literal_string_regex)) {
66  break;
67  }
68  } catch (const std::exception& e) {
69  // boost::regex throws an exception about the complexity of matching when
70  // the wrong type of quotes are used or they're mismatched. Let the query
71  // through unmodified, the parser will throw a much more informative error.
72  // This can also throw on very long queries
73  std::ostringstream oss;
74  oss << "Detecting an error while processing string literal regex search: "
75  << e.what();
76  throw std::runtime_error(oss.str());
77  }
78  CHECK_GT(what[1].length(), 0);
79  prev_it = it;
80  it += what.length();
81  positions.emplace_back(prev_it + what[1].length() - query.begin(),
82  it - query.begin());
83  }
84  return positions;
85 }
#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 102 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().

102  {
103  const size_t units_per_k_unit{1024};
104  const std::vector<std::string> byte_units = {" bytes", "KB", "MB", "GB", "TB", "PB"};
105  const std::vector<size_t> bytes_per_scale_unit = {size_t(1),
106  size_t(1) << 10,
107  size_t(1) << 20,
108  size_t(1) << 30,
109  size_t(1) << 40,
110  size_t(1) << 50,
111  size_t(1) << 60};
112  if (bytes < units_per_k_unit) {
113  return std::to_string(bytes) + " bytes";
114  }
115  CHECK_GE(bytes, units_per_k_unit);
116  const size_t byte_scale = log(bytes) / log(units_per_k_unit);
117  CHECK_GE(byte_scale, size_t(1));
118  CHECK_LE(byte_scale, size_t(5));
119  const size_t scaled_bytes_left_of_decimal = bytes / bytes_per_scale_unit[byte_scale];
120  const size_t scaled_bytes_right_of_decimal = bytes % bytes_per_scale_unit[byte_scale];
121  const size_t fractional_digits = static_cast<double>(scaled_bytes_right_of_decimal) /
122  bytes_per_scale_unit[byte_scale] * 100.;
123  return std::to_string(scaled_bytes_left_of_decimal) + "." +
124  std::to_string(fractional_digits) + " " + byte_units[byte_scale];
125 }
#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 150 of file StringTransform.cpp.

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

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

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

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

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

+ Here is the caller graph for this function:

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

Definition at line 87 of file StringTransform.cpp.

References gpu_enabled::accumulate().

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

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

Definition at line 233 of file StringTransform.cpp.

Referenced by apply_shim().

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

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

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

simple sanitize string (replace control characters with space)

Definition at line 296 of file StringTransform.cpp.

296  {
297  auto sanitized_str{str};
298  for (auto& c : sanitized_str) {
299  c = (c < 32) ? ' ' : c;
300  }
301  return sanitized_str;
302 }
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 171 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().

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

+ 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 229 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().

229  {
230  return std::string(sv_strip(str));
231 }
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 137 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().

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

+ Here is the caller graph for this function:

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

return trimmed string_view

Definition at line 220 of file StringTransform.cpp.

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

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

+ Here is the caller graph for this function:

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

Definition at line 128 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(), Parser::anonymous_namespace{ParserNode.cpp}::get_page_size_def(), 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< T >::getClusterTableMutex(), Parser::LocalQueryConnector::getColumnDescriptors(), getCurrentStackTrace(), Catalog_Namespace::Catalog::getCustomExpressionFromStorage(), DataRecyclerUtil::getDeviceIdentifierString(), CudaMgr_Namespace::CudaMgr::getDeviceProperties(), anonymous_namespace{RelAlgExecutor.cpp}::getErrorDescription(), 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(), pg_shim(), foreign_storage::ParquetDataWrapper::populateChunkBuffers(), 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(), QueryExecutionError::toString(), InputColDescriptor::toString(), HashTable::toString(), table_functions::TableFunctionOutputRowSizer::toString(), ColSlotContext::toString(), ExpressionRange::toString(), RexAbstractInput::toString(), anonymous_namespace{Datum.cpp}::toString(), toString(), Analyzer::ColumnVar::toString(), DBObject::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().

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

Definition at line 133 of file StringTransform.cpp.

133  {
134  return std::move(v);
135 }