This is an automated email from the ASF dual-hosted git repository.

wombatukun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new f1ef3b4b6ca [HUDI-8297] Get rid of HoodieIdentifier (#12663)
f1ef3b4b6ca is described below

commit f1ef3b4b6cab07615420d0a50c4d53fb20fcb241
Author: Ekaterina Belousova <[email protected]>
AuthorDate: Sat Jan 18 08:33:12 2025 +0700

    [HUDI-8297] Get rid of HoodieIdentifier (#12663)
---
 .../sql/connector/catalog/HoodieIdentifier.scala   | 43 ----------------------
 .../spark/sql/hudi/catalog/HoodieCatalog.scala     |  6 +--
 2 files changed, 1 insertion(+), 48 deletions(-)

diff --git 
a/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/connector/catalog/HoodieIdentifier.scala
 
b/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/connector/catalog/HoodieIdentifier.scala
deleted file mode 100644
index f8e0e852d61..00000000000
--- 
a/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/connector/catalog/HoodieIdentifier.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.spark.sql.connector.catalog
-
-import java.util
-import java.util.Objects
-
-/**
- * TODO [HUDI-8297] This class might not be needed anymore.
- * Using Identifier.of(namespace, name) to get a IdentifierImpl will throw
- * compile exception( Static methods in interface require -target:jvm-1.8)
- */
-case class HoodieIdentifier(namespace: Array[String], name: String) extends 
Identifier {
-
-  override def equals(o: Any): Boolean = {
-    o match {
-      case that: HoodieIdentifier => 
util.Arrays.equals(namespace.asInstanceOf[Array[Object]],
-        that.namespace.asInstanceOf[Array[Object]]) && name == that.name
-      case _ => false
-    }
-  }
-
-  override def hashCode: Int = {
-    val nh = namespace.toSeq.hashCode().asInstanceOf[Object]
-    Objects.hash(nh, name)
-  }
-}
diff --git 
a/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala
 
b/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala
index 65adee23009..78a2ed0f88b 100644
--- 
a/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala
+++ 
b/hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/hudi/catalog/HoodieCatalog.scala
@@ -331,12 +331,8 @@ class HoodieCatalog extends DelegatingCatalogExtension
 
   private def isPathIdentifier(ident: Identifier) = new 
Path(ident.name()).isAbsolute
 
-  protected def isPathIdentifier(table: CatalogTable): Boolean = {
-    isPathIdentifier(table.identifier)
-  }
-
   protected def isPathIdentifier(tableIdentifier: TableIdentifier): Boolean = {
-    isPathIdentifier(HoodieIdentifier(tableIdentifier.database.toArray, 
tableIdentifier.table))
+    isPathIdentifier(Identifier.of(tableIdentifier.database.toArray, 
tableIdentifier.table))
   }
 
   private def getExistingTableIfExists(table: TableIdentifier): 
Option[CatalogTable] = {

Reply via email to