aokolnychyi commented on a change in pull request #1228:
URL: https://github.com/apache/iceberg/pull/1228#discussion_r458928543



##########
File path: spark/src/main/java/org/apache/iceberg/spark/SparkTableUtil.java
##########
@@ -386,7 +386,7 @@ private static SparkPartition 
toSparkPartition(CatalogTablePartition partition,
     Preconditions.checkArgument(serde.nonEmpty() || 
table.provider().nonEmpty(),
         "Partition format should be defined");
 
-    String uri = String.valueOf(locationUri.get());
+    URI uri = locationUri.get();

Review comment:
       Here what Spark does:
   
   ```
     /**
      * Convert URI to String.
      * Since URI.toString does not decode the uri, e.g. change '%25' to '%'.
      * Here we create a hadoop Path with the given URI, and rely on 
Path.toString
      * to decode the uri
      * @param uri the URI of the path
      * @return the String of the path
      */
     def URIToString(uri: URI): String = {
       new Path(uri).toString
     }
   
     /**
      * Convert String to URI.
      * Since new URI(string) does not encode string, e.g. change '%' to '%25'.
      * Here we create a hadoop Path with the given String, and rely on 
Path.toUri
      * to encode the string
      * @param str the String of the path
      * @return the URI of the path
      */
     def stringToURI(str: String): URI = {
       new Path(str).toUri
     }
   ```




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to