OmniSciDB  8fa3bf436f
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parser::anonymous_namespace{ParserNode.cpp} Namespace Reference

Functions

bool expr_is_null (const Analyzer::Expr *expr)
 
bool bool_from_string_literal (const Parser::StringLiteral *str_literal)
 
void validate_shard_column_type (const ColumnDescriptor &cd)
 
size_t shard_column_index (const std::string &name, const std::list< ColumnDescriptor > &columns)
 
size_t sort_column_index (const std::string &name, const std::list< ColumnDescriptor > &columns)
 
void set_string_field (rapidjson::Value &obj, const std::string &field_name, const std::string &field_value, rapidjson::Document &document)
 
std::string serialize_key_metainfo (const ShardKeyDef *shard_key_def, const std::vector< SharedDictionaryDef > &shared_dict_defs)
 
template<typename LITERAL_TYPE , typename ASSIGNMENT , typename VALIDATE = DefaultValidate<LITERAL_TYPE>>
decltype(auto) get_property_value (const NameValueAssign *p, ASSIGNMENT op, VALIDATE validate=VALIDATE())
 
decltype(auto) get_storage_type (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_frag_size_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_frag_size_dataframe_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_max_chunk_size_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_max_chunk_size_dataframe_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_delimiter_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_header_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_page_size_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_max_rows_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_skip_rows_def (DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_partions_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_shard_count_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_vacuum_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_sort_column_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
decltype(auto) get_max_rollback_epochs_def (TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
 
void get_table_definitions (TableDescriptor &td, const std::unique_ptr< NameValueAssign > &p, const std::list< ColumnDescriptor > &columns)
 
void get_table_definitions_for_ctas (TableDescriptor &td, const std::unique_ptr< NameValueAssign > &p, const std::list< ColumnDescriptor > &columns)
 
void get_dataframe_definitions (DataframeTableDescriptor &df_td, const std::unique_ptr< NameValueAssign > &p, const std::list< ColumnDescriptor > &columns)
 
std::string generateUniqueTableName (std::string name)
 
void recordRename (SubstituteMap &sMap, std::string oldName, std::string newName)
 
std::string loadTable (Catalog_Namespace::Catalog &catalog, SubstituteMap &sMap, std::string tableName)
 
bool hasData (SubstituteMap &sMap, std::string tableName)
 
void checkNameSubstition (SubstituteMap &sMap)
 

Variables

static const std::map< const
std::string, const
TableDefFuncPtr
tableDefFuncMap
 
static const std::map< const
std::string, const
DataframeDefFuncPtr
dataframeDefFuncMap
 
static constexpr char constEMPTY_NAME {""}
 

Function Documentation

bool Parser::anonymous_namespace{ParserNode.cpp}::bool_from_string_literal ( const Parser::StringLiteral str_literal)

Definition at line 921 of file ParserNode.cpp.

References Parser::StringLiteral::get_stringval().

Referenced by Parser::CopyTableStmt::execute(), and Parser::ExportQueryStmt::parseOptions().

921  {
922  const std::string* s = str_literal->get_stringval();
923  if (*s == "t" || *s == "true" || *s == "T" || *s == "True") {
924  return true;
925  } else if (*s == "f" || *s == "false" || *s == "F" || *s == "False") {
926  return false;
927  } else {
928  throw std::runtime_error("Invalid string for boolean " + *s);
929  }
930 }
const std::string * get_stringval() const
Definition: ParserNode.h:136

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Parser::anonymous_namespace{ParserNode.cpp}::checkNameSubstition ( SubstituteMap &  sMap)

Definition at line 3962 of file ParserNode.cpp.

References EMPTY_NAME.

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

3962  {
3963  // Substition map should be clean at end of rename:
3964  // all items in map must (map to self) or (map to EMPTY_STRING) by end
3965 
3966  for (auto it : sMap) {
3967  if ((it.second) != EMPTY_NAME && (it.first) != (it.second)) {
3968  throw std::runtime_error(
3969  "Error: Attempted to overwrite and lose data in table: \'" + (it.first) + "\'");
3970  }
3971  }
3972 }
static constexpr char const * EMPTY_NAME

+ Here is the caller graph for this function:

bool Parser::anonymous_namespace{ParserNode.cpp}::expr_is_null ( const Analyzer::Expr expr)

Definition at line 913 of file ParserNode.cpp.

References Analyzer::Constant::get_is_null(), SQLTypeInfo::get_type(), Analyzer::Expr::get_type_info(), and kNULLT.

Referenced by Parser::CaseExpr::normalize().

913  {
914  if (expr->get_type_info().get_type() == kNULLT) {
915  return true;
916  }
917  const auto const_expr = dynamic_cast<const Analyzer::Constant*>(expr);
918  return const_expr && const_expr->get_is_null();
919 }
bool get_is_null() const
Definition: Analyzer.h:334
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:314
const SQLTypeInfo & get_type_info() const
Definition: Analyzer.h:78

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string Parser::anonymous_namespace{ParserNode.cpp}::generateUniqueTableName ( std::string  name)

Definition at line 3928 of file ParserNode.cpp.

References run_benchmark_import::result, and to_string().

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

3928  {
3929  // TODO - is there a "better" way to create a tmp name for the table
3930  std::time_t result = std::time(nullptr);
3931  return name + "_tmp" + std::to_string(result);
3932 }
string name
Definition: setup.in.py:72
std::string to_string(char const *&&v)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Parser::anonymous_namespace{ParserNode.cpp}::get_dataframe_definitions ( DataframeTableDescriptor df_td,
const std::unique_ptr< NameValueAssign > &  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2234 of file ParserNode.cpp.

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

2236  {
2237  const auto it =
2238  dataframeDefFuncMap.find(boost::to_lower_copy<std::string>(*p->get_name()));
2239  if (it == dataframeDefFuncMap.end()) {
2240  throw std::runtime_error(
2241  "Invalid CREATE DATAFRAME option " + *p->get_name() +
2242  ". Should be FRAGMENT_SIZE, MAX_CHUNK_SIZE, SKIP_ROWS, DELIMITER or HEADER.");
2243  }
2244  return it->second(df_td, p.get(), columns);
2245 }
static const std::map< const std::string, const DataframeDefFuncPtr > dataframeDefFuncMap

+ Here is the caller graph for this function:

decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_delimiter_def ( DataframeTableDescriptor df_td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2074 of file ParserNode.cpp.

2076  {
2077  return get_property_value<StringLiteral>(p, [&df_td](const auto val) {
2078  if (val.size() != 1) {
2079  throw std::runtime_error("Length of DELIMITER must be equal to 1.");
2080  }
2081  df_td.delimiter = val;
2082  });
2083 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_frag_size_dataframe_def ( DataframeTableDescriptor df_td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2052 of file ParserNode.cpp.

2054  {
2055  return get_property_value<IntLiteral>(
2056  p, [&df_td](const auto val) { df_td.maxFragRows = val; });
2057 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_frag_size_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2045 of file ParserNode.cpp.

2047  {
2048  return get_property_value<IntLiteral>(p,
2049  [&td](const auto val) { td.maxFragRows = val; });
2050 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_header_def ( DataframeTableDescriptor df_td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2085 of file ParserNode.cpp.

2087  {
2088  return get_property_value<StringLiteral>(p, [&df_td](const auto val) {
2089  if (val == "FALSE") {
2090  df_td.hasHeader = false;
2091  } else if (val == "TRUE") {
2092  df_td.hasHeader = true;
2093  } else {
2094  throw std::runtime_error("Option HEADER support only 'true' or 'false' values.");
2095  }
2096  });
2097 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_chunk_size_dataframe_def ( DataframeTableDescriptor df_td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2066 of file ParserNode.cpp.

2069  {
2070  return get_property_value<IntLiteral>(
2071  p, [&df_td](const auto val) { df_td.maxChunkSize = val; });
2072 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_chunk_size_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2059 of file ParserNode.cpp.

2061  {
2062  return get_property_value<IntLiteral>(p,
2063  [&td](const auto val) { td.maxChunkSize = val; });
2064 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_rollback_epochs_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2173 of file ParserNode.cpp.

2175  {
2176  auto assignment = [&td](const auto val) {
2177  td.maxRollbackEpochs =
2178  val < 0 ? -1 : val; // Anything < 0 means unlimited rollbacks. Note that 0
2179  // still means keeping a shadow copy of data/metdata
2180  // between epochs so bad writes can be rolled back
2181  };
2182  return get_property_value<IntLiteral, decltype(assignment), PositiveOrZeroValidate>(
2183  p, assignment);
2184 }
int32_t maxRollbackEpochs
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_max_rows_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2105 of file ParserNode.cpp.

2107  {
2108  return get_property_value<IntLiteral>(p, [&td](const auto val) { td.maxRows = val; });
2109 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_page_size_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2099 of file ParserNode.cpp.

2101  {
2102  return get_property_value<IntLiteral>(p,
2103  [&td](const auto val) { td.fragPageSize = val; });
2104 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_partions_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2118 of file ParserNode.cpp.

2120  {
2121  return get_property_value<StringLiteral>(p, [&td](const auto partitions_uc) {
2122  if (partitions_uc != "SHARDED" && partitions_uc != "REPLICATED") {
2123  throw std::runtime_error("PARTITIONS must be SHARDED or REPLICATED");
2124  }
2125  if (td.shardedColumnId != 0 && partitions_uc == "REPLICATED") {
2126  throw std::runtime_error(
2127  "A table cannot be sharded and replicated at the same time");
2128  };
2129  td.partitions = partitions_uc;
2130  });
2131 }
std::string partitions
template<typename LITERAL_TYPE , typename ASSIGNMENT , typename VALIDATE = DefaultValidate<LITERAL_TYPE>>
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_property_value ( const NameValueAssign *  p,
ASSIGNMENT  op,
VALIDATE  validate = VALIDATE() 
)

Definition at line 2030 of file ParserNode.cpp.

2032  {
2033  const auto val = validate(p);
2034  return op(val);
2035 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_shard_count_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2132 of file ParserNode.cpp.

References g_leaf_count.

2134  {
2135  if (!td.shardedColumnId) {
2136  throw std::runtime_error("SHARD KEY must be defined.");
2137  }
2138  return get_property_value<IntLiteral>(p, [&td](const auto shard_count) {
2139  if (g_leaf_count && shard_count % g_leaf_count) {
2140  throw std::runtime_error(
2141  "SHARD_COUNT must be a multiple of the number of leaves in the cluster.");
2142  }
2143  td.nShards = g_leaf_count ? shard_count / g_leaf_count : shard_count;
2144  if (!td.shardedColumnId && !td.nShards) {
2145  throw std::runtime_error(
2146  "Must specify the number of shards through the SHARD_COUNT option");
2147  };
2148  });
2149 }
size_t g_leaf_count
Definition: ParserNode.cpp:76
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_skip_rows_def ( DataframeTableDescriptor df_td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2111 of file ParserNode.cpp.

2113  {
2114  return get_property_value<IntLiteral>(
2115  p, [&df_td](const auto val) { df_td.skipRows = val; });
2116 }
decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_sort_column_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2162 of file ParserNode.cpp.

References sort_column_index().

2164  {
2165  return get_property_value<StringLiteral>(p, [&td, &columns](const auto sort_upper) {
2166  td.sortedColumnId = sort_column_index(sort_upper, columns);
2167  if (!td.sortedColumnId) {
2168  throw std::runtime_error("Specified sort column " + sort_upper + " doesn't exist");
2169  }
2170  });
2171 }
size_t sort_column_index(const std::string &name, const std::list< ColumnDescriptor > &columns)

+ Here is the call graph for this function:

decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_storage_type ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2037 of file ParserNode.cpp.

2039  {
2040  auto assignment = [&td](const auto val) { td.storageType = val; };
2041  return get_property_value<StringLiteral, decltype(assignment), CaseSensitiveValidate>(
2042  p, assignment);
2043 }
std::string storageType
void Parser::anonymous_namespace{ParserNode.cpp}::get_table_definitions ( TableDescriptor td,
const std::unique_ptr< NameValueAssign > &  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2198 of file ParserNode.cpp.

Referenced by Parser::CreateTableStmt::executeDryRun().

2200  {
2201  const auto it = tableDefFuncMap.find(boost::to_lower_copy<std::string>(*p->get_name()));
2202  if (it == tableDefFuncMap.end()) {
2203  throw std::runtime_error(
2204  "Invalid CREATE TABLE option " + *p->get_name() +
2205  ". Should be FRAGMENT_SIZE, MAX_CHUNK_SIZE, PAGE_SIZE, MAX_ROLLBACK_EPOCHS, "
2206  "MAX_ROWS, "
2207  "PARTITIONS, SHARD_COUNT, VACUUM, SORT_COLUMN, STORAGE_TYPE.");
2208  }
2209  return it->second(td, p.get(), columns);
2210 }
static const std::map< const std::string, const TableDefFuncPtr > tableDefFuncMap

+ Here is the caller graph for this function:

void Parser::anonymous_namespace{ParserNode.cpp}::get_table_definitions_for_ctas ( TableDescriptor td,
const std::unique_ptr< NameValueAssign > &  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2212 of file ParserNode.cpp.

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

2214  {
2215  const auto it = tableDefFuncMap.find(boost::to_lower_copy<std::string>(*p->get_name()));
2216  if (it == tableDefFuncMap.end()) {
2217  throw std::runtime_error(
2218  "Invalid CREATE TABLE AS option " + *p->get_name() +
2219  ". Should be FRAGMENT_SIZE, MAX_CHUNK_SIZE, PAGE_SIZE, MAX_ROLLBACK_EPOCHS, "
2220  "MAX_ROWS, "
2221  "PARTITIONS, SHARD_COUNT, VACUUM, SORT_COLUMN, STORAGE_TYPE or "
2222  "USE_SHARED_DICTIONARIES.");
2223  }
2224  return it->second(td, p.get(), columns);
2225 }
static const std::map< const std::string, const TableDefFuncPtr > tableDefFuncMap

+ Here is the caller graph for this function:

decltype(auto) Parser::anonymous_namespace{ParserNode.cpp}::get_vacuum_def ( TableDescriptor td,
const NameValueAssign *  p,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 2151 of file ParserNode.cpp.

2153  {
2154  return get_property_value<StringLiteral>(p, [&td](const auto vacuum_uc) {
2155  if (vacuum_uc != "IMMEDIATE" && vacuum_uc != "DELAYED") {
2156  throw std::runtime_error("VACUUM must be IMMEDIATE or DELAYED");
2157  }
2158  td.hasDeletedCol = boost::iequals(vacuum_uc, "IMMEDIATE") ? false : true;
2159  });
2160 }
bool Parser::anonymous_namespace{ParserNode.cpp}::hasData ( SubstituteMap &  sMap,
std::string  tableName 
)

Definition at line 3957 of file ParserNode.cpp.

References EMPTY_NAME.

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

3957  {
3958  // assumes loadTable has been previously called
3959  return (sMap[tableName] != EMPTY_NAME);
3960 }
static constexpr char const * EMPTY_NAME

+ Here is the caller graph for this function:

std::string Parser::anonymous_namespace{ParserNode.cpp}::loadTable ( Catalog_Namespace::Catalog catalog,
SubstituteMap &  sMap,
std::string  tableName 
)

Definition at line 3938 of file ParserNode.cpp.

References EMPTY_NAME, and Catalog_Namespace::Catalog::getMetadataForTable().

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

3940  {
3941  if (sMap.find(tableName) != sMap.end()) {
3942  if (sMap[tableName] == EMPTY_NAME)
3943  return tableName;
3944  return sMap[tableName];
3945  } else {
3946  // lookup table in src catalog
3947  const TableDescriptor* td = catalog.getMetadataForTable(tableName);
3948  if (td) {
3949  sMap[tableName] = tableName;
3950  } else {
3951  sMap[tableName] = EMPTY_NAME;
3952  }
3953  }
3954  return tableName;
3955 }
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
static constexpr char const * EMPTY_NAME

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Parser::anonymous_namespace{ParserNode.cpp}::recordRename ( SubstituteMap &  sMap,
std::string  oldName,
std::string  newName 
)

Definition at line 3934 of file ParserNode.cpp.

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

3934  {
3935  sMap[oldName] = newName;
3936 }

+ Here is the caller graph for this function:

std::string Parser::anonymous_namespace{ParserNode.cpp}::serialize_key_metainfo ( const ShardKeyDef *  shard_key_def,
const std::vector< SharedDictionaryDef > &  shared_dict_defs 
)

Definition at line 1997 of file ParserNode.cpp.

References Parser::ShardKeyDef::get_column(), and set_string_field().

Referenced by Parser::CreateDataframeStmt::execute(), Parser::CreateTableAsSelectStmt::execute(), and Parser::CreateTableStmt::executeDryRun().

1999  {
2000  rapidjson::Document document;
2001  auto& allocator = document.GetAllocator();
2002  rapidjson::Value arr(rapidjson::kArrayType);
2003  if (shard_key_def) {
2004  rapidjson::Value shard_key_obj(rapidjson::kObjectType);
2005  set_string_field(shard_key_obj, "type", "SHARD KEY", document);
2006  set_string_field(shard_key_obj, "name", shard_key_def->get_column(), document);
2007  arr.PushBack(shard_key_obj, allocator);
2008  }
2009  for (const auto& shared_dict_def : shared_dict_defs) {
2010  rapidjson::Value shared_dict_obj(rapidjson::kObjectType);
2011  set_string_field(shared_dict_obj, "type", "SHARED DICTIONARY", document);
2012  set_string_field(shared_dict_obj, "name", shared_dict_def.get_column(), document);
2014  shared_dict_obj, "foreign_table", shared_dict_def.get_foreign_table(), document);
2015  set_string_field(shared_dict_obj,
2016  "foreign_column",
2017  shared_dict_def.get_foreign_column(),
2018  document);
2019  arr.PushBack(shared_dict_obj, allocator);
2020  }
2021  rapidjson::StringBuffer buffer;
2022  rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
2023  arr.Accept(writer);
2024  return buffer.GetString();
2025 }
void set_string_field(rapidjson::Value &obj, const std::string &field_name, const std::string &field_value, rapidjson::Document &document)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Parser::anonymous_namespace{ParserNode.cpp}::set_string_field ( rapidjson::Value &  obj,
const std::string &  field_name,
const std::string &  field_value,
rapidjson::Document &  document 
)

Definition at line 1984 of file ParserNode.cpp.

Referenced by serialize_key_metainfo().

1987  {
1988  rapidjson::Value field_name_json_str;
1989  field_name_json_str.SetString(
1990  field_name.c_str(), field_name.size(), document.GetAllocator());
1991  rapidjson::Value field_value_json_str;
1992  field_value_json_str.SetString(
1993  field_value.c_str(), field_value.size(), document.GetAllocator());
1994  obj.AddMember(field_name_json_str, field_value_json_str, document.GetAllocator());
1995 }

+ Here is the caller graph for this function:

size_t Parser::anonymous_namespace{ParserNode.cpp}::shard_column_index ( const std::string &  name,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 1951 of file ParserNode.cpp.

References validate_shard_column_type().

Referenced by Parser::CreateTableStmt::executeDryRun().

1952  {
1953  size_t index = 1;
1954  for (const auto& cd : columns) {
1955  if (cd.columnName == name) {
1957  return index;
1958  }
1959  ++index;
1960  if (cd.columnType.is_geometry()) {
1961  index += cd.columnType.get_physical_cols();
1962  }
1963  }
1964  // Not found, return 0
1965  return 0;
1966 }
string name
Definition: setup.in.py:72
void validate_shard_column_type(const ColumnDescriptor &cd)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t Parser::anonymous_namespace{ParserNode.cpp}::sort_column_index ( const std::string &  name,
const std::list< ColumnDescriptor > &  columns 
)

Definition at line 1968 of file ParserNode.cpp.

Referenced by get_sort_column_def().

1969  {
1970  size_t index = 1;
1971  for (const auto& cd : columns) {
1972  if (boost::to_upper_copy<std::string>(cd.columnName) == name) {
1973  return index;
1974  }
1975  ++index;
1976  if (cd.columnType.is_geometry()) {
1977  index += cd.columnType.get_physical_cols();
1978  }
1979  }
1980  // Not found, return 0
1981  return 0;
1982 }
string name
Definition: setup.in.py:72

+ Here is the caller graph for this function:

void Parser::anonymous_namespace{ParserNode.cpp}::validate_shard_column_type ( const ColumnDescriptor cd)

Definition at line 1940 of file ParserNode.cpp.

References ColumnDescriptor::columnType, and kENCODING_DICT.

Referenced by shard_column_index().

1940  {
1941  const auto& col_ti = cd.columnType;
1942  if (col_ti.is_integer() ||
1943  (col_ti.is_string() && col_ti.get_compression() == kENCODING_DICT) ||
1944  col_ti.is_time()) {
1945  return;
1946  }
1947  throw std::runtime_error("Cannot shard on type " + col_ti.get_type_name() +
1948  ", encoding " + col_ti.get_compression_name());
1949 }
SQLTypeInfo columnType

+ Here is the caller graph for this function:

Variable Documentation

const std::map<const std::string, const DataframeDefFuncPtr> Parser::anonymous_namespace{ParserNode.cpp}::dataframeDefFuncMap
static
Initial value:
=
{{"fragment_size"s, get_frag_size_dataframe_def},
{"max_chunk_size"s, get_max_chunk_size_dataframe_def},
{"skip_rows"s, get_skip_rows_def},
{"delimiter"s, get_delimiter_def},
{"header"s, get_header_def}}
decltype(auto) get_skip_rows_def(DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_header_def(DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_max_chunk_size_dataframe_def(DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_frag_size_dataframe_def(DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_delimiter_def(DataframeTableDescriptor &df_td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)

Definition at line 2227 of file ParserNode.cpp.

constexpr char const* Parser::anonymous_namespace{ParserNode.cpp}::EMPTY_NAME {""}
static
const std::map<const std::string, const TableDefFuncPtr> Parser::anonymous_namespace{ParserNode.cpp}::tableDefFuncMap
static
Initial value:
= {
{"fragment_size"s, get_frag_size_def},
{"max_chunk_size"s, get_max_chunk_size_def},
{"page_size"s, get_page_size_def},
{"max_rows"s, get_max_rows_def},
{"partitions"s, get_partions_def},
{"shard_count"s, get_shard_count_def},
{"vacuum"s, get_vacuum_def},
{"sort_column"s, get_sort_column_def},
{"storage_type"s, get_storage_type},
{"max_rollback_epochs", get_max_rollback_epochs_def}}
decltype(auto) get_max_rows_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_max_chunk_size_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_vacuum_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_shard_count_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_sort_column_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_frag_size_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_partions_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_page_size_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_max_rollback_epochs_def(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)
decltype(auto) get_storage_type(TableDescriptor &td, const NameValueAssign *p, const std::list< ColumnDescriptor > &columns)

Definition at line 2186 of file ParserNode.cpp.