aokolnychyi commented on a change in pull request #374: Migrate spark table to 
iceberg table
URL: https://github.com/apache/incubator-iceberg/pull/374#discussion_r319320522
 
 

 ##########
 File path: spark/src/main/java/org/apache/iceberg/spark/hacks/Hive.java
 ##########
 @@ -62,4 +63,16 @@ private Hive() {}
 
     return client.getPartitionsByFilter(client.getTable(db, table), exprs);
   }
+
+  public static CatalogTable getTable(SparkSession spark, String name) {
+    List<String> parts = 
Lists.newArrayList(Splitter.on('.').limit(2).split(name));
+    String db = parts.size() == 1 ? "default" : parts.get(0);
+    String table = parts.get(parts.size() == 1 ? 0 : 1);
+
+    HiveClient client = HiveUtils$.MODULE$.newClientForMetadata(
 
 Review comment:
   Is there a specific reason to use `HiveClient` directly? Would it make sense 
to use `spark.sessionState.catalog`? That way, we will also support the 
in-memory catalog and any other catalog that can return `CatalogTable` for us. 

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to