duckdb 0.4.1-dev2127.0 → 0.4.1-dev2142.0

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
- "version": "0.4.1-dev2127.0",
4
+ "version": "0.4.1-dev2142.0",
5
5
  "description": "DuckDB node.js API",
6
6
  "gypfile": true,
7
7
  "dependencies": {
package/src/duckdb.cpp CHANGED
@@ -15357,6 +15357,7 @@ namespace duckdb {
15357
15357
  //===--------------------------------------------------------------------===//
15358
15358
  FieldWriter::FieldWriter(Serializer &serializer_p)
15359
15359
  : serializer(serializer_p), buffer(make_unique<BufferedSerializer>()), field_count(0), finalized(false) {
15360
+ buffer->SetVersion(serializer.GetVersion());
15360
15361
  }
15361
15362
 
15362
15363
  FieldWriter::~FieldWriter() {
@@ -15396,6 +15397,7 @@ void FieldWriter::Finalize() {
15396
15397
  // Field Deserializer
15397
15398
  //===--------------------------------------------------------------------===//
15398
15399
  FieldDeserializer::FieldDeserializer(Deserializer &root) : root(root), remaining_data(idx_t(-1)) {
15400
+ SetVersion(root.GetVersion());
15399
15401
  }
15400
15402
 
15401
15403
  void FieldDeserializer::ReadData(data_ptr_t buffer, idx_t read_size) {
@@ -34956,6 +34958,7 @@ BufferedDeserializer::BufferedDeserializer(data_ptr_t ptr, idx_t data_size) : pt
34956
34958
 
34957
34959
  BufferedDeserializer::BufferedDeserializer(BufferedSerializer &serializer)
34958
34960
  : BufferedDeserializer(serializer.data, serializer.maximum_size) {
34961
+ SetVersion(serializer.GetVersion());
34959
34962
  }
34960
34963
 
34961
34964
  void BufferedDeserializer::ReadData(data_ptr_t buffer, idx_t read_size) {
@@ -184442,6 +184445,8 @@ JoinSide JoinSide::GetJoinSide(const unordered_set<idx_t> &bindings, unordered_s
184442
184445
 
184443
184446
  namespace duckdb {
184444
184447
 
184448
+ const uint64_t PLAN_SERIALIZATION_VERSION = 1;
184449
+
184445
184450
  LogicalOperator::LogicalOperator(LogicalOperatorType type) : type(type) {
184446
184451
  }
184447
184452
 
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 "b51257ea6"
15
- #define DUCKDB_VERSION "v0.4.1-dev2127"
14
+ #define DUCKDB_SOURCE_ID "4053be069"
15
+ #define DUCKDB_VERSION "v0.4.1-dev2142"
16
16
  //===----------------------------------------------------------------------===//
17
17
  // DuckDB
18
18
  //
@@ -1670,10 +1670,26 @@ namespace duckdb {
1670
1670
 
1671
1671
  //! The Serialize class is a base class that can be used to serializing objects into a binary buffer
1672
1672
  class Serializer {
1673
+ private:
1674
+ uint64_t version = 0L;
1675
+
1673
1676
  public:
1674
1677
  virtual ~Serializer() {
1675
1678
  }
1676
1679
 
1680
+ //! Sets the version of the serialization that writers are expected to use
1681
+ //! The version is mostly the most recent one, unless modifying old data or streaming to
1682
+ //! an older version
1683
+ void SetVersion(uint64_t v) {
1684
+ D_ASSERT(this->version == 0); // version can only be set once
1685
+ this->version = v;
1686
+ }
1687
+
1688
+ //! Returns the version of serialization that writers are expected to use
1689
+ uint64_t GetVersion() {
1690
+ return version;
1691
+ }
1692
+
1677
1693
  virtual void WriteData(const_data_ptr_t buffer, idx_t write_size) = 0;
1678
1694
 
1679
1695
  template <class T>
@@ -1725,10 +1741,26 @@ public:
1725
1741
  //! The Deserializer class assists in deserializing a binary blob back into an
1726
1742
  //! object
1727
1743
  class Deserializer {
1744
+ private:
1745
+ uint64_t version = 0L;
1746
+
1728
1747
  public:
1729
1748
  virtual ~Deserializer() {
1730
1749
  }
1731
1750
 
1751
+ //! Sets the version of the serialization that readers are expected to use
1752
+ //! The version is mostly the most recent one, unless reading old data or streaming from
1753
+ //! an older version
1754
+ void SetVersion(uint64_t v) {
1755
+ D_ASSERT(this->version == 0); // version can only be set once
1756
+ this->version = v;
1757
+ }
1758
+
1759
+ //! Returns the version of serialization that readers are expected to use
1760
+ uint64_t GetVersion() {
1761
+ return version;
1762
+ }
1763
+
1732
1764
  //! Reads [read_size] bytes into the buffer
1733
1765
  virtual void ReadData(data_ptr_t buffer, idx_t read_size) = 0;
1734
1766
 
@@ -9124,6 +9156,10 @@ namespace duckdb {
9124
9156
  class FieldWriter;
9125
9157
  class FieldReader;
9126
9158
 
9159
+ //! The current version of the plan serialization format. Exposed via by @Serializer & @Deserializer
9160
+ //! to be used by various Operator to know what format to read and write.
9161
+ extern const uint64_t PLAN_SERIALIZATION_VERSION;
9162
+
9127
9163
  //! LogicalOperator is the base class of the logical operators present in the
9128
9164
  //! logical query tree
9129
9165
  class LogicalOperator {