Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2976,7 +2976,7 @@ components:
- file_modification_timestamp
DeltaCommitResponse:
type: object
description: The response for the commit action
description: The response for the Delta commit action
DeltaGetCommits:
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private static String writeTable(
info.getStorageLocation(), info.getColumns(), temporaryCredentials);
} catch (Exception e) {
throw new CliException(
"Failed to write sample data to delta table " + info.getStorageLocation(), e);
"Failed to write sample data to Delta table " + info.getStorageLocation(), e);
}
return EMPTY;
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ public void deleteTable(Session session, UUID schemaId, String tableName) {
} catch (Throwable e) {
LOGGER.error("Error deleting table directory: {}", tableInfoDAO.getUrl(), e);
}
repositories
.getDeltaCommitRepository()
.permanentlyDeleteTableCommits(session, tableInfoDAO.getId());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch.

}
PropertyRepository.findProperties(session, tableInfoDAO.getId(), Constants.TABLE)
.forEach(session::remove);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ public class DeltaCommitDAO {
private UUID tableId;

@Column(name = "commit_version", nullable = false)
private Long commitVersion;
private long commitVersion;

@Column(name = "commit_filename", nullable = false)
private String commitFilename;

@Column(name = "commit_filesize", nullable = false)
private Long commitFilesize;
private long commitFilesize;

@Column(name = "commit_file_modification_timestamp", nullable = false)
private Date commitFileModificationTimestamp;
Expand All @@ -52,7 +52,7 @@ public class DeltaCommitDAO {
private Date commitTimestamp;

@Column(name = "is_backfilled_latest_commit", nullable = false)
private Boolean isBackfilledLatestCommit;
private boolean isBackfilledLatestCommit;

public static DeltaCommitDAO from(UUID tableId, DeltaCommitInfo commitInfo) {
return DeltaCommitDAO.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static io.unitycatalog.server.model.SecurableType.TABLE;

/**
* REST API service for coordinated commits to Delta tables in Unity Catalog.
* REST API service for Delta commits to Delta tables in Unity Catalog.
*/
@ExceptionHandler(GlobalExceptionHandler.class)
public class DeltaCommitsService extends AuthorizedService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ public static TableInfo createTestingTable(
TableType tableType,
Optional<String> storageLocation,
TableOperations tableOperations) {
return createTestingTable(
tableName, tableType, storageLocation, DataSourceFormat.DELTA, tableOperations);
}

@SneakyThrows
public static TableInfo createTestingTable(
String tableName,
TableType tableType,
Optional<String> storageLocation,
DataSourceFormat dataSourceFormat,
TableOperations tableOperations) {
if (tableType == TableType.MANAGED) {
assert storageLocation.isEmpty();
} else {
Expand All @@ -132,7 +143,7 @@ public static TableInfo createTestingTable(
.comment(TestUtils.COMMENT)
.storageLocation(storageLocation.orElse(null))
.tableType(tableType)
.dataSourceFormat(DataSourceFormat.DELTA);
.dataSourceFormat(dataSourceFormat);

return tableOperations.createTable(createTableRequest);
}
Expand Down
Loading