szehon-ho commented on a change in pull request #2777:
URL: https://github.com/apache/iceberg/pull/2777#discussion_r668410968
##########
File path:
spark2/src/test/java/org/apache/iceberg/spark/source/TestSparkTableUtil.java
##########
@@ -369,6 +376,84 @@ public void testImportUnpartitionedWithWhitespace() throws
Exception {
}
}
+ public static class GetPartitions {
+
+ @Rule
+ public TemporaryFolder temp = new TemporaryFolder();
+
+ // This logic does not really depend on format
+ private final FileFormat format = FileFormat.PARQUET;
+
+ @Test
+ public void testPartitionScan() throws Exception {
+
+ List<ThreeColumnRecord> records = Lists.newArrayList(
+ new ThreeColumnRecord(1, "ab", "data"),
+ new ThreeColumnRecord(2, "b c", "data"),
+ new ThreeColumnRecord(1, "b c", "data"),
+ new ThreeColumnRecord(2, "ab", "data"));
+
+ File location = temp.newFolder("partitioned_table");
+ String tableName = "external_table";
+
+ spark.createDataFrame(records, ThreeColumnRecord.class)
+ .write().mode("overwrite").format(format.toString())
+ .partitionBy("c1", "c2").saveAsTable(tableName);
+
+ TableIdentifier source = spark.sessionState().sqlParser()
+ .parseTableIdentifier(tableName);
+
+ Map<String, String> partition1 = Stream.of(
Review comment:
Oh right forgot we have guava, thanks, changed, its much cleaner now.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]