diff --git a/velox/expression/fuzzer/ExpressionFuzzer.cpp b/velox/expression/fuzzer/ExpressionFuzzer.cpp index fae7b0902036..680998ce3083 100644 --- a/velox/expression/fuzzer/ExpressionFuzzer.cpp +++ b/velox/expression/fuzzer/ExpressionFuzzer.cpp @@ -125,6 +125,12 @@ void addCastFromDateSignature( signatures.push_back(makeCastSignature("date", toType)); } +void addCastFromIPPrefixSignature( + const std::string& toType, + std::vector& signatures) { + signatures.push_back(makeCastSignature("ipprefix", toType)); +} + std::vector getSignaturesForCast() { std::vector signatures; @@ -149,6 +155,7 @@ getSignaturesForCast() { addCastFromVarcharSignature("varchar", signatures); addCastFromDateSignature("varchar", signatures); addCastFromTimestampSignature("varchar", signatures); + addCastFromIPPrefixSignature("varchar", signatures); // To timestamp type. addCastFromVarcharSignature("timestamp", signatures); @@ -158,6 +165,9 @@ getSignaturesForCast() { addCastFromVarcharSignature("date", signatures); addCastFromTimestampSignature("date", signatures); + // To ipprefix type. + addCastFromVarcharSignature("ipprefix", signatures); + // For each supported translation pair T --> U, add signatures of array(T) --> // array(U), map(varchar, T) --> map(varchar, U), row(T) --> row(U). auto size = signatures.size(); @@ -664,6 +674,7 @@ bool ExpressionFuzzer::isSupportedSignature( if (usesTypeName(signature, "opaque") || usesTypeName(signature, "timestamp with time zone") || usesTypeName(signature, "interval day to second") || + usesTypeName(signature, "ipprefix") || (!options_.enableDecimalType && usesTypeName(signature, "decimal")) || (!options_.enableComplexTypes && useComplexType) || (options_.enableComplexTypes && usesTypeName(signature, "unknown"))) {