Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1081,12 +1081,7 @@ public ChannelMigrateOffsetTokenResponseDTO migrateStreamingChannelOffsetToken(
InternalUtils.assertNotEmpty("tableName", tableName);
InternalUtils.assertNotEmpty("sourceChannelName", sourceChannelName);
InternalUtils.assertNotEmpty("destinationChannelName", destinationChannelName);
String fullyQualifiedTableName =
jdbcProperties.getProperty(InternalUtils.JDBC_DATABASE)
+ "."
+ jdbcProperties.getProperty(InternalUtils.JDBC_SCHEMA)
+ "."
+ tableName;
String fullyQualifiedTableName = getFullyQualifiedTableName(tableName);
String query = "select SYSTEM$SNOWPIPE_STREAMING_MIGRATE_CHANNEL_OFFSET_TOKEN((?), (?), (?));";

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ public InsertRowsResponse get() throws Throwable {
extraColNames == null ? "null" : String.join(",", extraColNames));
SchematizationUtils.evolveSchemaIfNeeded(
this.conn,
this.channel.getTableName(),
String.join(".", this.channel.getSchemaName(), this.channel.getTableName()),
new ArrayList<>(nonNullableColumns),
extraColNames,
this.insertRowsStreamingBuffer.getSinkRecord(originalSinkRecordIdx),
Expand Down Expand Up @@ -1019,11 +1019,20 @@ private long fetchLatestOffsetFromChannel(SnowflakeStreamingIngestChannel channe
* @return new channel which was fetched after open/reopen
*/
private SnowflakeStreamingIngestChannel openChannelForTable() {
String sName=this.sfConnectorConfig.get(Utils.SF_SCHEMA);
String tName=this.tableName;
if(this.tableName.contains(".")){
String[] parts = this.tableName.split("\\.");
if(parts.length>=2){
sName = parts[parts.length-2];
tName = parts[parts.length-1];
}
}
OpenChannelRequest channelRequest =
OpenChannelRequest.builder(this.channelNameFormatV1)
.setDBName(this.sfConnectorConfig.get(Utils.SF_DATABASE))
.setSchemaName(this.sfConnectorConfig.get(Utils.SF_SCHEMA))
.setTableName(this.tableName)
.setSchemaName(sName)
.setTableName(tName)
.setOnErrorOption(OpenChannelRequest.OnErrorOption.CONTINUE)
.setOffsetTokenVerificationFunction(StreamingUtils.offsetTokenVerificationFunction)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ private void handleInsertRowFailure(
|| nullValueForNotNullColNames != null) {
SchematizationUtils.evolveSchemaIfNeeded(
this.conn,
this.channel.getTableName(),
String.join(".",this.channel.getSchemaName(), this.channel.getTableName()),
join(nonNullableColumns, nullValueForNotNullColNames),
extraColNames,
kafkaSinkRecord,
Expand Down Expand Up @@ -809,11 +809,20 @@ private long fetchLatestOffsetFromChannel(SnowflakeStreamingIngestChannel channe
* @return new channel which was fetched after open/reopen
*/
private SnowflakeStreamingIngestChannel openChannelForTable() {
String sName=this.sfConnectorConfig.get(Utils.SF_SCHEMA);
String tName=this.tableName;
if(this.tableName.contains(".")){
String[] parts = this.tableName.split("\\.");
if(parts.length>=2){
sName = parts[parts.length-2];
tName = parts[parts.length-1];
}
}
OpenChannelRequest channelRequest =
OpenChannelRequest.builder(this.channelNameFormatV1)
.setDBName(this.sfConnectorConfig.get(Utils.SF_DATABASE))
.setSchemaName(this.sfConnectorConfig.get(Utils.SF_SCHEMA))
.setTableName(this.tableName)
.setSchemaName(sName)
.setTableName(tName)
.setOnErrorOption(OpenChannelRequest.OnErrorOption.CONTINUE)
.setOffsetTokenVerificationFunction(StreamingUtils.offsetTokenVerificationFunction)
.build();
Expand Down
Loading