Enum SqlInsertConflictBehavior

  • All Implemented Interfaces:
    Serializable, Comparable<SqlInsertConflictBehavior>

    public enum SqlInsertConflictBehavior
    extends Enum<SqlInsertConflictBehavior>
    SQL parser enum for conflict resolution behaviors in INSERT INTO statements.

    This enum is used by the SQL parser to represent the ON CONFLICT clause. It is converted to org.apache.flink.table.api.InsertConflictStrategy during SQL-to-operation conversion.

    Supported behaviors:

    • ON CONFLICT DO ERROR - Throw an exception on primary key constraint violation
    • ON CONFLICT DO NOTHING - Keep the first record, ignore subsequent conflicts
    • ON CONFLICT DO DEDUPLICATE - Maintain history for rollback (current behavior)
    • Enum Constant Detail

      • ERROR

        public static final SqlInsertConflictBehavior ERROR
        Throw an exception when multiple distinct records arrive for the same primary key after watermark compaction.
      • NOTHING

        public static final SqlInsertConflictBehavior NOTHING
        Keep the first record that arrives for a given primary key, discard subsequent conflicts.
      • DEDUPLICATE

        public static final SqlInsertConflictBehavior DEDUPLICATE
        Maintain the full history of changes for each primary key to support rollback on retraction. This is the current default behavior.
    • Method Detail

      • values

        public static SqlInsertConflictBehavior[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SqlInsertConflictBehavior c : SqlInsertConflictBehavior.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SqlInsertConflictBehavior valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • symbol

        public org.apache.calcite.sql.SqlLiteral symbol​(org.apache.calcite.sql.parser.SqlParserPos pos)
        Creates a parse-tree node representing an occurrence of this strategy at a particular position in the parsed text.