You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2021/01/13 07:52:43 UTC

[GitHub] [iceberg] zhangjun0x01 commented on a change in pull request #2082: Flink: add show partitions with specified partitions

zhangjun0x01 commented on a change in pull request #2082:
URL: https://github.com/apache/iceberg/pull/2082#discussion_r556322299



##########
File path: flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java
##########
@@ -655,10 +685,54 @@ public void alterPartitionColumnStatistics(ObjectPath tablePath, CatalogPartitio
     return Lists.newArrayList(set);
   }
 
-  @Override
-  public List<CatalogPartitionSpec> listPartitions(ObjectPath tablePath, CatalogPartitionSpec partitionSpec)
-      throws CatalogException {
-    throw new UnsupportedOperationException();
+  private String getValue(Schema schema, String name, int index, StructLike structLike) {
+    Type type = schema.findType(name);
+    if (type instanceof Types.DateType) {
+      return DateTimeUtil.dateFromDays(structLike.get(index, Integer.class)).toString();
+    } else if (type instanceof Types.TimeType) {
+      return DateTimeUtil.timeFromMicros(structLike.get(index, Long.class)).toString();
+    } else if (type instanceof Types.TimestampType) {
+      return DateTimeUtil.timestampFromMicros(structLike.get(index, Long.class)).toString();
+    } else {
+      return String.valueOf(structLike.get(index, Object.class));
+    }
+  }
+
+  private org.apache.iceberg.expressions.Expression getPartitionFilter(Schema schema,

Review comment:
       yes, I udpated it




----------------------------------------------------------------
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:
users@infra.apache.org



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