Class ConstraintParser


  • public class ConstraintParser
    extends Object
    This class provides the ability to transform a simple constraint grammar into an instance of Constraints.
    • Method Detail

      • parseConstraints

        public static Constraints parseConstraints​(org.apache.arrow.vector.types.pojo.Schema schema,
                                                   Optional<String> input)
        This method takes in a table schema and a String representing the set of simple contraints to be ANDed together and applied to that table.
        Parameters:
        schema - The schema of the table in question
        input - A comma-separated constraint String in the form of {field_name}{operator}{value}. The operators must be one of those available in ConstraintParser.LogicalOperator. Currently, we only support Boolean, Integer, Floating Point, Decimal, and String operands for this validator's constraints.
        Returns:
        a Constraints object populated from the input string, un-constrained if input is not present