def shouldUseMaterializedViewFlag()

in connector/src/main/scala/com/microsoft/kusto/spark/utils/ExtendedKustoClient.scala [446:467]


  def shouldUseMaterializedViewFlag(
      database: String,
      targetTable: String,
      crp: ClientRequestProperties): Boolean = {
    val isDestinationTableMaterializedViewSourceResult =
      executeEngine(
        database,
        generateIsTableMaterializedViewSourceCommand(targetTable),
        "isTableMV",
        crp).getPrimaryResults
    isDestinationTableMaterializedViewSourceResult.next()
    val isDestinationTableMaterializedViewSource: Boolean =
      isDestinationTableMaterializedViewSourceResult.getLong(0) > 0
    if (isDestinationTableMaterializedViewSource) {
      val res =
        executeEngine(database, generateIsTableEngineV3(targetTable), "isTableV3", crp).getPrimaryResults
      res.next()
      res.getBoolean(0)
    } else {
      false
    }
  }