Package com.databricks.jdbc.common.util

## Class InsertStatementParser

- java.lang.Object
- - com.databricks.jdbc.common.util.InsertStatementParser

    public class InsertStatementParser
    extends Object

Utility class for parsing INSERT statements to extract table and column information. Supports detecting compatible INSERT statements that can be combined into multi-row batches.

### Nested Class Summary

Nested Classes
`static class` `InsertStatementParser.InsertInfo` Represents the parsed components of an INSERT statement.

### Constructor Summary

Constructors
`InsertStatementParser()`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `generateMultiRowInsert​(InsertStatementParser.InsertInfo insertInfo, int numberOfRows)` Generates a multi-row INSERT statement from the template and number of rows.
`static boolean` `isParametrizedInsert​(String sql)` Checks if the given SQL statement is a parametrized INSERT statement suitable for batching.
`static InsertStatementParser.InsertInfo` `parseInsert​(String sql)` Parses an INSERT statement to extract table and column information.
`static InsertStatementParser.InsertInfo` `parseInsertStrict​(String sql)` Parses an INSERT statement to extract table and column information with strict error handling.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### InsertStatementParser

    public InsertStatementParser()

### Method Detail

#### parseInsert

    public static InsertStatementParser.InsertInfo parseInsert​(String sql)

Parses an INSERT statement to extract table and column information.

Parameters:
  `sql` - the INSERT SQL statement to parse
Returns:
  InsertInfo object containing parsed information, or null if not a valid INSERT

#### parseInsertStrict

    public static InsertStatementParser.InsertInfo parseInsertStrict​(String sql)
                                                              throws DatabricksParsingException

Parses an INSERT statement to extract table and column information with strict error handling.

Parameters:
  `sql` - the INSERT SQL statement to parse
Returns:
  InsertInfo object containing parsed information
Throws:
  `DatabricksParsingException` - if the SQL is not a properly formatted INSERT statement

#### isParametrizedInsert

    public static boolean isParametrizedInsert​(String sql)

Checks if the given SQL statement is a parametrized INSERT statement suitable for batching.

Parameters:
  `sql` - the SQL statement to check
Returns:
  true if it's a parametrized INSERT that can be batched, false otherwise

#### generateMultiRowInsert

    public static String generateMultiRowInsert​(InsertStatementParser.InsertInfo insertInfo,
                                                int numberOfRows)
                                         throws DatabricksParsingException

Generates a multi-row INSERT statement from the template and number of rows.

Parameters:
  `insertInfo` - the parsed INSERT information
  `numberOfRows` - the number of rows to include in the batch
Returns:
  the multi-row INSERT SQL statement
Throws:
  `DatabricksParsingException` - if insertInfo is null or numberOfRows is invalid