Package com.databricks.jdbc.common.util
Class InsertStatementParser.InsertInfo
- java.lang.Object
-
- com.databricks.jdbc.common.util.InsertStatementParser.InsertInfo
-
- Enclosing class:
- InsertStatementParser
public static class InsertStatementParser.InsertInfo extends Object
Represents the parsed components of an INSERT statement.
-
-
Constructor Summary
Constructors Constructor Description InsertInfo(String tableName, List<String> columns, String originalSql)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetColumnCount()List<String>getColumns()StringgetOriginalSql()StringgetTableName()inthashCode()booleanisCompatibleWith(InsertStatementParser.InsertInfo other)Checks if this INSERT is compatible with another INSERT for batching.
-
-
-
Method Detail
-
getTableName
public String getTableName()
-
getOriginalSql
public String getOriginalSql()
-
getColumnCount
public int getColumnCount()
-
isCompatibleWith
public boolean isCompatibleWith(InsertStatementParser.InsertInfo other)
Checks if this INSERT is compatible with another INSERT for batching. Two INSERTs are compatible if they target the same table with the same columns in the same order.Compatible INSERT operations can be combined into multi-row INSERT statements for improved performance. For example, these two statements are compatible:
INSERT INTO users (id, name, email) VALUES (?, ?, ?) INSERT INTO users (id, name, email) VALUES (?, ?, ?)
These can be batched into:INSERT INTO users (id, name, email) VALUES (?, ?, ?), (?, ?, ?)
-
-