Class RepeatedFieldSource


  • @API(EXPERIMENTAL)
    public class RepeatedFieldSource
    extends Source
    A Source representing the stream of the zero or more values of a repeated field.

    Encapsulates the logic for fanning-out the values of the repeated field and ensuring that the planner uses repeated fields in the correct way. In particular, the supportsSourceIn(ViewExpressionComparisons, Source) method ensures that multiple comparisons are associated with this source only if they can refer to the same iteration over the elements of the repeated field.

    • Method Detail

      • getSources

        public Set<Source> getSources()
        Description copied from class: Source
        Get the set of all sources of ancestor's of this source, include this source itself.
        Specified by:
        getSources in class Source
        Returns:
        a set of the sources of all (inclusive) ancestors of this source
      • supportsSourceIn

        public boolean supportsSourceIn​(@Nonnull
                                        ViewExpressionComparisons comparisons,
                                        @Nonnull
                                        Source other)
        Description copied from class: Source
        Check whether this source can be replaced by the given source in the given ViewExpressionComparisons. In general, this source can be replaced by the given source if and only if:
        • The sources match each other "structurally" (i.e., differ only in a pointer-equality sense).
        • The elements with comparisons in the ViewExpressionComparisons do not use this source.
        Specified by:
        supportsSourceIn in class Source
        Parameters:
        comparisons - a view expression comparisons that specifies which sources are used and unused
        other - a candidate replacement for this source
        Returns:
        whether this source can be replaced by other
        See Also:
        Source.withSourceMappedInto(Source, Source), Element.matchSourcesWith(ViewExpressionComparisons, Element)
      • withSourceMappedInto

        @Nonnull
        public Source withSourceMappedInto​(@Nonnull
                                           Source originalSource,
                                           @Nonnull
                                           Source duplicateSource)
        Description copied from class: Source
        Replace the given duplicate source with the given original source everywhere that it occurs in this source, including in ancestor sources.
        Specified by:
        withSourceMappedInto in class Source
        Parameters:
        originalSource - a source to replace all occurrences of the duplicate source with
        duplicateSource - a source to replace with the original source
        Returns:
        a copy of this source with all occurrences of the duplicate source replaced with the original source
      • evalSourceEntriesFor

        @Nonnull
        public Stream<SourceEntry> evalSourceEntriesFor​(@Nonnull
                                                        SourceEntry parentEntry)
        Description copied from class: Source
        Produce the stream of source entries that this source represents, drawing the values for dependent sources from the given source entry if needed.
        Specified by:
        evalSourceEntriesFor in class Source
        Parameters:
        parentEntry - a source entry to draw the input for this source from
        Returns:
        a stream of source entries, each of which has a value associated with this source