Package org.apache.flink.sql.parser.dml
Enum SqlInsertConflictBehavior
- java.lang.Object
-
- java.lang.Enum<SqlInsertConflictBehavior>
-
- org.apache.flink.sql.parser.dml.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.InsertConflictStrategyduring SQL-to-operation conversion.Supported behaviors:
ON CONFLICT DO ERROR- Throw an exception on primary key constraint violationON CONFLICT DO NOTHING- Keep the first record, ignore subsequent conflictsON CONFLICT DO DEDUPLICATE- Maintain history for rollback (current behavior)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEDUPLICATEMaintain the full history of changes for each primary key to support rollback on retraction.ERRORThrow an exception when multiple distinct records arrive for the same primary key after watermark compaction.NOTHINGKeep the first record that arrives for a given primary key, discard subsequent conflicts.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.calcite.sql.SqlLiteralsymbol(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.static SqlInsertConflictBehaviorvalueOf(String name)Returns the enum constant of this type with the specified name.static SqlInsertConflictBehavior[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 nameNullPointerException- 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.
-
-