Skip to content

Commit

Permalink
ZOLLAK-288 eliminate random int on schema creation (fallback to topic…
Browse files Browse the repository at this point in the history
… configuration) (#152)
  • Loading branch information
Freshwood authored Nov 6, 2023
1 parent 178c28b commit b4ff3bc
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package com.sap.kafka.connect.source.querier

import com.sap.kafka.client.hana.HANAJdbcClient
import com.sap.kafka.connect.config.{BaseConfig, BaseConfigConstants}
import com.sap.kafka.connect.config.hana.HANAConfig
import com.sap.kafka.connect.config.{BaseConfig, BaseConfigConstants}
import com.sap.kafka.utils.hana.HANAJdbcTypeConverter
import org.apache.kafka.connect.data.{Schema, Struct}
import org.apache.kafka.connect.source.SourceRecord
import org.slf4j.LoggerFactory

import scala.util.Random

abstract class TableQuerier(mode: String, tableOrQuery: String,
topic: String, config: BaseConfig,
var jdbcClient: Option[HANAJdbcClient])
Expand Down Expand Up @@ -92,7 +90,7 @@ abstract class TableQuerier(mode: String, tableOrQuery: String,
case BaseConfigConstants.QUERY_MODE_SQL =>
if (getOrCreateJdbcClient().get.isInstanceOf[HANAJdbcClient]) {
val metadata = getOrCreateJdbcClient().get.getMetadata(tableOrQuery)
HANAJdbcTypeConverter.convertHANAMetadataToSchema("Query" + Random.nextInt, metadata, options)
HANAJdbcTypeConverter.convertHANAMetadataToSchema(topic, metadata, options)
} else {
throw new RuntimeException("Jdbc Client is not available")
}
Expand Down

0 comments on commit b4ff3bc

Please sign in to comment.