Source:
<code>public void create(byte[] tableMetadata) { if (conns.get().selectExistsUnregisteredQuery( "SELECT 1 FROM " + config.metadataTable().getQualifiedName() + " WHERE table_name = ?", tableName.getQualifiedName())) { return; } String prefixedTableName = prefixedTableName(); try { conns.get().executeUnregisteredQuery( String.format("CREATE TABLE %s (" + " row_name BYTEA NOT NULL," + " col_name BYTEA NOT NULL," + " ts INT8 NOT NULL," + " val BYTEA," + " CONSTRAINT %s PRIMARY KEY (row_name, col_name, ts) ", prefixedTableName, PrimaryKeyConstraintNames.get(prefixedTableName)) + ")"); } catch (PalantirSqlException e) { if (!e.getMessage().contains("already exists")) { log.error("Error occurred trying to create the table", e); throw e; } else if (prefixedTableName.length() > ATLASDB_POSTGRES_TABLE_NAME_LIMIT) { final String msg = String.format("The table name is longer than the postgres limit of %d characters. " + "Attempted to truncate the name but the truncated table name or truncated primary " + "key constraint name already exists. Please ensure all your table names have unique " + "first %d characters.", ATLASDB_POSTGRES_TABLE_NAME_LIMIT, ATLASDB_POSTGRES_TABLE_NAME_LIMIT); <START> log.error("Failed to create the table {}. {}", prefixedTableName, msg, e); <END> throw new RuntimeException("Failed to create the table" + prefixedTableName + "." + msg, e); } } ignoringError(() -> { conns.get().insertOneUnregisteredQuery( String.format( "INSERT INTO %s (table_name, table_size) VALUES (?, ?)", config.metadataTable().getQualifiedName()), tableName.getQualifiedName(), TableValueStyle.RAW.getId()); }, ExceptionCheck::isUniqueConstraintViolation); }</code><technical_language>embed message if this logs super weird people reading them</technical_language>

Target:
public void create(byte[] tableMetadata) { if (conns.get().selectExistsUnregisteredQuery( "SELECT 1 FROM " + config.metadataTable().getQualifiedName() + " WHERE table_name = ?", tableName.getQualifiedName())) { return; } String prefixedTableName = prefixedTableName(); try { conns.get().executeUnregisteredQuery( String.format("CREATE TABLE %s (" + " row_name BYTEA NOT NULL," + " col_name BYTEA NOT NULL," + " ts INT8 NOT NULL," + " val BYTEA," + " CONSTRAINT %s PRIMARY KEY (row_name, col_name, ts) ", prefixedTableName, PrimaryKeyConstraintNames.get(prefixedTableName)) + ")"); } catch (PalantirSqlException e) { if (!e.getMessage().contains("already exists")) { log.error("Error occurred trying to create the table", e); throw e; } else if (prefixedTableName.length() > ATLASDB_POSTGRES_TABLE_NAME_LIMIT) { log.error(FAILED_TO_CREATE_TABLE_MESSAGE, prefixedTableName, ATLASDB_POSTGRES_TABLE_NAME_LIMIT, ATLASDB_POSTGRES_TABLE_NAME_LIMIT, e); String exceptionMsg = MessageFormatter.arrayFormat(FAILED_TO_CREATE_TABLE_MESSAGE, new Object[]{ prefixedTableName, ATLASDB_POSTGRES_TABLE_NAME_LIMIT, ATLASDB_POSTGRES_TABLE_NAME_LIMIT}) .getMessage(); throw new RuntimeException(exceptionMsg, e); } } ignoringError(() -> { conns.get().insertOneUnregisteredQuery( String.format( "INSERT INTO %s (table_name, table_size) VALUES (?, ?)", config.metadataTable().getQualifiedName()), tableName.getQualifiedName(), TableValueStyle.RAW.getId()); }, ExceptionCheck::isUniqueConstraintViolation); }