@Description("Get the plan ids of given plan node")
    @ScalarFunction("json_presto_query_plan_ids")
    @SqlType("ARRAY<VARCHAR>")
    @SqlNullable
    public static Block jsonPlanIds(@TypeParameter("ARRAY<VARCHAR>") ArrayType arrayType,
            @SqlType(StandardTypes.JSON) Slice jsonPlan)
    {
        List<JsonRenderedNode> planFragments = parseJsonPlanFragmentsAsList(jsonPlan);

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

        Map<String, List<String>> planMap = extractPlanIds(planFragments);
        return constructSqlArray(arrayType, planMap.keySet().stream().collect(Collectors.toList()));
    }
@Test
    public void testJsonPlanIds()
    {
        assertFunction("json_presto_query_plan_ids(null)", new ArrayType(VARCHAR), null);

        assertFunction("json_presto_query_plan_ids(json '" +
                        TestJsonPrestoQueryPlanFunctionUtils.joinPlan.replaceAll("'", "''") + "')",
                new ArrayType(VARCHAR), ImmutableList.of("253", "313", "314", "8", "251", "284", "230", "252"));
    }