Skip to content

Commit

Permalink
Checkpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
anoopj committed Feb 19, 2025
1 parent cc68565 commit 11f75e3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,6 @@ private static class TimestampNtzTableFeature extends TableFeature.ReaderWriterF
super("timestampNtz", /* minReaderVersion = */ 3, /* minWriterVersion = */ 7);
}

@Override
public boolean hasKernelWriteSupport(Metadata metadata) {
return false; // TODO: yet to be implemented in Kernel
}

@Override
public boolean metadataRequiresFeatureToBeEnabled(Protocol protocol, Metadata metadata) {
return hasTypeColumn(metadata.getSchema(), TIMESTAMP_NTZ);
Expand Down Expand Up @@ -397,6 +392,7 @@ public static TableFeature getTableFeature(String featureName) {
add("columnMapping");
add("typeWidening-preview");
add("typeWidening");
add("timestampNtz");
add(DOMAIN_METADATA_FEATURE_NAME);
add(ROW_TRACKING_FEATURE_NAME);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ protected static void validateSupportedType(DataType dataType) {
|| dataType instanceof StringType
|| dataType instanceof BinaryType
|| dataType instanceof DateType
|| dataType instanceof TimestampType) {
|| dataType instanceof TimestampType
|| dataType instanceof TimestampNTZType) {
// supported types
return;
} else if (dataType instanceof StructType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class TableFeaturesSuite extends AnyFunSuite {
val expected = Seq("columnMapping", "v2Checkpoint", "deletionVectors",
"vacuumProtocolCheck", "rowTracking", "domainMetadata", "icebergCompatV2",
"inCommitTimestamp", "appendOnly", "invariants",
"checkConstraints", "generatedColumns", "identityColumns"
"checkConstraints", "generatedColumns", "identityColumns", "timestampNtz"
)

assert(results.map(_.featureName()).toSet == expected.toSet)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import io.delta.kernel.types.IntegerType.INTEGER
import io.delta.kernel.types.StringType.STRING
import io.delta.kernel.types.TimestampNTZType.TIMESTAMP_NTZ
import io.delta.kernel.types.TimestampType.TIMESTAMP
import io.delta.kernel.types.VariantType.VARIANT
import io.delta.kernel.types._
import io.delta.kernel.utils.CloseableIterable.{emptyIterable, inMemoryIterable}
import io.delta.kernel.utils.CloseableIterable
Expand Down Expand Up @@ -82,10 +83,10 @@ class DeltaTableWritesSuite extends DeltaTableWriteSuiteBase with ParquetSuiteBa
val txnBuilder = table.createTransactionBuilder(engine, testEngineInfo, CREATE_TABLE)
val ex = intercept[KernelException] {
txnBuilder
.withSchema(engine, new StructType().add("ts_ntz", TIMESTAMP_NTZ))
.withSchema(engine, new StructType().add("variant", VARIANT))
.build(engine)
}
assert(ex.getMessage.contains("Kernel doesn't support writing data of type: timestamp_ntz"))
assert(ex.getMessage.contains("Kernel doesn't support writing data of type: variant"))
}
}

Expand Down Expand Up @@ -704,6 +705,7 @@ class DeltaTableWritesSuite extends DeltaTableWriteSuiteBase with ParquetSuiteBa
case _: BinaryType => Literal.ofBinary(vector.getBinary(rowId))
case _: DateType => Literal.ofDate(vector.getInt(rowId))
case _: TimestampType => Literal.ofTimestamp(vector.getLong(rowId))
case _: TimestampNTZType => Literal.ofTimestampNtz(vector.getLong(rowId))
case _ =>
throw new IllegalArgumentException(s"Unsupported type: ${vector.getDataType}")
}
Expand Down Expand Up @@ -990,7 +992,6 @@ class DeltaTableWritesSuite extends DeltaTableWriteSuiteBase with ParquetSuiteBa
Some(new MapType(newKeyType, newValueType, m.isValueContainsNull))
case _ => None
}
case _: TimestampNTZType => None // ignore
case s: StructType =>
val newType = removeUnsupportedTypes(s);
if (newType.length() > 0) {
Expand Down

0 comments on commit 11f75e3

Please sign in to comment.