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 @@ -98,10 +98,6 @@ private[kusto] object CslCommandsGenerator {
s""".show materialized-views | where SourceTable == '$destinationTableName' | count"""
}

def generateIsTableEngineV3(tableName: String): String = {
s""".show table ${tableName} details | project todynamic(ShardingPolicy).UseShardEngine"""
}

def generateTableMoveExtentsCommand(
sourceTableName: String,
destinationTableName: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import org.apache.log4j.Level
import org.apache.spark.sql.types.StructType

import java.time.{Duration, Instant, OffsetDateTime}
import java.util.{StringJoiner, UUID}
import java.util.{Objects, StringJoiner, UUID}
import scala.jdk.CollectionConverters._
import scala.concurrent.duration.FiniteDuration

Expand Down Expand Up @@ -538,18 +538,13 @@ class ExtendedKustoClient(
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)
// Added a check just to be sure that
if (!Objects.isNull(isDestinationTableMaterializedViewSourceResult) &&
isDestinationTableMaterializedViewSourceResult.hasNext) {
isDestinationTableMaterializedViewSourceResult.next()
val isDestinationTableMaterializedViewSource: Boolean =
isDestinationTableMaterializedViewSourceResult.getLong(0) > 0
isDestinationTableMaterializedViewSource
} else {
false
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<version>${revision}</version>
<properties>
<!-- Compile-scoped dependency versions -->
<revision>7.0.0</revision>
<revision>7.0.1</revision>
<kusto.shade.prefix>kusto_connector_shaded</kusto.shade.prefix>
<azure.bom.version>1.3.2</azure.bom.version>
<azure.storage.version>8.6.6</azure.storage.version>
Expand Down