diff --git a/velox/exec/fuzzer/PrestoQueryRunner.cpp b/velox/exec/fuzzer/PrestoQueryRunner.cpp index c8bba9cdb64d..d30a315db4d2 100644 --- a/velox/exec/fuzzer/PrestoQueryRunner.cpp +++ b/velox/exec/fuzzer/PrestoQueryRunner.cpp @@ -33,6 +33,7 @@ #include "velox/functions/prestosql/types/IPAddressType.h" #include "velox/functions/prestosql/types/IPPrefixType.h" #include "velox/functions/prestosql/types/JsonType.h" +#include "velox/functions/prestosql/types/UuidType.h" #include "velox/serializers/PrestoSerializer.h" #include "velox/type/parser/TypeParser.h" @@ -426,18 +427,19 @@ bool PrestoQueryRunner::isConstantExprSupported( const core::TypedExprPtr& expr) { if (std::dynamic_pointer_cast(expr)) { // TODO: support constant literals of these types. Complex-typed constant - // literals require support of converting them to SQL. Json, Ipaddress, and - // Ipprefix can be enabled after we're able to generate valid input values, - // because when these types are used as the type of a constant literal in - // SQL, Presto implicitly invoke json_parse(), cast(x as Ipaddress), and - // cast(x as Ipprefix) on it, which makes the behavior of Presto different - // from Velox. Timestamp constant literals require further investigation to - // ensure Presto uses the same timezone as Velox. Interval type cannot be - // used as the type of constant literals in Presto SQL. + // literals require support of converting them to SQL. Json, Ipaddress, + // Ipprefix, and Uuid can be enabled after we're able to generate valid + // input values, because when these types are used as the type of a constant + // literal in SQL, Presto implicitly invokes json_parse(), + // cast(x as Ipaddress), cast(x as Ipprefix) and cast(x as uuid) on it, + // which makes the behavior of Presto different from Velox. Timestamp + // constant literals require further investigation to ensure Presto uses the + // same timezone as Velox. Interval type cannot be used as the type of + // constant literals in Presto SQL. auto& type = expr->type(); return type->isPrimitiveType() && !type->isTimestamp() && !isJsonType(type) && !type->isIntervalDayTime() && - !isIPAddressType(type) && !isIPPrefixType(type); + !isIPAddressType(type) && !isIPPrefixType(type) && !isUuidType(type); } return true; } @@ -448,16 +450,17 @@ bool PrestoQueryRunner::isSupported(const exec::FunctionSignature& signature) { // cast-to or constant literals. Hyperloglog can only be casted from varbinary // and cannot be used as the type of constant literals. Interval year to month // can only be casted from NULL and cannot be used as the type of constant - // literals. Json, Ipaddress, and Ipprefix require special handling, because - // Presto requires literals of these types to be valid, and doesn't allow - // creating HIVE columns of these types. + // literals. Json, Ipaddress, Ipprefix, and UUID require special handling, + // because Presto requires literals of these types to be valid, and doesn't + // allow creating HIVE columns of these types. return !( usesTypeName(signature, "interval year to month") || usesTypeName(signature, "hugeint") || usesTypeName(signature, "hyperloglog") || usesInputTypeName(signature, "json") || usesInputTypeName(signature, "ipaddress") || - usesInputTypeName(signature, "ipprefix")); + usesInputTypeName(signature, "ipprefix") || + usesInputTypeName(signature, "uuid")); } std::optional PrestoQueryRunner::toSql(