@Override
    public PartitionType visitPartition_with_stream(@NotNull SiddhiQLParser.Partition_with_streamContext ctx) {

        String streamId = (String) visit(ctx.stream_id());

        activeStreams.add(streamId);
        try {
            if (ctx.condition_ranges() != null) {
                PartitionType partitionType = new RangePartitionType(streamId,
                        (RangePartitionType.RangePartitionProperty[]) visit(ctx.condition_ranges()));
                populateQueryContext(partitionType, ctx);
                return partitionType;
            } else if (ctx.attribute() != null) {
                PartitionType partitionType = new ValuePartitionType(streamId, (Expression) visit(ctx.attribute()));
                populateQueryContext(partitionType, ctx);
                return partitionType;
            } else {
                throw newSiddhiParserException(ctx);
            }
        } finally {
            activeStreams.clear();
        }
    }
{@inheritDoc}
<p>The default implementation returns the result of calling
{@link #visitChildren} on {@code ctx}.</p>

@param ctx
modules/siddhi-query-compiler/src/main/java/io/siddhi/query/compiler/internal/SiddhiQLBaseVisitorImpl.java