You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "bvaradar (via GitHub)" <gi...@apache.org> on 2023/04/24 18:35:27 UTC

[GitHub] [hudi] bvaradar commented on a diff in pull request #8543: [HUDI-6124] Optimize exception message in HoodieCatalogTable

bvaradar commented on code in PR #8543:
URL: https://github.com/apache/hudi/pull/8543#discussion_r1175652747


##########
hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/spark/sql/hudi/TestCreateTable.scala:
##########
@@ -1065,4 +1065,21 @@ class TestCreateTable extends HoodieSparkSqlTestBase {
       }
     }
   }
+
+  test("Test init HoodieCatalogTable class for non-Hudi table") {
+    val tableName = generateTableName
+    spark.sql(
+      s"""
+         | create table $tableName (
+         |  id int,
+         |  name string,
+         |  price double,
+         |  ts long
+         | ) using parquet
+       """.stripMargin)
+    val exception = intercept[IllegalArgumentException] {
+      spark.sql(s"""call show_commits(table => '$tableName', limit => 10)""").collect()
+    }
+    assert(exception.getMessage.contains(s"""$tableName is not a Hudi table"""))

Review Comment:
   use assertTrue



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org