Class UniqueConstraint

  • All Implemented Interfaces:
    Constraint

    @PublicEvolving
    public final class UniqueConstraint
    extends Object
    A unique key constraint. It can be declared also as a PRIMARY KEY.
    See Also:
    Constraint.ConstraintType
    • Method Detail

      • getColumns

        public List<String> getColumns()
        List of column names for which the primary key was defined.
      • asSummaryString

        public final String asSummaryString()
        Returns constraint's summary. All constraints summary will be formatted as
         CONSTRAINT [constraint-name] [constraint-type] ([constraint-definition])
        
         E.g CONSTRAINT pk PRIMARY KEY (`f0`, `f1`) NOT ENFORCED
         
      • equals

        public boolean equals​(Object o)
      • hashCode

        public int hashCode()
      • isEnforced

        public boolean isEnforced()
        Description copied from interface: Constraint
        Constraints can either be enforced or non-enforced. If a constraint is enforced it will be checked whenever any SQL statement is executed that results in data or schema changes. If the constraint is not enforced the owner of the data is responsible for ensuring data integrity. Flink will rely the information is valid and might use it for query optimisations.
        Specified by:
        isEnforced in interface Constraint