Skip to content

Commit

Permalink
Revert the change for hash functions already merged to upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Oct 25, 2023
1 parent 9f3b981 commit 5de58b1
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions velox/functions/sparksql/Hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,33 +386,9 @@ std::vector<std::shared_ptr<exec::FunctionSignature>> hashSignatures() {
.build()};
}

void checkInputType(const std::vector<exec::VectorFunctionArg>& inputArgs) {
for (int i = 0; i < inputArgs.size(); i++) {
switch (inputArgs[i].type->kind()) {
case TypeKind::BOOLEAN:
case TypeKind::TINYINT:
case TypeKind::SMALLINT:
case TypeKind::INTEGER:
case TypeKind::BIGINT:
case TypeKind::VARCHAR:
case TypeKind::VARBINARY:
case TypeKind::REAL:
case TypeKind::DOUBLE:
case TypeKind::DATE:
case TypeKind::HUGEINT:
case TypeKind::TIMESTAMP:
break;
default:
VELOX_USER_FAIL(
"Unsupported type for hash: {}", inputArgs[i].type->toString())
}
}
}

std::shared_ptr<exec::VectorFunction> makeHash(
const std::string& name,
const std::vector<exec::VectorFunctionArg>& inputArgs) {
checkInputType(inputArgs);
static const auto kHashFunction = std::make_shared<Murmur3HashFunction>();
return kHashFunction;
}
Expand All @@ -435,7 +411,6 @@ std::vector<std::shared_ptr<exec::FunctionSignature>> xxhash64Signatures() {
std::shared_ptr<exec::VectorFunction> makeXxHash64(
const std::string& name,
const std::vector<exec::VectorFunctionArg>& inputArgs) {
checkInputType(inputArgs);
static const auto kXxHash64Function = std::make_shared<XxHash64Function>();
return kXxHash64Function;
}
Expand Down

0 comments on commit 5de58b1

Please sign in to comment.