duckdb 0.5.1-dev94.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/duckdb.hpp CHANGED
@@ -11,8 +11,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
11
11
  #pragma once
12
12
  #define DUCKDB_AMALGAMATION 1
13
13
  #define DUCKDB_AMALGAMATION_EXTENDED 1
14
- #define DUCKDB_SOURCE_ID "64eba71a7"
15
- #define DUCKDB_VERSION "v0.5.1-dev94"
14
+ #define DUCKDB_SOURCE_ID "7c111322d"
15
+ #define DUCKDB_VERSION "v0.5.1"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -4415,6 +4415,13 @@ struct StringVector {
4415
4415
  DUCKDB_API static void AddHeapReference(Vector &vector, Vector &other);
4416
4416
  };
4417
4417
 
4418
+ struct MapVector {
4419
+ DUCKDB_API static const Vector &GetKeys(const Vector &vector);
4420
+ DUCKDB_API static const Vector &GetValues(const Vector &vector);
4421
+ DUCKDB_API static Vector &GetKeys(Vector &vector);
4422
+ DUCKDB_API static Vector &GetValues(Vector &vector);
4423
+ };
4424
+
4418
4425
  struct StructVector {
4419
4426
  DUCKDB_API static const vector<unique_ptr<Vector>> &GetEntries(const Vector &vector);
4420
4427
  DUCKDB_API static vector<unique_ptr<Vector>> &GetEntries(Vector &vector);
@@ -9931,10 +9938,13 @@ public:
9931
9938
  //! Returns a reference to the column of the specified name. Throws an
9932
9939
  //! exception if the column does not exist.
9933
9940
  ColumnDefinition &GetColumn(const string &name);
9934
- //! Returns a list of types of the table
9941
+ //! Returns a list of types of the table, excluding generated columns
9935
9942
  vector<LogicalType> GetTypes();
9936
9943
  string ToSQL() override;
9937
9944
 
9945
+ //! Get statistics of a column (physical or virtual) within the table
9946
+ unique_ptr<BaseStatistics> GetStatistics(ClientContext &context, column_t column_id);
9947
+
9938
9948
  //! Serialize the meta information of the TableCatalogEntry a serializer
9939
9949
  virtual void Serialize(Serializer &serializer);
9940
9950
  //! Deserializes to a CreateTableInfo
@@ -12956,6 +12966,7 @@ public:
12956
12966
 
12957
12967
  //! Push a new error
12958
12968
  void PushError(PreservedError exception);
12969
+
12959
12970
  //! True if an error has been thrown
12960
12971
  bool HasError();
12961
12972
  //! Throw the exception that was pushed using PushError.
@@ -13003,13 +13014,13 @@ private:
13003
13014
 
13004
13015
  void VerifyPipeline(Pipeline &pipeline);
13005
13016
  void VerifyPipelines();
13006
- void ThrowExceptionInternal();
13007
13017
 
13008
13018
  private:
13009
13019
  PhysicalOperator *physical_plan;
13010
13020
  unique_ptr<PhysicalOperator> owned_plan;
13011
13021
 
13012
13022
  mutex executor_lock;
13023
+ mutex error_lock;
13013
13024
  //! The pipelines of the current query
13014
13025
  vector<shared_ptr<Pipeline>> pipelines;
13015
13026
  //! The root pipeline of the query
@@ -13031,6 +13042,8 @@ private:
13031
13042
  atomic<idx_t> completed_pipelines;
13032
13043
  //! The total amount of pipelines in the query
13033
13044
  idx_t total_pipelines;
13045
+ //! Whether or not execution is cancelled
13046
+ bool cancelled;
13034
13047
 
13035
13048
  //! The adjacent union pipelines of each pipeline
13036
13049
  //! Union pipelines have the same sink, but can be run concurrently along with this pipeline
@@ -22751,6 +22764,11 @@ public:
22751
22764
  void CommitAppend(transaction_t commit_id, idx_t start, idx_t end) override;
22752
22765
 
22753
22766
  void Append(idx_t start, idx_t end, transaction_t commit_id);
22767
+ //! Performs a delete in the ChunkVectorInfo - returns how many tuples were actually deleted
22768
+ //! The number of rows that were actually deleted might be lower than the input count
22769
+ //! In case we delete rows that were already deleted
22770
+ //! Note that "rows" is written to to reflect the row ids that were actually deleted
22771
+ //! i.e. after calling this function, rows will hold [0..actual_delete_count] row ids of the actually deleted tuples
22754
22772
  idx_t Delete(Transaction &transaction, row_t rows[], idx_t count);
22755
22773
  void CommitDelete(transaction_t commit_id, row_t rows[], idx_t count);
22756
22774
 
@@ -24297,7 +24315,7 @@ public:
24297
24315
  DataTable(ClientContext &context, DataTable &parent, idx_t changed_idx, const LogicalType &target_type,
24298
24316
  vector<column_t> bound_columns, Expression &cast_expr);
24299
24317
  //! Constructs a DataTable as a delta on an existing data table but with one column added new constraint
24300
- DataTable(ClientContext &context, DataTable &parent, unique_ptr<Constraint> constraint);
24318
+ DataTable(ClientContext &context, DataTable &parent, unique_ptr<BoundConstraint> constraint);
24301
24319
 
24302
24320
  shared_ptr<DataTableInfo> info;
24303
24321
 
@@ -24382,7 +24400,9 @@ public:
24382
24400
  this->is_root = true;
24383
24401
  }
24384
24402
 
24403
+ //! Get statistics of a physical column within the table
24385
24404
  unique_ptr<BaseStatistics> GetStatistics(ClientContext &context, column_t column_id);
24405
+ //! Sets statistics of a physical column within the table
24386
24406
  void SetStatistics(column_t column_id, const std::function<void(BaseStatistics &)> &set_fun);
24387
24407
 
24388
24408
  //! Checkpoint the table to the specified table data writer
@@ -24400,7 +24420,7 @@ public:
24400
24420
 
24401
24421
  private:
24402
24422
  //! Verify the new added constraints against current persistent&local data
24403
- void VerifyNewConstraint(ClientContext &context, DataTable &parent, const Constraint *constraint);
24423
+ void VerifyNewConstraint(ClientContext &context, DataTable &parent, const BoundConstraint *constraint);
24404
24424
  //! Verify constraints with a chunk from the Append containing all columns of the table
24405
24425
  void VerifyAppendConstraints(TableCatalogEntry &table, ClientContext &context, DataChunk &chunk);
24406
24426
  //! Verify constraints with a chunk from the Update containing only the specified column_ids
@@ -26978,12 +26998,16 @@ class HivePartitioning {
26978
26998
  public:
26979
26999
  //! Parse a filename that follows the hive partitioning scheme
26980
27000
  DUCKDB_API static std::map<string, string> Parse(string &filename);
27001
+ DUCKDB_API static std::map<string, string> Parse(string &filename, duckdb_re2::RE2 &regex);
26981
27002
  //! Prunes a list of filenames based on a set of filters, can be used by TableFunctions in the
26982
27003
  //! pushdown_complex_filter function to skip files with filename-based filters. Also removes the filters that always
26983
27004
  //! evaluate to true.
26984
27005
  DUCKDB_API static void ApplyFiltersToFileList(vector<string> &files, vector<unique_ptr<Expression>> &filters,
26985
27006
  unordered_map<string, column_t> &column_map, idx_t table_index,
26986
27007
  bool hive_enabled, bool filename_enabled);
27008
+
27009
+ //! Returns the compiled regex pattern to match hive partitions
27010
+ DUCKDB_API static const string REGEX_STRING;
26987
27011
  };
26988
27012
 
26989
27013
  } // namespace duckdb
@@ -27201,8 +27225,8 @@ public:
27201
27225
  return function_name + "(" + entry.children[0]->ToString() + ")";
27202
27226
  }
27203
27227
  } else if (entry.children.size() == 2) {
27204
- return "(" + entry.children[0]->ToString() + " " + function_name + " " + entry.children[1]->ToString() +
27205
- ")";
27228
+ return StringUtil::Format("(%s) %s (%s)", entry.children[0]->ToString(), function_name,
27229
+ entry.children[1]->ToString());
27206
27230
  }
27207
27231
  }
27208
27232
  // standard function call