@Description("Scrub runtime information such as plan estimates and variable names from the query plan, leaving the structure of the plan intact")
    @ScalarFunction("json_presto_query_plan_scrub")
    @SqlType(StandardTypes.JSON)
    @SqlNullable
    public static Slice jsonScrubPlan(@SqlType(StandardTypes.JSON) Slice jsonPlan)
    {
        Map<PlanFragmentId, Map<String, JsonRenderedNode>> jsonRenderedNodeMap = parseJsonPlanFragments(jsonPlan);

        if (jsonRenderedNodeMap == null) {
            return null;
        }

        jsonRenderedNodeMap.forEach((key, planMap) ->
        {
            planMap.put("plan", scrubJsonPlan(planMap.get("plan")));
        });

        JsonCodec<Map<PlanFragmentId, Map<String, JsonRenderer.JsonRenderedNode>>> planMapCodec = constructJsonPlanMapCodec();
        return utf8Slice(planMapCodec.toJson(jsonRenderedNodeMap));
    }
@Test
    public void testJsonScrubPlan()
    {
        assertFunction("json_presto_query_plan_scrub(json '" + TestJsonPrestoQueryPlanFunctionUtils.joinPlan.replaceAll("'", "''") + "')", JSON,
                TestJsonPrestoQueryPlanFunctionUtils.scrubbedJoinPlan);
    }