yihua commented on code in PR #13558:
URL: https://github.com/apache/hudi/pull/13558#discussion_r2228499959


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DataSourceOptions.scala:
##########
@@ -254,6 +254,12 @@ object DataSourceReadOptions {
       .sinceVersion("1.0.0")
       .withDocumentation("A regex under the table's base path to get file 
system view information")
 
+  val POLARIS_CATALOG_CLASS_NAME: ConfigProperty[String] = ConfigProperty
+    .key("hoodie.datasource.polaris.catalog.class")
+    .defaultValue("org.apache.polaris.spark.SparkCatalog")
+    .markAdvanced()
+    .withDocumentation("Fully qualified class name of the catalog that is used 
by the Polaris spark client.")

Review Comment:
   ```suggestion
       .markAdvanced()
       .sinceVersion("1.1.0")
       .withDocumentation("Fully qualified class name of the catalog that is 
used by the Polaris spark client.")
   ```



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/spark/sql/hudi/HoodieSqlCommonUtils.scala:
##########
@@ -378,4 +378,17 @@ object HoodieSqlCommonUtils extends SparkAdapterSupport {
       throw new HoodieException(s"Got an invalid instant ($queryInstant)")
     }
   }
+
+  /**
+   * Check if Polaris catalog is enabled in the Spark session.
+   * @param sparkSession The Spark session
+   * @return true if Polaris catalog is configured, false otherwise
+   */
+  def isUsingPolarisCatalog(sparkSession: SparkSession): Boolean = {
+    val polarisCatalogClassName = 
sparkSession.conf.get(DataSourceReadOptions.POLARIS_CATALOG_CLASS_NAME.key(),
+      DataSourceReadOptions.POLARIS_CATALOG_CLASS_NAME.defaultValue())

Review Comment:
   Could `SparkConfigUtils#getStringWithAltKeys` be used to avoid calling 
`.key()` and `.defaultValue()` directly?



##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/DataSourceOptions.scala:
##########
@@ -254,6 +254,12 @@ object DataSourceReadOptions {
       .sinceVersion("1.0.0")
       .withDocumentation("A regex under the table's base path to get file 
system view information")
 
+  val POLARIS_CATALOG_CLASS_NAME: ConfigProperty[String] = ConfigProperty
+    .key("hoodie.datasource.polaris.catalog.class")

Review Comment:
   ```suggestion
       .key("hoodie.spark.polaris.catalog.class")
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to