From 18d1a276bfda4404d5809848820625d80fe19ca1 Mon Sep 17 00:00:00 2001
From: Qianru Lao <55441375+EstherBear@users.noreply.github.com>
Date: Wed, 5 Jun 2024 16:04:45 -0400
Subject: [PATCH] [Kernel] Add the InCommitTimestamp table feature (#3218)
[Kernel] Add the `InCommitTimestamp` as supported writer table feature
---
.../main/java/io/delta/kernel/internal/TableFeatures.java | 5 ++++-
.../scala/io/delta/kernel/internal/TableFeaturesSuite.scala | 6 ++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/kernel/kernel-api/src/main/java/io/delta/kernel/internal/TableFeatures.java b/kernel/kernel-api/src/main/java/io/delta/kernel/internal/TableFeatures.java
index 07ba06b449b..5a90c07e452 100644
--- a/kernel/kernel-api/src/main/java/io/delta/kernel/internal/TableFeatures.java
+++ b/kernel/kernel-api/src/main/java/io/delta/kernel/internal/TableFeatures.java
@@ -71,7 +71,8 @@ public static void validateReadSupportedTable(
*
* - protocol writer version 1.
* - protocol writer version 2 only with appendOnly feature enabled.
- * - protocol writer version 7 with "appendOnly" feature enabled.
+ * - protocol writer version 7 with {@code appendOnly}, {@code inCommitTimestamp-preview}
+ * feature enabled.
*
*
* @param protocol Table protocol
@@ -110,6 +111,8 @@ public static void validateWriteSupportedTable(
// Only supported writer features as of today in Kernel
case "appendOnly":
break;
+ case "inCommitTimestamp-preview":
+ break;
default:
throw unsupportedWriterFeature(tablePath, writerFeature);
}
diff --git a/kernel/kernel-api/src/test/scala/io/delta/kernel/internal/TableFeaturesSuite.scala b/kernel/kernel-api/src/test/scala/io/delta/kernel/internal/TableFeaturesSuite.scala
index e54bca72753..0c1bb8d0fc7 100644
--- a/kernel/kernel-api/src/test/scala/io/delta/kernel/internal/TableFeaturesSuite.scala
+++ b/kernel/kernel-api/src/test/scala/io/delta/kernel/internal/TableFeaturesSuite.scala
@@ -68,8 +68,10 @@ class TableFeaturesSuite extends AnyFunSuite {
checkSupported(createTestProtocol(minWriterVersion = 7))
}
- test("validateWriteSupported: protocol 7 with appendOnly") {
- checkSupported(createTestProtocol(minWriterVersion = 7, writerFeatures = "appendOnly"))
+ Seq("appendOnly", "inCommitTimestamp-preview").foreach { supportedWriterFeature =>
+ test(s"validateWriteSupported: protocol 7 with $supportedWriterFeature") {
+ checkSupported(createTestProtocol(minWriterVersion = 7, supportedWriterFeature))
+ }
}
Seq("invariants", "checkConstraints", "generatedColumns", "allowColumnDefaults", "changeDataFeed",