diff --git a/velox/functions/prestosql/JsonFunctions.h b/velox/functions/prestosql/JsonFunctions.h index 7c6f1421477c5..753ee442140ae 100644 --- a/velox/functions/prestosql/JsonFunctions.h +++ b/velox/functions/prestosql/JsonFunctions.h @@ -31,33 +31,6 @@ struct IsJsonScalarFunction { } }; -// jsonExtractScalar(json, json_path) -> varchar -// Current implementation support UTF-8 in json, but not in json_path. -// Like jsonExtract(), but returns the result value as a string (as opposed -// to being encoded as JSON). The value referenced by json_path must be a scalar -// (boolean, number or string) -template -struct JsonExtractScalarFunction { - VELOX_DEFINE_FUNCTION_TYPES(T); - - FOLLY_ALWAYS_INLINE bool call( - out_type& result, - const arg_type& json, - const arg_type& jsonPath) { - const folly::StringPiece& jsonStringPiece = json; - const folly::StringPiece& jsonPathStringPiece = jsonPath; - auto extractResult = - jsonExtractScalar(jsonStringPiece, jsonPathStringPiece); - if (extractResult.hasValue()) { - UDFOutputString::assign(result, *extractResult); - return true; - - } else { - return false; - } - } -}; - template struct JsonExtractFunction { VELOX_DEFINE_FUNCTION_TYPES(T); diff --git a/velox/functions/prestosql/benchmarks/JsonExprBenchmark.cpp b/velox/functions/prestosql/benchmarks/JsonExprBenchmark.cpp index 3c18a0797d0a5..1a3fda4c95271 100644 --- a/velox/functions/prestosql/benchmarks/JsonExprBenchmark.cpp +++ b/velox/functions/prestosql/benchmarks/JsonExprBenchmark.cpp @@ -47,8 +47,6 @@ class JsonBenchmark : public velox::functions::test::FunctionBenchmarkBase { {"folly_json_array_length"}); registerFunction( {"simd_json_array_length"}); - registerFunction( - {"folly_json_extract_scalar"}); registerFunction( {"simd_json_extract_scalar"}); registerFunction( @@ -193,15 +191,6 @@ void SIMDJsonArrayLength(int iter, int vectorSize, int jsonSize) { benchmark.runWithJson(iter, vectorSize, "simd_json_array_length", json); } -void FollyJsonExtractScalar(int iter, int vectorSize, int jsonSize) { - folly::BenchmarkSuspender suspender; - JsonBenchmark benchmark; - auto json = benchmark.prepareData(jsonSize); - suspender.dismiss(); - benchmark.runWithJsonExtract( - iter, vectorSize, "folly_json_extract_scalar", json, "$.key[7].k1"); -} - void SIMDJsonExtractScalar(int iter, int vectorSize, int jsonSize) { folly::BenchmarkSuspender suspender; JsonBenchmark benchmark;