duckdb 0.5.1-dev13.0 → 0.5.1-dev134.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 +1 -1
- package/src/duckdb.cpp +310 -78
- package/src/duckdb.hpp +119 -6
- package/src/parquet-amalgamation.cpp +35743 -35743
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 "
|
|
15
|
-
#define DUCKDB_VERSION "v0.5.1-
|
|
14
|
+
#define DUCKDB_SOURCE_ID "081aa4ca1"
|
|
15
|
+
#define DUCKDB_VERSION "v0.5.1-dev134"
|
|
16
16
|
//===----------------------------------------------------------------------===//
|
|
17
17
|
// DuckDB
|
|
18
18
|
//
|
|
@@ -670,7 +670,7 @@ struct date_t { // NOLINT
|
|
|
670
670
|
|
|
671
671
|
//! Type used to represent time (microseconds)
|
|
672
672
|
struct dtime_t { // NOLINT
|
|
673
|
-
|
|
673
|
+
int64_t micros;
|
|
674
674
|
|
|
675
675
|
dtime_t() = default;
|
|
676
676
|
explicit inline dtime_t(int64_t micros_p) : micros(micros_p) {}
|
|
@@ -705,9 +705,11 @@ struct dtime_t { // NOLINT
|
|
|
705
705
|
static inline dtime_t allballs() {return dtime_t(0); } // NOLINT
|
|
706
706
|
};
|
|
707
707
|
|
|
708
|
+
struct dtime_tz_t : public dtime_t {};
|
|
709
|
+
|
|
708
710
|
//! Type used to represent timestamps (seconds,microseconds,milliseconds or nanoseconds since 1970-01-01)
|
|
709
711
|
struct timestamp_t { // NOLINT
|
|
710
|
-
|
|
712
|
+
int64_t value;
|
|
711
713
|
|
|
712
714
|
timestamp_t() = default;
|
|
713
715
|
explicit inline timestamp_t(int64_t value_p) : value(value_p) {}
|
|
@@ -738,6 +740,11 @@ struct timestamp_t { // NOLINT
|
|
|
738
740
|
static inline timestamp_t epoch() {return timestamp_t(0); } // NOLINT
|
|
739
741
|
};
|
|
740
742
|
|
|
743
|
+
struct timestamp_tz_t : public timestamp_t {};
|
|
744
|
+
struct timestamp_ns_t : public timestamp_t {};
|
|
745
|
+
struct timestamp_ms_t : public timestamp_t {};
|
|
746
|
+
struct timestamp_sec_t : public timestamp_t {};
|
|
747
|
+
|
|
741
748
|
struct interval_t {
|
|
742
749
|
int32_t months;
|
|
743
750
|
int32_t days;
|
|
@@ -1021,6 +1028,10 @@ struct LogicalType {
|
|
|
1021
1028
|
inline const ExtraTypeInfo *AuxInfo() const {
|
|
1022
1029
|
return type_info_.get();
|
|
1023
1030
|
}
|
|
1031
|
+
inline void CopyAuxInfo(const LogicalType& other) {
|
|
1032
|
+
type_info_ = other.type_info_;
|
|
1033
|
+
}
|
|
1034
|
+
bool EqualTypeInfo(const LogicalType& rhs) const;
|
|
1024
1035
|
|
|
1025
1036
|
// copy assignment
|
|
1026
1037
|
inline LogicalType& operator=(const LogicalType &other) {
|
|
@@ -1047,6 +1058,16 @@ struct LogicalType {
|
|
|
1047
1058
|
//! Deserializes a blob back into an LogicalType
|
|
1048
1059
|
DUCKDB_API static LogicalType Deserialize(Deserializer &source);
|
|
1049
1060
|
|
|
1061
|
+
DUCKDB_API static bool TypeIsTimestamp(LogicalTypeId id) {
|
|
1062
|
+
return (id == LogicalTypeId::TIMESTAMP ||
|
|
1063
|
+
id == LogicalTypeId::TIMESTAMP_MS ||
|
|
1064
|
+
id == LogicalTypeId::TIMESTAMP_NS ||
|
|
1065
|
+
id == LogicalTypeId::TIMESTAMP_SEC ||
|
|
1066
|
+
id == LogicalTypeId::TIMESTAMP_TZ);
|
|
1067
|
+
}
|
|
1068
|
+
DUCKDB_API static bool TypeIsTimestamp(const LogicalType& type) {
|
|
1069
|
+
return TypeIsTimestamp(type.id());
|
|
1070
|
+
}
|
|
1050
1071
|
DUCKDB_API string ToString() const;
|
|
1051
1072
|
DUCKDB_API bool IsIntegral() const;
|
|
1052
1073
|
DUCKDB_API bool IsNumeric() const;
|
|
@@ -1263,6 +1284,87 @@ struct aggregate_state_t {
|
|
|
1263
1284
|
|
|
1264
1285
|
} // namespace duckdb
|
|
1265
1286
|
|
|
1287
|
+
namespace std {
|
|
1288
|
+
|
|
1289
|
+
//! Date
|
|
1290
|
+
template <>
|
|
1291
|
+
struct hash<duckdb::date_t>
|
|
1292
|
+
{
|
|
1293
|
+
std::size_t operator()(const duckdb::date_t& k) const
|
|
1294
|
+
{
|
|
1295
|
+
using std::hash;
|
|
1296
|
+
return hash<int32_t>()((int32_t)k);
|
|
1297
|
+
}
|
|
1298
|
+
};
|
|
1299
|
+
|
|
1300
|
+
//! Time
|
|
1301
|
+
template <>
|
|
1302
|
+
struct hash<duckdb::dtime_t>
|
|
1303
|
+
{
|
|
1304
|
+
std::size_t operator()(const duckdb::dtime_t& k) const
|
|
1305
|
+
{
|
|
1306
|
+
using std::hash;
|
|
1307
|
+
return hash<int64_t>()((int64_t)k);
|
|
1308
|
+
}
|
|
1309
|
+
};
|
|
1310
|
+
template <>
|
|
1311
|
+
struct hash<duckdb::dtime_tz_t>
|
|
1312
|
+
{
|
|
1313
|
+
std::size_t operator()(const duckdb::dtime_tz_t& k) const
|
|
1314
|
+
{
|
|
1315
|
+
using std::hash;
|
|
1316
|
+
return hash<int64_t>()((int64_t)k);
|
|
1317
|
+
}
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
//! Timestamp
|
|
1321
|
+
template <>
|
|
1322
|
+
struct hash<duckdb::timestamp_t>
|
|
1323
|
+
{
|
|
1324
|
+
std::size_t operator()(const duckdb::timestamp_t& k) const
|
|
1325
|
+
{
|
|
1326
|
+
using std::hash;
|
|
1327
|
+
return hash<int64_t>()((int64_t)k);
|
|
1328
|
+
}
|
|
1329
|
+
};
|
|
1330
|
+
template <>
|
|
1331
|
+
struct hash<duckdb::timestamp_ms_t>
|
|
1332
|
+
{
|
|
1333
|
+
std::size_t operator()(const duckdb::timestamp_ms_t& k) const
|
|
1334
|
+
{
|
|
1335
|
+
using std::hash;
|
|
1336
|
+
return hash<int64_t>()((int64_t)k);
|
|
1337
|
+
}
|
|
1338
|
+
};
|
|
1339
|
+
template <>
|
|
1340
|
+
struct hash<duckdb::timestamp_ns_t>
|
|
1341
|
+
{
|
|
1342
|
+
std::size_t operator()(const duckdb::timestamp_ns_t& k) const
|
|
1343
|
+
{
|
|
1344
|
+
using std::hash;
|
|
1345
|
+
return hash<int64_t>()((int64_t)k);
|
|
1346
|
+
}
|
|
1347
|
+
};
|
|
1348
|
+
template <>
|
|
1349
|
+
struct hash<duckdb::timestamp_sec_t>
|
|
1350
|
+
{
|
|
1351
|
+
std::size_t operator()(const duckdb::timestamp_sec_t& k) const
|
|
1352
|
+
{
|
|
1353
|
+
using std::hash;
|
|
1354
|
+
return hash<int64_t>()((int64_t)k);
|
|
1355
|
+
}
|
|
1356
|
+
};
|
|
1357
|
+
template <>
|
|
1358
|
+
struct hash<duckdb::timestamp_tz_t>
|
|
1359
|
+
{
|
|
1360
|
+
std::size_t operator()(const duckdb::timestamp_tz_t& k) const
|
|
1361
|
+
{
|
|
1362
|
+
using std::hash;
|
|
1363
|
+
return hash<int64_t>()((int64_t)k);
|
|
1364
|
+
}
|
|
1365
|
+
};
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1266
1368
|
|
|
1267
1369
|
namespace duckdb {
|
|
1268
1370
|
|
|
@@ -3161,8 +3263,18 @@ Value DUCKDB_API Value::CreateValue(date_t value);
|
|
|
3161
3263
|
template <>
|
|
3162
3264
|
Value DUCKDB_API Value::CreateValue(dtime_t value);
|
|
3163
3265
|
template <>
|
|
3266
|
+
Value DUCKDB_API Value::CreateValue(dtime_tz_t value);
|
|
3267
|
+
template <>
|
|
3164
3268
|
Value DUCKDB_API Value::CreateValue(timestamp_t value);
|
|
3165
3269
|
template <>
|
|
3270
|
+
Value DUCKDB_API Value::CreateValue(timestamp_sec_t value);
|
|
3271
|
+
template <>
|
|
3272
|
+
Value DUCKDB_API Value::CreateValue(timestamp_ms_t value);
|
|
3273
|
+
template <>
|
|
3274
|
+
Value DUCKDB_API Value::CreateValue(timestamp_ns_t value);
|
|
3275
|
+
template <>
|
|
3276
|
+
Value DUCKDB_API Value::CreateValue(timestamp_tz_t value);
|
|
3277
|
+
template <>
|
|
3166
3278
|
Value DUCKDB_API Value::CreateValue(const char *value);
|
|
3167
3279
|
template <>
|
|
3168
3280
|
Value DUCKDB_API Value::CreateValue(string value);
|
|
@@ -9819,7 +9931,7 @@ public:
|
|
|
9819
9931
|
//! Returns a reference to the column of the specified name. Throws an
|
|
9820
9932
|
//! exception if the column does not exist.
|
|
9821
9933
|
ColumnDefinition &GetColumn(const string &name);
|
|
9822
|
-
//! Returns a list of types of the table
|
|
9934
|
+
//! Returns a list of types of the table, excluding generated columns
|
|
9823
9935
|
vector<LogicalType> GetTypes();
|
|
9824
9936
|
string ToSQL() override;
|
|
9825
9937
|
|
|
@@ -27469,7 +27581,8 @@ public:
|
|
|
27469
27581
|
public:
|
|
27470
27582
|
template <class T, class BASE>
|
|
27471
27583
|
static string ToString(const T &entry) {
|
|
27472
|
-
return entry.left->ToString()
|
|
27584
|
+
return StringUtil::Format("(%s) %s (%s)", entry.left->ToString(), ExpressionTypeToOperator(entry.type),
|
|
27585
|
+
entry.right->ToString());
|
|
27473
27586
|
}
|
|
27474
27587
|
};
|
|
27475
27588
|
} // namespace duckdb
|