duckdb 0.3.3-dev835.0 → 0.3.3-dev839.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 +58 -0
- package/src/duckdb.hpp +544 -544
- package/src/parquet-amalgamation.cpp +31659 -31659
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -90184,17 +90184,75 @@ struct MD5Operator {
|
|
|
90184
90184
|
}
|
|
90185
90185
|
};
|
|
90186
90186
|
|
|
90187
|
+
struct MD5Number128Operator {
|
|
90188
|
+
template <class INPUT_TYPE, class RESULT_TYPE>
|
|
90189
|
+
static RESULT_TYPE Operation(INPUT_TYPE input) {
|
|
90190
|
+
data_t digest[MD5Context::MD5_HASH_LENGTH_BINARY];
|
|
90191
|
+
|
|
90192
|
+
MD5Context context;
|
|
90193
|
+
context.Add(input);
|
|
90194
|
+
context.Finish(digest);
|
|
90195
|
+
return *reinterpret_cast<hugeint_t *>(digest);
|
|
90196
|
+
}
|
|
90197
|
+
};
|
|
90198
|
+
|
|
90199
|
+
template <bool lower>
|
|
90200
|
+
struct MD5Number64Operator {
|
|
90201
|
+
template <class INPUT_TYPE, class RESULT_TYPE>
|
|
90202
|
+
static RESULT_TYPE Operation(INPUT_TYPE input) {
|
|
90203
|
+
data_t digest[MD5Context::MD5_HASH_LENGTH_BINARY];
|
|
90204
|
+
|
|
90205
|
+
MD5Context context;
|
|
90206
|
+
context.Add(input);
|
|
90207
|
+
context.Finish(digest);
|
|
90208
|
+
return *reinterpret_cast<uint64_t *>(&digest[lower ? 8 : 0]);
|
|
90209
|
+
}
|
|
90210
|
+
};
|
|
90211
|
+
|
|
90187
90212
|
static void MD5Function(DataChunk &args, ExpressionState &state, Vector &result) {
|
|
90188
90213
|
auto &input = args.data[0];
|
|
90189
90214
|
|
|
90190
90215
|
UnaryExecutor::ExecuteString<string_t, string_t, MD5Operator>(input, result, args.size());
|
|
90191
90216
|
}
|
|
90192
90217
|
|
|
90218
|
+
static void MD5NumberFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
|
90219
|
+
auto &input = args.data[0];
|
|
90220
|
+
|
|
90221
|
+
UnaryExecutor::Execute<string_t, hugeint_t, MD5Number128Operator>(input, result, args.size());
|
|
90222
|
+
}
|
|
90223
|
+
|
|
90224
|
+
static void MD5NumberUpperFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
|
90225
|
+
auto &input = args.data[0];
|
|
90226
|
+
|
|
90227
|
+
UnaryExecutor::Execute<string_t, uint64_t, MD5Number64Operator<false>>(input, result, args.size());
|
|
90228
|
+
}
|
|
90229
|
+
|
|
90230
|
+
static void MD5NumberLowerFunction(DataChunk &args, ExpressionState &state, Vector &result) {
|
|
90231
|
+
auto &input = args.data[0];
|
|
90232
|
+
|
|
90233
|
+
UnaryExecutor::Execute<string_t, uint64_t, MD5Number64Operator<true>>(input, result, args.size());
|
|
90234
|
+
}
|
|
90235
|
+
|
|
90193
90236
|
void MD5Fun::RegisterFunction(BuiltinFunctions &set) {
|
|
90194
90237
|
set.AddFunction(ScalarFunction("md5", // name of the function
|
|
90195
90238
|
{LogicalType::VARCHAR}, // argument list
|
|
90196
90239
|
LogicalType::VARCHAR, // return type
|
|
90197
90240
|
MD5Function)); // pointer to function implementation
|
|
90241
|
+
|
|
90242
|
+
set.AddFunction(ScalarFunction("md5_number", // name of the function
|
|
90243
|
+
{LogicalType::VARCHAR}, // argument list
|
|
90244
|
+
LogicalType::HUGEINT, // return type
|
|
90245
|
+
MD5NumberFunction)); // pointer to function implementation
|
|
90246
|
+
|
|
90247
|
+
set.AddFunction(ScalarFunction("md5_number_upper", // name of the function
|
|
90248
|
+
{LogicalType::VARCHAR}, // argument list
|
|
90249
|
+
LogicalType::UBIGINT, // return type
|
|
90250
|
+
MD5NumberUpperFunction)); // pointer to function implementation
|
|
90251
|
+
|
|
90252
|
+
set.AddFunction(ScalarFunction("md5_number_lower", // name of the function
|
|
90253
|
+
{LogicalType::VARCHAR}, // argument list
|
|
90254
|
+
LogicalType::UBIGINT, // return type
|
|
90255
|
+
MD5NumberLowerFunction)); // pointer to function implementation
|
|
90198
90256
|
}
|
|
90199
90257
|
|
|
90200
90258
|
} // namespace duckdb
|