Class MergeStatementValidator


  • public class MergeStatementValidator
    extends Object
    Validator for merge statements executed in Snowflake.
    • Field Detail

      • EXPRESSION_LIMIT

        public static final int EXPRESSION_LIMIT
        Maximum limit of inserted/updated records.
        See Also:
        Constant Field Values
    • Method Detail

      • validateRecordLimit

        public static <T> void validateRecordLimit​(Collection<T> collection)
        Validates if collection size is exceeding statement limit of 16384.
        Type Parameters:
        T - Type of the collection
        Parameters:
        collection - Validated collection
      • validateDuplicates

        public static <T,​K> void validateDuplicates​(Collection<T> collection,
                                                          Function<T,​K> idExtractor)
        Validates if collection contains only unique keys.
        Type Parameters:
        T - type of item
        K - type of item identifier
        Parameters:
        collection - validated collection
        idExtractor - function for extraction of each item identifier