Skip to content

Commit

Permalink
'columnsToIndex' should be provided when SaveMode.Append is used for …
Browse files Browse the repository at this point in the history
…the first write
  • Loading branch information
Jiaweihu08 committed Aug 18, 2022
1 parent da534d3 commit d8cadcc
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package io.qbeast.spark.utils

import io.qbeast.spark.QbeastIntegrationTestSpec
import io.qbeast.spark.delta.DeltaQbeastSnapshot
import org.apache.spark.sql.AnalysisException
import org.apache.spark.sql.delta.DeltaLog
import org.apache.spark.sql.functions._

Expand Down Expand Up @@ -252,4 +253,19 @@ class QbeastDataSourceIntegrationTest extends QbeastIntegrationTestSpec {
qDf.count shouldBe original.count * 2
}
}

"Appending to an non-existing table" should
"throw an exception if 'columnsToIndex' is not provided" in withQbeastContextSparkAndTmpDir {
(spark, tmpDir) =>
{
val original = loadTestData(spark)
a[AnalysisException] shouldBe thrownBy {
original.write
.format("qbeast")
.option("cubeSize", 10000)
.save(tmpDir)
}
}
}

}

0 comments on commit d8cadcc

Please sign in to comment.