From 0d76522fd5a63ed11890a44da419107a9632b6f0 Mon Sep 17 00:00:00 2001 From: Sean Kao Date: Mon, 11 Mar 2024 10:58:12 -0700 Subject: [PATCH] run scalafmtAll Signed-off-by: Sean Kao --- .../sql/index/FlintSparkIndexAstBuilder.scala | 9 ++- .../flint/core/FlintTransactionITSuite.scala | 7 ++- .../spark/FlintSparkIndexSqlITSuite.scala | 59 +++++++++++++++---- 3 files changed, 60 insertions(+), 15 deletions(-) diff --git a/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/sql/index/FlintSparkIndexAstBuilder.scala b/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/sql/index/FlintSparkIndexAstBuilder.scala index e42e3f4c9..f806fc848 100644 --- a/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/sql/index/FlintSparkIndexAstBuilder.scala +++ b/flint-spark-integration/src/main/scala/org/opensearch/flint/spark/sql/index/FlintSparkIndexAstBuilder.scala @@ -70,7 +70,14 @@ trait FlintSparkIndexAstBuilder extends FlintSparkSqlExtensionsVisitor[AnyRef] { case None => "unavailable" } - Row(index.name, index.kind, databaseName, tableName, indexName, index.options.autoRefresh(), status) + Row( + index.name, + index.kind, + databaseName, + tableName, + indexName, + index.options.autoRefresh(), + status) } } } diff --git a/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala index 96d780895..ebff01885 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/core/FlintTransactionITSuite.scala @@ -56,7 +56,8 @@ class FlintTransactionITSuite extends OpenSearchTransactionSuite with Matchers { dataSource = testDataSourceName, error = "")) - val latest = flintClient.getIndexMetadataLatestLogEntry(testFlintIndex, testDataSourceName).get + val latest = + flintClient.getIndexMetadataLatestLogEntry(testFlintIndex, testDataSourceName).get latest.id shouldBe testLatestId latest.createTime shouldBe testCreateTime latest.dataSource shouldBe testDataSourceName @@ -64,7 +65,9 @@ class FlintTransactionITSuite extends OpenSearchTransactionSuite with Matchers { } test("should get empty if no metadata log entry for index") { - flintClient.getIndexMetadataLatestLogEntry(testFlintIndex, testDataSourceName).isEmpty shouldBe true + flintClient + .getIndexMetadataLatestLogEntry(testFlintIndex, testDataSourceName) + .isEmpty shouldBe true } test("should preserve original values when transition") { diff --git a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala index 901f6bfe4..113c38c97 100644 --- a/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala +++ b/integ-test/src/test/scala/org/opensearch/flint/spark/FlintSparkIndexSqlITSuite.scala @@ -20,8 +20,10 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { private val testMvIndexShortName = "mv1" private val testMvQuery = s"SELECT name, age FROM $testTableQualifiedName" - private val testSkippingFlintIndex = FlintSparkSkippingIndex.getSkippingIndexName(testTableQualifiedName) - private val testCoveringFlintIndex = FlintSparkCoveringIndex.getFlintIndexName(testCoveringIndex, testTableQualifiedName) + private val testSkippingFlintIndex = + FlintSparkSkippingIndex.getSkippingIndexName(testTableQualifiedName) + private val testCoveringFlintIndex = + FlintSparkCoveringIndex.getFlintIndexName(testCoveringIndex, testTableQualifiedName) private val testMvIndex = s"spark_catalog.default.$testMvIndexShortName" private val testMvFlintIndex = FlintSparkMaterializedView.getFlintIndexName(testMvIndex) @@ -51,10 +53,19 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { .addValueSet("name") .create() - checkAnswer(sql(s"SHOW FLINT INDEX IN spark_catalog"), Seq( - Row(testMvFlintIndex, "mv", "default", null, testMvIndexShortName, false, "active"), - Row(testCoveringFlintIndex, "covering", "default", testTableName, testCoveringIndex, false, "active"), - Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"))) + checkAnswer( + sql(s"SHOW FLINT INDEX IN spark_catalog"), + Seq( + Row(testMvFlintIndex, "mv", "default", null, testMvIndexShortName, false, "active"), + Row( + testCoveringFlintIndex, + "covering", + "default", + testTableName, + testCoveringIndex, + false, + "active"), + Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"))) // Show in catalog.database flint @@ -63,11 +74,27 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { .query(testMvQuery) .create() - checkAnswer(sql(s"SHOW FLINT INDEX IN spark_catalog"), Seq( - Row(testMvFlintIndex, "mv", "default", null, testMvIndexShortName, false, "active"), - Row(testCoveringFlintIndex, "covering", "default", testTableName, testCoveringIndex, false, "active"), - Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"), - Row(FlintSparkMaterializedView.getFlintIndexName("spark_catalog.default.mv2"), "mv", "default", null, "mv2", false, "active"))) + checkAnswer( + sql(s"SHOW FLINT INDEX IN spark_catalog"), + Seq( + Row(testMvFlintIndex, "mv", "default", null, testMvIndexShortName, false, "active"), + Row( + testCoveringFlintIndex, + "covering", + "default", + testTableName, + testCoveringIndex, + false, + "active"), + Row(testSkippingFlintIndex, "skipping", "default", testTableName, null, false, "active"), + Row( + FlintSparkMaterializedView.getFlintIndexName("spark_catalog.default.mv2"), + "mv", + "default", + null, + "mv2", + false, + "active"))) deleteTestIndex( testMvFlintIndex, @@ -92,6 +119,14 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite { checkAnswer( sql(s"SHOW FLINT INDEX IN spark_catalog"), - Seq(Row(testCoveringFlintIndex, "covering", "default", testTableName, testCoveringIndex, true, "refreshing"))) + Seq( + Row( + testCoveringFlintIndex, + "covering", + "default", + testTableName, + testCoveringIndex, + true, + "refreshing"))) } }