duckdb 0.5.2-dev754.0 → 0.5.2-dev756.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 +14 -13
- package/src/duckdb.hpp +685 -685
- package/src/parquet-amalgamation.cpp +37514 -37514
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -101088,9 +101088,16 @@ void DatePartFun::RegisterFunction(BuiltinFunctions &set) {
|
|
|
101088
101088
|
|
|
101089
101089
|
|
|
101090
101090
|
|
|
101091
|
+
|
|
101091
101092
|
namespace duckdb {
|
|
101092
101093
|
|
|
101093
101094
|
struct DateSub {
|
|
101095
|
+
static int64_t SubtractMicros(timestamp_t startdate, timestamp_t enddate) {
|
|
101096
|
+
const auto start = Timestamp::GetEpochMicroSeconds(startdate);
|
|
101097
|
+
const auto end = Timestamp::GetEpochMicroSeconds(enddate);
|
|
101098
|
+
return SubtractOperatorOverflowCheck::Operation<int64_t, int64_t, int64_t>(end, start);
|
|
101099
|
+
}
|
|
101100
|
+
|
|
101094
101101
|
template <class TA, class TB, class TR, class OP>
|
|
101095
101102
|
static inline void BinaryExecute(Vector &left, Vector &right, Vector &result, idx_t count) {
|
|
101096
101103
|
BinaryExecutor::ExecuteWithNulls<TA, TB, TR>(
|
|
@@ -101177,55 +101184,49 @@ struct DateSub {
|
|
|
101177
101184
|
struct DayOperator {
|
|
101178
101185
|
template <class TA, class TB, class TR>
|
|
101179
101186
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101180
|
-
return (
|
|
101181
|
-
Interval::MICROS_PER_DAY;
|
|
101187
|
+
return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_DAY;
|
|
101182
101188
|
}
|
|
101183
101189
|
};
|
|
101184
101190
|
|
|
101185
101191
|
struct WeekOperator {
|
|
101186
101192
|
template <class TA, class TB, class TR>
|
|
101187
101193
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101188
|
-
return (
|
|
101189
|
-
Interval::MICROS_PER_WEEK;
|
|
101194
|
+
return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_WEEK;
|
|
101190
101195
|
}
|
|
101191
101196
|
};
|
|
101192
101197
|
|
|
101193
101198
|
struct MicrosecondsOperator {
|
|
101194
101199
|
template <class TA, class TB, class TR>
|
|
101195
101200
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101196
|
-
return (
|
|
101201
|
+
return SubtractMicros(startdate, enddate);
|
|
101197
101202
|
}
|
|
101198
101203
|
};
|
|
101199
101204
|
|
|
101200
101205
|
struct MillisecondsOperator {
|
|
101201
101206
|
template <class TA, class TB, class TR>
|
|
101202
101207
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101203
|
-
return (
|
|
101204
|
-
Interval::MICROS_PER_MSEC;
|
|
101208
|
+
return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_MSEC;
|
|
101205
101209
|
}
|
|
101206
101210
|
};
|
|
101207
101211
|
|
|
101208
101212
|
struct SecondsOperator {
|
|
101209
101213
|
template <class TA, class TB, class TR>
|
|
101210
101214
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101211
|
-
return (
|
|
101212
|
-
Interval::MICROS_PER_SEC;
|
|
101215
|
+
return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_SEC;
|
|
101213
101216
|
}
|
|
101214
101217
|
};
|
|
101215
101218
|
|
|
101216
101219
|
struct MinutesOperator {
|
|
101217
101220
|
template <class TA, class TB, class TR>
|
|
101218
101221
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101219
|
-
return (
|
|
101220
|
-
Interval::MICROS_PER_MINUTE;
|
|
101222
|
+
return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_MINUTE;
|
|
101221
101223
|
}
|
|
101222
101224
|
};
|
|
101223
101225
|
|
|
101224
101226
|
struct HoursOperator {
|
|
101225
101227
|
template <class TA, class TB, class TR>
|
|
101226
101228
|
static inline TR Operation(TA startdate, TB enddate) {
|
|
101227
|
-
return (
|
|
101228
|
-
Interval::MICROS_PER_HOUR;
|
|
101229
|
+
return SubtractMicros(startdate, enddate) / Interval::MICROS_PER_HOUR;
|
|
101229
101230
|
}
|
|
101230
101231
|
};
|
|
101231
101232
|
};
|