Skip to content

Commit

Permalink
fix test cases in /HiveSQLViewSuite
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneguow committed May 28, 2024
1 parent 6e91610 commit 0c002d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2924,12 +2924,12 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat

def showCreateTableOrViewFailToExecuteUnsupportedFeatureError(
table: CatalogTable,
features: Seq[String]): Throwable = {
unsupportedFeatures: Seq[String]): Throwable = {
new AnalysisException(
errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.WITH_UNSUPPORTED_FEATURE",
messageParameters = Map(
"table" -> table.identifier.toString,
"features" -> features.map(" - " + _).mkString("\n")))
"unsupportedFeatures" -> unsupportedFeatures.map(" - " + _).mkString("\n")))
}

def logicalPlanForViewNotAnalyzedError(): Throwable = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1325,9 +1325,9 @@ case class ShowCreateTableAsSerdeCommand(
}

private def showCreateHiveTable(metadata: CatalogTable): String = {
def reportUnsupportedError(features: Seq[String]): Unit = {
def reportUnsupportedError(unsupportedFeatures: Seq[String]): Unit = {
throw QueryCompilationErrors.showCreateTableOrViewFailToExecuteUnsupportedFeatureError(
metadata, features)
metadata, unsupportedFeatures)
}

if (metadata.unsupportedFeatures.nonEmpty) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,11 @@ class HiveSQLViewSuite extends SQLViewSuite with TestHiveSingleton {
exception = intercept[AnalysisException] {
sql("SHOW CREATE TABLE v1")
},
errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.WITH_UNSUPPORTED_FEATURE",
errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE." +
"",
parameters = Map(
"table" -> s"`$SESSION_CATALOG_NAME`.`default`.`v1`",
"features" -> " - partitioned view"
"unsupportedFeatures" -> " - partitioned view"
)
)
checkError(
Expand All @@ -226,7 +227,7 @@ class HiveSQLViewSuite extends SQLViewSuite with TestHiveSingleton {
errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.WITH_UNSUPPORTED_FEATURE",
parameters = Map(
"table" -> s"`$SESSION_CATALOG_NAME`.`default`.`v1`",
"features" -> " - partitioned view"
"unsupportedFeatures" -> " - partitioned view"
)
)
}
Expand Down

0 comments on commit 0c002d9

Please sign in to comment.