diff --git a/velox/docs/functions/spark/string.rst b/velox/docs/functions/spark/string.rst index 64083dacb652..197bf4e5dd1d 100644 --- a/velox/docs/functions/spark/string.rst +++ b/velox/docs/functions/spark/string.rst @@ -121,7 +121,7 @@ Unless specified otherwise, all functions return NULL if at least one of the arg SELECT ltrim('ps', 'spark'); -- "ark" -.. spark:function:: mask(string, upperChar, lowerChar, digitChar, otherChar) -> string +.. spark:function:: mask(string[, upperChar, lowerChar, digitChar, otherChar]) -> string Returns a masked version of the input ``string``. ``string``: string value to mask. diff --git a/velox/functions/sparksql/Mask.cpp b/velox/functions/sparksql/Mask.cpp index 249f27d94ec3..a3bc1775851d 100644 --- a/velox/functions/sparksql/Mask.cpp +++ b/velox/functions/sparksql/Mask.cpp @@ -24,13 +24,7 @@ namespace facebook::velox::functions::sparksql { namespace { class MaskFunction final : public exec::VectorFunction { - static constexpr std::string_view maskedUpperCase{"X"}; - static constexpr std::string_view maskedLowerCase{"x"}; - static constexpr std::string_view maskedDigit{"n"}; - public: - MaskFunction() {} - void apply( const SelectivityVector& rows, std::vector& args, @@ -179,6 +173,11 @@ class MaskFunction final : public exec::VectorFunction { } result.resize(inputSize); } + + private: + static constexpr std::string_view maskedUpperCase{"X"}; + static constexpr std::string_view maskedLowerCase{"x"}; + static constexpr std::string_view maskedDigit{"n"}; }; std::shared_ptr createMask(