OmniSciDB  a667adc9c8
 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 920 of file ParserNode.cpp.

References Parser::StringLiteral::get_stringval().

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

920  {
921  const std::string* s = str_literal->get_stringval();
922  if (*s == "t" || *s == "true" || *s == "T" || *s == "True") {
923  return true;
924  } else if (*s == "f" || *s == "false" || *s == "F" || *s == "False") {
925  return false;
926  } else {
927  throw std::runtime_error("Invalid string for boolean " + *s);
928  }
929 }
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 3772 of file ParserNode.cpp.

References EMPTY_NAME.

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

3772  {
3773  // Substition map should be clean at end of rename:
3774  // all items in map must (map to self) or (map to EMPTY_STRING) by end
3775 
3776  for (auto it : sMap) {
3777  if ((it.second) != EMPTY_NAME && (it.first) != (it.second)) {
3778  throw std::runtime_error(
3779  "Error: Attempted to overwrite and lose data in table: \'" + (it.first) + "\'");
3780  }
3781  }
3782 }
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 912 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().

912  {
913  if (expr->get_type_info().get_type() == kNULLT) {
914  return true;
915  }
916  const auto const_expr = dynamic_cast<const Analyzer::Constant*>(expr);
917  return const_expr && const_expr->get_is_null();
918 }
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 3738 of file ParserNode.cpp.

References run_benchmark_import::result, and to_string().

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

3738  {
3739  // TODO - is there a "better" way to create a tmp name for the table
3740  std::time_t result = std::time(nullptr);
3741  return name + "_tmp" + std::to_string(result);
3742 }
string name
Definition: setup.in.py:62
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 2233 of file ParserNode.cpp.

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

2235  {
2236  const auto it =
2237  dataframeDefFuncMap.find(boost::to_lower_copy<std::string>(*p->get_name()));
2238  if (it == dataframeDefFuncMap.end()) {
2239  throw std::runtime_error(
2240  "Invalid CREATE DATAFRAME option " + *p->get_name() +
2241  ". Should be FRAGMENT_SIZE, MAX_CHUNK_SIZE, SKIP_ROWS, DELIMITER or HEADER.");
2242  }
2243  return it->second(df_td, p.get(), columns);
2244 }
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 2073 of file ParserNode.cpp.

2075  {
2076  return get_property_value<StringLiteral>(p, [&df_td](const auto val) {
2077  if (val.size() != 1) {
2078  throw std::runtime_error("Length of DELIMITER must be equal to 1.");
2079  }
2080  df_td.delimiter = val;
2081  });
2082 }
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 2051 of file ParserNode.cpp.

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

Definition at line 2044 of file ParserNode.cpp.

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

Definition at line 2084 of file ParserNode.cpp.

2086  {
2087  return get_property_value<StringLiteral>(p, [&df_td](const auto val) {
2088  if (val == "FALSE") {
2089  df_td.hasHeader = false;
2090  } else if (val == "TRUE") {
2091  df_td.hasHeader = true;
2092  } else {
2093  throw std::runtime_error("Option HEADER support only 'true' or 'false' values.");
2094  }
2095  });
2096 }
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 2065 of file ParserNode.cpp.

2068  {
2069  return get_property_value<IntLiteral>(
2070  p, [&df_td](const auto val) { df_td.maxChunkSize = val; });
2071 }
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 2058 of file ParserNode.cpp.

2060  {
2061  return get_property_value<IntLiteral>(p,
2062  [&td](const auto val) { td.maxChunkSize = val; });
2063 }
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 2172 of file ParserNode.cpp.

2174  {
2175  auto assignment = [&td](const auto val) {
2176  td.maxRollbackEpochs =
2177  val < 0 ? -1 : val; // Anything < 0 means unlimited rollbacks. Note that 0
2178  // still means keeping a shadow copy of data/metdata
2179  // between epochs so bad writes can be rolled back
2180  };
2181  return get_property_value<IntLiteral, decltype(assignment), PositiveOrZeroValidate>(
2182  p, assignment);
2183 }
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 2104 of file ParserNode.cpp.

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

Definition at line 2098 of file ParserNode.cpp.

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

Definition at line 2117 of file ParserNode.cpp.

2119  {
2120  return get_property_value<StringLiteral>(p, [&td](const auto partitions_uc) {
2121  if (partitions_uc != "SHARDED" && partitions_uc != "REPLICATED") {
2122  throw std::runtime_error("PARTITIONS must be SHARDED or REPLICATED");
2123  }
2124  if (td.shardedColumnId != 0 && partitions_uc == "REPLICATED") {
2125  throw std::runtime_error(
2126  "A table cannot be sharded and replicated at the same time");
2127  };
2128  td.partitions = partitions_uc;
2129  });
2130 }
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 2029 of file ParserNode.cpp.

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

Definition at line 2131 of file ParserNode.cpp.

References g_leaf_count.

2133  {
2134  if (!td.shardedColumnId) {
2135  throw std::runtime_error("SHARD KEY must be defined.");
2136  }
2137  return get_property_value<IntLiteral>(p, [&td](const auto shard_count) {
2138  if (g_leaf_count && shard_count % g_leaf_count) {
2139  throw std::runtime_error(
2140  "SHARD_COUNT must be a multiple of the number of leaves in the cluster.");
2141  }
2142  td.nShards = g_leaf_count ? shard_count / g_leaf_count : shard_count;
2143  if (!td.shardedColumnId && !td.nShards) {
2144  throw std::runtime_error(
2145  "Must specify the number of shards through the SHARD_COUNT option");
2146  };
2147  });
2148 }
size_t g_leaf_count
Definition: ParserNode.cpp:75
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 2110 of file ParserNode.cpp.

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

Definition at line 2161 of file ParserNode.cpp.

References sort_column_index().

2163  {
2164  return get_property_value<StringLiteral>(p, [&td, &columns](const auto sort_upper) {
2165  td.sortedColumnId = sort_column_index(sort_upper, columns);
2166  if (!td.sortedColumnId) {
2167  throw std::runtime_error("Specified sort column " + sort_upper + " doesn't exist");
2168  }
2169  });
2170 }
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 2036 of file ParserNode.cpp.

2038  {
2039  auto assignment = [&td](const auto val) { td.storageType = val; };
2040  return get_property_value<StringLiteral, decltype(assignment), CaseSensitiveValidate>(
2041  p, assignment);
2042 }
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 2197 of file ParserNode.cpp.

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

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

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

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

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

Definition at line 3767 of file ParserNode.cpp.

References EMPTY_NAME.

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

3767  {
3768  // assumes loadTable has been previously called
3769  return (sMap[tableName] != EMPTY_NAME);
3770 }
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 3748 of file ParserNode.cpp.

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

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

3750  {
3751  if (sMap.find(tableName) != sMap.end()) {
3752  if (sMap[tableName] == EMPTY_NAME)
3753  return tableName;
3754  return sMap[tableName];
3755  } else {
3756  // lookup table in src catalog
3757  const TableDescriptor* td = catalog.getMetadataForTable(tableName);
3758  if (td) {
3759  sMap[tableName] = tableName;
3760  } else {
3761  sMap[tableName] = EMPTY_NAME;
3762  }
3763  }
3764  return tableName;
3765 }
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 3744 of file ParserNode.cpp.

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

3744  {
3745  sMap[oldName] = newName;
3746 }

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

1998  {
1999  rapidjson::Document document;
2000  auto& allocator = document.GetAllocator();
2001  rapidjson::Value arr(rapidjson::kArrayType);
2002  if (shard_key_def) {
2003  rapidjson::Value shard_key_obj(rapidjson::kObjectType);
2004  set_string_field(shard_key_obj, "type", "SHARD KEY", document);
2005  set_string_field(shard_key_obj, "name", shard_key_def->get_column(), document);
2006  arr.PushBack(shard_key_obj, allocator);
2007  }
2008  for (const auto& shared_dict_def : shared_dict_defs) {
2009  rapidjson::Value shared_dict_obj(rapidjson::kObjectType);
2010  set_string_field(shared_dict_obj, "type", "SHARED DICTIONARY", document);
2011  set_string_field(shared_dict_obj, "name", shared_dict_def.get_column(), document);
2013  shared_dict_obj, "foreign_table", shared_dict_def.get_foreign_table(), document);
2014  set_string_field(shared_dict_obj,
2015  "foreign_column",
2016  shared_dict_def.get_foreign_column(),
2017  document);
2018  arr.PushBack(shared_dict_obj, allocator);
2019  }
2020  rapidjson::StringBuffer buffer;
2021  rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
2022  arr.Accept(writer);
2023  return buffer.GetString();
2024 }
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 1983 of file ParserNode.cpp.

Referenced by serialize_key_metainfo().

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

+ 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 1950 of file ParserNode.cpp.

References validate_shard_column_type().

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

1951  {
1952  size_t index = 1;
1953  for (const auto& cd : columns) {
1954  if (cd.columnName == name) {
1956  return index;
1957  }
1958  ++index;
1959  if (cd.columnType.is_geometry()) {
1960  index += cd.columnType.get_physical_cols();
1961  }
1962  }
1963  // Not found, return 0
1964  return 0;
1965 }
string name
Definition: setup.in.py:62
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 1967 of file ParserNode.cpp.

Referenced by get_sort_column_def().

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

+ Here is the caller graph for this function:

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

Definition at line 1939 of file ParserNode.cpp.

References ColumnDescriptor::columnType, and kENCODING_DICT.

Referenced by shard_column_index().

1939  {
1940  const auto& col_ti = cd.columnType;
1941  if (col_ti.is_integer() ||
1942  (col_ti.is_string() && col_ti.get_compression() == kENCODING_DICT) ||
1943  col_ti.is_time()) {
1944  return;
1945  }
1946  throw std::runtime_error("Cannot shard on type " + col_ti.get_type_name() +
1947  ", encoding " + col_ti.get_compression_name());
1948 }
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 2226 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 2185 of file ParserNode.cpp.