From ecd94a93bcfd13e897af0590a97180192f0f6619 Mon Sep 17 00:00:00 2001 From: shibei Date: Wed, 8 Jun 2022 14:20:04 +0800 Subject: [PATCH] Fixing UT --- .../spark/sql/hudi/command/index/TestIndexSyntax.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/command/index/TestIndexSyntax.scala b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/command/index/TestIndexSyntax.scala index 9ba6d993542dc..5f03ae575dd1c 100644 --- a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/command/index/TestIndexSyntax.scala +++ b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/command/index/TestIndexSyntax.scala @@ -25,9 +25,6 @@ import org.apache.spark.sql.hudi.HoodieSparkSqlTestBase import org.apache.spark.sql.hudi.command.{CreateIndexCommand, DropIndexCommand, ShowIndexesCommand} class TestIndexSyntax extends HoodieSparkSqlTestBase { - private val sqlParser: ParserInterface = spark.sessionState.sqlParser - private val analyzer: Analyzer = spark.sessionState.analyzer - test("Test Create/Drop/Show/Refresh Index") { withTempDir { tmp => Seq("cow", "mor").foreach { tableType => @@ -53,6 +50,9 @@ class TestIndexSyntax extends HoodieSparkSqlTestBase { spark.sql(s"insert into $tableName values(2, 'a2', 10, 1001)") spark.sql(s"insert into $tableName values(3, 'a3', 10, 1002)") + val sqlParser: ParserInterface = spark.sessionState.sqlParser + val analyzer: Analyzer = spark.sessionState.analyzer + var logicalPlan = sqlParser.parsePlan(s"show indexes from default.$tableName") var resolvedLogicalPlan = analyzer.execute(logicalPlan) assertResult(s"`default`.`$tableName`")(resolvedLogicalPlan.asInstanceOf[ShowIndexesCommand].tableId.toString())