@Override @JsonIgnore default Optional<? extends DruidFactQuery> getInnerQuery() { return (Optional<? extends DruidFactQuery>) DruidQuery.super.getInnerQuery(); }
/** * If this structure is part of a query stack, return the lowest element. * * @return Return the most nested inner query OR the object itself if it has no children */ @JsonIgnore default DruidQuery<?> getInnermostQuery() { return getInnerQuery().isPresent() ? getInnerQuery().get().getInnermostQuery() : this; }
/** * JSON tree walk to determine if there is a nested query below the current json node or not. * * @param gen the Json Generator to retrieve the tree to walk on. * * @return a Boolean where true indicates there are more nested query below this node, false otherwise */ public static Boolean hasInnerQuery(JsonGenerator gen) { return mapNearestDruidQuery(gen, druidQuery -> druidQuery.getInnerQuery().isPresent()).orElse(false); }