Skip to content

Document schema mapping mechanism #656

@mshustov

Description

@mshustov

THe docs page doesn't mention built-in logic to update schema mappings

protected void doInsertRawBinary(List<Record> records, Table table, QueryIdentifier queryId, boolean supportDefaults, boolean retry) throws IOException, ExecutionException, InterruptedException {
try {
if (chc.isUseClientV2()) {
doInsertRawBinaryV2(records, table, queryId, supportDefaults);
} else {
doInsertRawBinaryV1(records, table, queryId, supportDefaults);
}
} catch (ServerException e) {
LOGGER.error("Error inserting records can cause by schema changes", e);
if (e.getCode() == 33 && retry == true) {
LOGGER.error("Error code 33: ClickHouse server error. Trying to update table mapping.");
updateMapping(table.getDatabase());
Table tableTmp = getTable(table.getDatabase(), table.getName());
doInsertRawBinary(records, tableTmp, queryId, tableTmp.hasDefaults(), false);

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions