private String tryConvertAvroColNameToJdbcColName ( String avroColName ) { if ( ! avroToJdbcColPairs . isPresent ( ) ) { String converted = avroColName . replaceAll ( AVRO_NESTED_COLUMN_DELIMITER_REGEX_COMPATIBLE , JDBC_FLATTENED_COLUMN_DELIMITER ) ; jdbcToAvroColPairs . put ( converted , avroColName ) ; return converted ; } String converted = avroToJdbcColPairs . get ( ) . get ( avroColName ) ; converted = converted != null ? converted : avroColName ; jdbcToAvroColPairs . put ( converted , avroColName ) ; return converted ; }
Convert Avro column name to JDBC column name . If name mapping is defined follow it . Otherwise just return avro column name while replacing nested column delimiter dot to underscore . This method also updates mapping from JDBC column name to Avro column name for reverse look up .