OmniSciDB  d2f719934e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser::InsertValuesStmt Class Reference

#include <ParserNode.h>

+ Inheritance diagram for Parser::InsertValuesStmt:
+ Collaboration diagram for Parser::InsertValuesStmt:

Public Member Functions

 InsertValuesStmt (std::string *t, std::list< std::string * > *c, std::list< Expr * > *v)
 
const std::list
< std::unique_ptr< Expr > > & 
get_value_list () const
 
void analyze (const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
 
size_t determineLeafIndex (const Catalog_Namespace::Catalog &catalog, size_t num_leafs)
 
void execute (const Catalog_Namespace::SessionInfo &session)
 
- Public Member Functions inherited from Parser::InsertStmt
 InsertStmt (std::string *t, std::list< std::string * > *c)
 
const std::string * get_table () const
 
const std::list
< std::unique_ptr< std::string > > & 
get_column_list () const
 
- Public Member Functions inherited from Parser::Node
virtual ~Node ()
 

Private Attributes

std::list< std::unique_ptr
< Expr > > 
value_list_
 

Additional Inherited Members

- Protected Attributes inherited from Parser::InsertStmt
std::unique_ptr< std::string > table_
 
std::list< std::unique_ptr
< std::string > > 
column_list_
 

Detailed Description

Definition at line 2055 of file ParserNode.h.

Constructor & Destructor Documentation

Parser::InsertValuesStmt::InsertValuesStmt ( std::string *  t,
std::list< std::string * > *  c,
std::list< Expr * > *  v 
)
inline

Definition at line 2057 of file ParserNode.h.

References CHECK, and value_list_.

2058  : InsertStmt(t, c) {
2059  CHECK(v);
2060  for (const auto e : *v) {
2061  value_list_.emplace_back(e);
2062  }
2063  delete v;
2064  }
InsertStmt(std::string *t, std::list< std::string * > *c)
Definition: ParserNode.h:2031
std::list< std::unique_ptr< Expr > > value_list_
Definition: ParserNode.h:2074
#define CHECK(condition)
Definition: Logger.h:211
char * t

Member Function Documentation

void Parser::InsertValuesStmt::analyze ( const Catalog_Namespace::Catalog catalog,
Analyzer::Query query 
) const
overridevirtual

Implements Parser::InsertStmt.

Definition at line 1799 of file ParserNode.cpp.

References CHECK, CHECK_EQ, ColumnDescriptor::columnId, ColumnDescriptor::columnName, ColumnDescriptor::columnType, Geospatial::compress_coords(), Datum::doubleval, SQLTypeInfo::get_notnull(), Analyzer::Query::get_result_col_list(), Analyzer::Query::get_result_table_id(), SQLTypeInfo::get_subtype(), Analyzer::Query::get_targetlist_nonconst(), SQLTypeInfo::get_type(), Catalog_Namespace::Catalog::getAllColumnMetadataForTable(), Geospatial::GeoTypesFactory::getGeoColumns(), Catalog_Namespace::Catalog::getMetadataForColumn(), Datum::intval, SQLTypeInfo::is_geometry(), is_null(), kARRAY, kCAST, kDOUBLE, kINT, kLINESTRING, kMULTIPOLYGON, kPOINT, kPOLYGON, kTINYINT, NULL_ARRAY_DOUBLE, NULL_DOUBLE, and Datum::tinyintval.

1800  {
1801  InsertStmt::analyze(catalog, query);
1802  std::vector<std::shared_ptr<Analyzer::TargetEntry>>& tlist =
1803  query.get_targetlist_nonconst();
1804  const auto tableId = query.get_result_table_id();
1805  if (!column_list_.empty()) {
1806  if (value_list_.size() != column_list_.size()) {
1807  throw std::runtime_error(
1808  "Numbers of columns and values don't match for the "
1809  "insert.");
1810  }
1811  } else {
1812  const std::list<const ColumnDescriptor*> non_phys_cols =
1813  catalog.getAllColumnMetadataForTable(tableId, false, false, false);
1814  if (non_phys_cols.size() != value_list_.size()) {
1815  throw std::runtime_error(
1816  "Number of columns in table does not match the list of values given in the "
1817  "insert.");
1818  }
1819  }
1820  std::list<int>::const_iterator it = query.get_result_col_list().begin();
1821  for (auto& v : value_list_) {
1822  auto e = v->analyze(catalog, query);
1823  const ColumnDescriptor* cd =
1824  catalog.getMetadataForColumn(query.get_result_table_id(), *it);
1825  CHECK(cd);
1826  if (cd->columnType.get_notnull()) {
1827  auto c = std::dynamic_pointer_cast<Analyzer::Constant>(e);
1828  if (c != nullptr && c->get_is_null()) {
1829  throw std::runtime_error("Cannot insert NULL into column " + cd->columnName);
1830  }
1831  }
1832  e = e->add_cast(cd->columnType);
1833  tlist.emplace_back(new Analyzer::TargetEntry("", e, false));
1834  ++it;
1835 
1836  const auto& col_ti = cd->columnType;
1837  if (col_ti.get_physical_cols() > 0) {
1838  CHECK(cd->columnType.is_geometry());
1839  auto c = dynamic_cast<const Analyzer::Constant*>(e.get());
1840  if (!c) {
1841  auto uoper = std::dynamic_pointer_cast<Analyzer::UOper>(e);
1842  if (uoper && uoper->get_optype() == kCAST) {
1843  c = dynamic_cast<const Analyzer::Constant*>(uoper->get_operand());
1844  }
1845  }
1846  bool is_null = false;
1847  std::string* geo_string{nullptr};
1848  if (c) {
1849  is_null = c->get_is_null();
1850  if (!is_null) {
1851  geo_string = c->get_constval().stringval;
1852  }
1853  }
1854  if (!is_null && !geo_string) {
1855  throw std::runtime_error("Expecting a WKT or WKB hex string for column " +
1856  cd->columnName);
1857  }
1858  std::vector<double> coords;
1859  std::vector<double> bounds;
1860  std::vector<int> ring_sizes;
1861  std::vector<int> poly_rings;
1862  int render_group =
1863  0; // @TODO simon.eves where to get render_group from in this context?!
1864  SQLTypeInfo import_ti{cd->columnType};
1865  if (!is_null) {
1867  *geo_string, import_ti, coords, bounds, ring_sizes, poly_rings)) {
1868  throw std::runtime_error("Cannot read geometry to insert into column " +
1869  cd->columnName);
1870  }
1871  if (coords.empty()) {
1872  // Importing from geo_string WKT resulted in empty coords: dealing with a NULL
1873  is_null = true;
1874  }
1875  if (cd->columnType.get_type() != import_ti.get_type()) {
1876  // allow POLYGON to be inserted into MULTIPOLYGON column
1877  if (!(import_ti.get_type() == SQLTypes::kPOLYGON &&
1879  throw std::runtime_error(
1880  "Imported geometry doesn't match the type of column " + cd->columnName);
1881  }
1882  }
1883  } else {
1884  // Special case for NULL POINT, push NULL representation to coords
1885  if (cd->columnType.get_type() == kPOINT) {
1886  if (!coords.empty()) {
1887  throw std::runtime_error("NULL POINT with unexpected coordinates in column " +
1888  cd->columnName);
1889  }
1890  coords.push_back(NULL_ARRAY_DOUBLE);
1891  coords.push_back(NULL_DOUBLE);
1892  }
1893  }
1894 
1895  // TODO: check if import SRID matches columns SRID, may need to transform before
1896  // inserting
1897 
1898  int nextColumnOffset = 1;
1899 
1900  const ColumnDescriptor* cd_coords = catalog.getMetadataForColumn(
1901  query.get_result_table_id(), cd->columnId + nextColumnOffset);
1902  CHECK(cd_coords);
1903  CHECK_EQ(cd_coords->columnType.get_type(), kARRAY);
1904  CHECK_EQ(cd_coords->columnType.get_subtype(), kTINYINT);
1905  std::list<std::shared_ptr<Analyzer::Expr>> value_exprs;
1906  if (!is_null || cd->columnType.get_type() == kPOINT) {
1907  auto compressed_coords = Geospatial::compress_coords(coords, col_ti);
1908  for (auto cc : compressed_coords) {
1909  Datum d;
1910  d.tinyintval = cc;
1911  auto e = makeExpr<Analyzer::Constant>(kTINYINT, false, d);
1912  value_exprs.push_back(e);
1913  }
1914  }
1915  tlist.emplace_back(new Analyzer::TargetEntry(
1916  "",
1917  makeExpr<Analyzer::Constant>(cd_coords->columnType, is_null, value_exprs),
1918  false));
1919  ++it;
1920  nextColumnOffset++;
1921 
1922  if (cd->columnType.get_type() == kPOLYGON ||
1923  cd->columnType.get_type() == kMULTIPOLYGON) {
1924  // Put ring sizes array into separate physical column
1925  const ColumnDescriptor* cd_ring_sizes = catalog.getMetadataForColumn(
1926  query.get_result_table_id(), cd->columnId + nextColumnOffset);
1927  CHECK(cd_ring_sizes);
1928  CHECK_EQ(cd_ring_sizes->columnType.get_type(), kARRAY);
1929  CHECK_EQ(cd_ring_sizes->columnType.get_subtype(), kINT);
1930  std::list<std::shared_ptr<Analyzer::Expr>> value_exprs;
1931  if (!is_null) {
1932  for (auto c : ring_sizes) {
1933  Datum d;
1934  d.intval = c;
1935  auto e = makeExpr<Analyzer::Constant>(kINT, false, d);
1936  value_exprs.push_back(e);
1937  }
1938  }
1939  tlist.emplace_back(new Analyzer::TargetEntry(
1940  "",
1941  makeExpr<Analyzer::Constant>(cd_ring_sizes->columnType, is_null, value_exprs),
1942  false));
1943  ++it;
1944  nextColumnOffset++;
1945 
1946  if (cd->columnType.get_type() == kMULTIPOLYGON) {
1947  // Put poly_rings array into separate physical column
1948  const ColumnDescriptor* cd_poly_rings = catalog.getMetadataForColumn(
1949  query.get_result_table_id(), cd->columnId + nextColumnOffset);
1950  CHECK(cd_poly_rings);
1951  CHECK_EQ(cd_poly_rings->columnType.get_type(), kARRAY);
1952  CHECK_EQ(cd_poly_rings->columnType.get_subtype(), kINT);
1953  std::list<std::shared_ptr<Analyzer::Expr>> value_exprs;
1954  if (!is_null) {
1955  for (auto c : poly_rings) {
1956  Datum d;
1957  d.intval = c;
1958  auto e = makeExpr<Analyzer::Constant>(kINT, false, d);
1959  value_exprs.push_back(e);
1960  }
1961  }
1962  tlist.emplace_back(new Analyzer::TargetEntry(
1963  "",
1964  makeExpr<Analyzer::Constant>(
1965  cd_poly_rings->columnType, is_null, value_exprs),
1966  false));
1967  ++it;
1968  nextColumnOffset++;
1969  }
1970  }
1971 
1972  if (cd->columnType.get_type() == kLINESTRING ||
1973  cd->columnType.get_type() == kPOLYGON ||
1974  cd->columnType.get_type() == kMULTIPOLYGON) {
1975  const ColumnDescriptor* cd_bounds = catalog.getMetadataForColumn(
1976  query.get_result_table_id(), cd->columnId + nextColumnOffset);
1977  CHECK(cd_bounds);
1978  CHECK_EQ(cd_bounds->columnType.get_type(), kARRAY);
1979  CHECK_EQ(cd_bounds->columnType.get_subtype(), kDOUBLE);
1980  std::list<std::shared_ptr<Analyzer::Expr>> value_exprs;
1981  if (!is_null) {
1982  for (auto b : bounds) {
1983  Datum d;
1984  d.doubleval = b;
1985  auto e = makeExpr<Analyzer::Constant>(kDOUBLE, false, d);
1986  value_exprs.push_back(e);
1987  }
1988  }
1989  tlist.emplace_back(new Analyzer::TargetEntry(
1990  "",
1991  makeExpr<Analyzer::Constant>(cd_bounds->columnType, is_null, value_exprs),
1992  false));
1993  ++it;
1994  nextColumnOffset++;
1995  }
1996 
1997  if (cd->columnType.get_type() == kPOLYGON ||
1998  cd->columnType.get_type() == kMULTIPOLYGON) {
1999  // Put render group into separate physical column
2000  const ColumnDescriptor* cd_render_group = catalog.getMetadataForColumn(
2001  query.get_result_table_id(), cd->columnId + nextColumnOffset);
2002  CHECK(cd_render_group);
2003  CHECK_EQ(cd_render_group->columnType.get_type(), kINT);
2004  Datum d;
2005  d.intval = render_group;
2006  tlist.emplace_back(new Analyzer::TargetEntry(
2007  "",
2008  makeExpr<Analyzer::Constant>(cd_render_group->columnType, is_null, d),
2009  false));
2010  ++it;
2011  nextColumnOffset++;
2012  }
2013  }
2014  }
2015 }
int8_t tinyintval
Definition: sqltypes.h:212
HOST DEVICE SQLTypes get_subtype() const
Definition: sqltypes.h:330
#define CHECK_EQ(x, y)
Definition: Logger.h:219
#define NULL_DOUBLE
Definition: Analyzer.h:1733
Definition: sqldefs.h:49
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override=0
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
int32_t intval
Definition: sqltypes.h:214
std::vector< uint8_t > compress_coords(const std::vector< double > &coords, const SQLTypeInfo &ti)
Definition: Compression.cpp:52
CONSTEXPR DEVICE bool is_null(const T &value)
std::list< std::unique_ptr< Expr > > value_list_
Definition: ParserNode.h:2074
const ColumnDescriptor * getMetadataForColumn(int tableId, const std::string &colName) const
specifies the content in-memory of a row in the column metadata table
int get_result_table_id() const
Definition: Analyzer.h:1792
static bool getGeoColumns(const std::string &wkt_or_wkb_hex, SQLTypeInfo &ti, std::vector< double > &coords, std::vector< double > &bounds, std::vector< int > &ring_sizes, std::vector< int > &poly_rings, const bool promote_poly_to_mpoly=false)
Definition: Types.cpp:937
std::vector< std::shared_ptr< TargetEntry > > & get_targetlist_nonconst()
Definition: Analyzer.h:1779
std::list< const ColumnDescriptor * > getAllColumnMetadataForTable(const int tableId, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular...
Definition: Catalog.cpp:1811
std::list< std::unique_ptr< std::string > > column_list_
Definition: ParserNode.h:2048
#define NULL_ARRAY_DOUBLE
#define CHECK(condition)
Definition: Logger.h:211
bool is_geometry() const
Definition: sqltypes.h:531
Definition: sqltypes.h:45
SQLTypeInfo columnType
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:336
const std::list< int > & get_result_col_list() const
Definition: Analyzer.h:1793
std::string columnName
double doubleval
Definition: sqltypes.h:217

+ Here is the call graph for this function:

size_t Parser::InsertValuesStmt::determineLeafIndex ( const Catalog_Namespace::Catalog catalog,
size_t  num_leafs 
)

Definition at line 1688 of file ParserNode.cpp.

References Datum::bigintval, CHECK, CHECK_EQ, ColumnDescriptor::columnName, ColumnDescriptor::columnType, run_benchmark_import::con, SQLTypeInfo::get_comp_param(), Analyzer::Constant::get_constval(), Analyzer::Constant::get_is_null(), SQLTypeInfo::get_logical_size(), SQLTypeInfo::get_size(), Catalog_Namespace::Catalog::getAllColumnMetadataForTable(), Catalog_Namespace::Catalog::getMetadataForDict(), Catalog_Namespace::Catalog::getMetadataForTable(), Catalog_Namespace::Catalog::getShardColumnMetadataForTable(), inline_fixed_encoding_null_val(), Datum::intval, SQLTypeInfo::is_string(), TableDescriptor::isView, kCAST, TableDescriptor::nShards, TableDescriptor::partitions, SHARD_FOR_KEY, Datum::smallintval, DictDescriptor::stringDict, Datum::stringval, TableDescriptor::tableId, Datum::tinyintval, and foreign_storage::validate_non_foreign_table_write().

1689  {
1690  const TableDescriptor* td = catalog.getMetadataForTable(*table_);
1691  if (td == nullptr) {
1692  throw std::runtime_error("Table " + *table_ + " does not exist.");
1693  }
1694  if (td->isView) {
1695  throw std::runtime_error("Insert to views is not supported yet.");
1696  }
1698  if (td->partitions == "REPLICATED") {
1699  throw std::runtime_error("Cannot determine leaf on replicated table.");
1700  }
1701 
1702  if (0 == td->nShards) {
1703  std::random_device rd;
1704  std::mt19937_64 gen(rd());
1705  std::uniform_int_distribution<size_t> dis;
1706  const auto leaf_idx = dis(gen) % num_leafs;
1707  return leaf_idx;
1708  }
1709 
1710  size_t indexOfShardColumn = 0;
1711  const ColumnDescriptor* shardColumn = catalog.getShardColumnMetadataForTable(td);
1712  CHECK(shardColumn);
1713  auto shard_count = td->nShards * num_leafs;
1714  int64_t shardId = 0;
1715 
1716  if (column_list_.empty()) {
1717  auto all_cols =
1718  catalog.getAllColumnMetadataForTable(td->tableId, false, false, false);
1719  auto iter = std::find(all_cols.begin(), all_cols.end(), shardColumn);
1720  CHECK(iter != all_cols.end());
1721  indexOfShardColumn = std::distance(all_cols.begin(), iter);
1722  } else {
1723  for (auto& c : column_list_) {
1724  if (*c == shardColumn->columnName) {
1725  break;
1726  }
1727  indexOfShardColumn++;
1728  }
1729 
1730  if (indexOfShardColumn == column_list_.size()) {
1732  shard_count);
1733  return shardId / td->nShards;
1734  }
1735  }
1736 
1737  if (indexOfShardColumn >= value_list_.size()) {
1738  throw std::runtime_error("No value defined for shard column.");
1739  }
1740 
1741  auto& shardColumnValueExpr = *(std::next(value_list_.begin(), indexOfShardColumn));
1742 
1743  Analyzer::Query query;
1744  auto e = shardColumnValueExpr->analyze(catalog, query);
1745  e = e->add_cast(shardColumn->columnType);
1746  const Analyzer::Constant* con = dynamic_cast<Analyzer::Constant*>(e.get());
1747  if (!con) {
1748  auto col_cast = dynamic_cast<const Analyzer::UOper*>(e.get());
1749  CHECK(col_cast);
1750  CHECK_EQ(kCAST, col_cast->get_optype());
1751  con = dynamic_cast<const Analyzer::Constant*>(col_cast->get_operand());
1752  }
1753  CHECK(con);
1754 
1755  Datum d = con->get_constval();
1756  if (con->get_is_null()) {
1758  shard_count);
1759  } else if (shardColumn->columnType.is_string()) {
1760  auto dictDesc =
1761  catalog.getMetadataForDict(shardColumn->columnType.get_comp_param(), true);
1762  auto str_id = dictDesc->stringDict->getOrAdd(*d.stringval);
1763  bool invalid = false;
1764 
1765  if (4 == shardColumn->columnType.get_size()) {
1766  invalid = str_id > max_valid_int_value<int32_t>();
1767  } else if (2 == shardColumn->columnType.get_size()) {
1768  invalid = str_id > max_valid_int_value<uint16_t>();
1769  } else if (1 == shardColumn->columnType.get_size()) {
1770  invalid = str_id > max_valid_int_value<uint8_t>();
1771  }
1772 
1773  if (invalid || str_id == inline_int_null_value<int32_t>()) {
1774  str_id = inline_fixed_encoding_null_val(shardColumn->columnType);
1775  }
1776  shardId = SHARD_FOR_KEY(str_id, shard_count);
1777  } else {
1778  switch (shardColumn->columnType.get_logical_size()) {
1779  case 8:
1780  shardId = SHARD_FOR_KEY(d.bigintval, shard_count);
1781  break;
1782  case 4:
1783  shardId = SHARD_FOR_KEY(d.intval, shard_count);
1784  break;
1785  case 2:
1786  shardId = SHARD_FOR_KEY(d.smallintval, shard_count);
1787  break;
1788  case 1:
1789  shardId = SHARD_FOR_KEY(d.tinyintval, shard_count);
1790  break;
1791  default:
1792  CHECK(false);
1793  }
1794  }
1795 
1796  return shardId / td->nShards;
1797 }
int8_t tinyintval
Definition: sqltypes.h:212
void validate_non_foreign_table_write(const TableDescriptor *table_descriptor)
Definition: FsiUtils.h:22
#define CHECK_EQ(x, y)
Definition: Logger.h:219
std::string partitions
HOST DEVICE int get_size() const
Definition: sqltypes.h:339
Definition: sqldefs.h:49
const ColumnDescriptor * getShardColumnMetadataForTable(const TableDescriptor *td) const
Definition: Catalog.cpp:4107
int32_t intval
Definition: sqltypes.h:214
std::unique_ptr< std::string > table_
Definition: ParserNode.h:2047
std::shared_ptr< StringDictionary > stringDict
int get_logical_size() const
Definition: sqltypes.h:349
std::list< std::unique_ptr< Expr > > value_list_
Definition: ParserNode.h:2074
int64_t bigintval
Definition: sqltypes.h:215
int16_t smallintval
Definition: sqltypes.h:213
const DictDescriptor * getMetadataForDict(int dict_ref, bool loadDict=true) const
Definition: Catalog.cpp:1554
specifies the content in-memory of a row in the column metadata table
std::string * stringval
Definition: sqltypes.h:220
std::list< const ColumnDescriptor * > getAllColumnMetadataForTable(const int tableId, const bool fetchSystemColumns, const bool fetchVirtualColumns, const bool fetchPhysicalColumns) const
Returns a list of pointers to constant ColumnDescriptor structs for all the columns from a particular...
Definition: Catalog.cpp:1811
std::list< std::unique_ptr< std::string > > column_list_
Definition: ParserNode.h:2048
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:338
#define CHECK(condition)
Definition: Logger.h:211
int64_t inline_fixed_encoding_null_val(const SQL_TYPE_INFO &ti)
SQLTypeInfo columnType
const TableDescriptor * getMetadataForTable(const std::string &tableName, const bool populateFragmenter=true) const
Returns a pointer to a const TableDescriptor struct matching the provided tableName.
bool is_string() const
Definition: sqltypes.h:519
std::string columnName
#define SHARD_FOR_KEY(key, num_shards)
Definition: shard_key.h:20

+ Here is the call graph for this function:

void Parser::InsertValuesStmt::execute ( const Catalog_Namespace::SessionInfo session)

Definition at line 2017 of file ParserNode.cpp.

References CHECK, Catalog_Namespace::SessionInfo::checkDBAccessPrivileges(), RelAlgExecutor::executeSimpleInsert(), legacylockmgr::ExecutorOuterLock, Catalog_Namespace::SessionInfo::getCatalog(), Executor::getExecutor(), legacylockmgr::LockMgr< MutexType, KeyType >::getMutex(), AccessPrivileges::INSERT_INTO_TABLE, TableDBObjectType, Executor::UNITARY_EXECUTOR_ID, and foreign_storage::validate_non_foreign_table_write().

Referenced by omnisci.cursor.Cursor::executemany(), and QueryRunner::QueryRunner::runSQL().

2017  {
2018  auto& catalog = session.getCatalog();
2019 
2022  *table_)) {
2023  throw std::runtime_error("User has no insert privileges on " + *table_ + ".");
2024  }
2025 
2026  auto execute_write_lock = mapd_unique_lock<mapd_shared_mutex>(
2029 
2030  Analyzer::Query query;
2031  analyze(catalog, query);
2032 
2033  // Acquire schema write lock -- leave data lock so the fragmenter can checkpoint. For
2034  // singleton inserts we just take a write lock on the schema, which prevents concurrent
2035  // inserts.
2036  auto result_table_id = query.get_result_table_id();
2037  const auto td_with_lock =
2039  catalog, result_table_id);
2040  // NOTE(max): we do the same checks as below just a few calls earlier in analyze().
2041  // Do we keep those intentionally to make sure nothing changed in between w/o
2042  // catalog locks or is it just a duplicate work?
2043  auto td = td_with_lock();
2044  CHECK(td);
2045  if (td->isView) {
2046  throw std::runtime_error("Singleton inserts on views is not supported.");
2047  }
2049 
2051  RelAlgExecutor ra_executor(executor.get(), catalog);
2052 
2053  ra_executor.executeSimpleInsert(query);
2054 }
void validate_non_foreign_table_write(const TableDescriptor *table_descriptor)
Definition: FsiUtils.h:22
static const AccessPrivileges INSERT_INTO_TABLE
Definition: DBObject.h:163
std::unique_ptr< std::string > table_
Definition: ParserNode.h:2047
static std::shared_ptr< Executor > getExecutor(const ExecutorId id, const std::string &debug_dir="", const std::string &debug_file="", const SystemParameters &system_parameters=SystemParameters())
Definition: Execute.cpp:177
ExecutionResult executeSimpleInsert(const Analyzer::Query &insert_query)
Catalog & getCatalog() const
Definition: SessionInfo.h:67
static std::shared_ptr< MutexType > getMutex(const LockType lockType, const KeyType &key)
Definition: LegacyLockMgr.h:51
#define CHECK(condition)
Definition: Logger.h:211
bool checkDBAccessPrivileges(const DBObjectType &permissionType, const AccessPrivileges &privs, const std::string &objectName="") const
Definition: SessionInfo.cpp:24
void analyze(const Catalog_Namespace::Catalog &catalog, Analyzer::Query &query) const override
static const ExecutorId UNITARY_EXECUTOR_ID
Definition: Execute.h:376

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::list<std::unique_ptr<Expr> >& Parser::InsertValuesStmt::get_value_list ( ) const
inline

Definition at line 2065 of file ParserNode.h.

References value_list_.

2065 { return value_list_; }
std::list< std::unique_ptr< Expr > > value_list_
Definition: ParserNode.h:2074

Member Data Documentation

std::list<std::unique_ptr<Expr> > Parser::InsertValuesStmt::value_list_
private

Definition at line 2074 of file ParserNode.h.

Referenced by get_value_list(), and InsertValuesStmt().


The documentation for this class was generated from the following files: