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

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

        Map<String, List<String>> planMap = extractPlanIds(planFragments);
        List<String> planChildren = planMap.get(planId.toStringUtf8());
        if (planChildren == null) {
            return null;
        }
        return constructSqlArray(arrayType, planChildren);
    }
@Test
    public void testJsonPlanNodeChildren()
    {
        assertFunction("json_presto_query_plan_node_children(null, null)", new ArrayType(VARCHAR), null);
        assertFunction("json_presto_query_plan_node_children(null, '1')", new ArrayType(VARCHAR), null);

        assertFunction("json_presto_query_plan_node_children(json '" + TestJsonPrestoQueryPlanFunctionUtils.joinPlan.replaceAll("'", "''") + "', '314')",
                new ArrayType(VARCHAR), ImmutableList.of());

        assertFunction("json_presto_query_plan_node_children(json '" + TestJsonPrestoQueryPlanFunctionUtils.joinPlan.replaceAll("'", "''") + "', '230')",
                new ArrayType(VARCHAR), ImmutableList.of("251", "284"));

        assertFunction("json_presto_query_plan_node_children(json '" + TestJsonPrestoQueryPlanFunctionUtils.joinPlan.replaceAll("'", "''") + "', 'nonkey')",
                new ArrayType(VARCHAR), null);
    }