in connector/src/main/scala/com/microsoft/kusto/spark/utils/ExtendedKustoClient.scala [469:491]
def shouldIngestData(
tableCoordinates: KustoCoordinates,
maybeSparkIngestionProperties: Option[SparkIngestionProperties],
tableExists: Boolean,
crp: ClientRequestProperties): Boolean = {
if (tableExists && maybeSparkIngestionProperties.isDefined) {
val ingestIfNotExistsTags = maybeSparkIngestionProperties.orNull.ingestIfNotExists
if (ingestIfNotExistsTags != null && !ingestIfNotExistsTags.isEmpty) {
val ingestIfNotExistsTagsSet = ingestIfNotExistsTags.asScala.toSet
val res =
fetchTableExtentsTags(tableCoordinates.database, tableCoordinates.table.get, crp)
if (res.next()) {
val tagsArray = res.getObject(0).asInstanceOf[ArrayNode]
for (i <- 0 until tagsArray.size()) {
if (ingestIfNotExistsTagsSet.contains(tagsArray.get(i).asText())) {
return false
}
}
}
}
}
true
}