Skip to content

Commit d3dc644

Browse files
Bugfix/fix invalid mappings in queued mode (Azure#428)
* Fix setting temp table mapping only for Txn mode
1 parent 7b46205 commit d3dc644

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

connector/src/main/scala/com/microsoft/kusto/spark/datasink/KustoWriter.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,13 @@ object KustoWriter {
154154
stagingTableIngestionProperties.creationTime == null)
155155
}
156156

157-
kustoClient.setMappingOnStagingTableIfNeeded(
158-
stagingTableIngestionProperties,
159-
tableCoordinates.database,
160-
tmpTableName,
161-
table,
162-
crp)
163-
if (stagingTableIngestionProperties.flushImmediately) {
164-
KDSU.logWarn(className, "It's not recommended to set flushImmediately to true")
157+
if (writeOptions.writeMode == WriteMode.Transactional) {
158+
kustoClient.setMappingOnStagingTableIfNeeded(
159+
stagingTableIngestionProperties,
160+
tableCoordinates.database,
161+
tmpTableName,
162+
table,
163+
crp)
165164
}
166165

167166
if (stagingTableIngestionProperties.flushImmediately) {

0 commit comments

Comments
 (0)