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
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,11 @@ private void compactDataEvolutionTable(
}
DataEvolutionCompactCoordinator compactCoordinator =
new DataEvolutionCompactCoordinator(
table, partitionPredicate, false, false, snapshot);
table,
partitionPredicate,
table.coreOptions().blobCompactionEnabled(),
false,
snapshot);
CommitMessageSerializer messageSerializerser = new CommitMessageSerializer();
String commitUser = createCommitUser(table.coreOptions().toConfiguration());
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,31 @@ class BlobTestBase extends PaimonSparkTestBase {
}
}

test("Blob: test compaction with blob compaction enabled") {
withTable("t") {
sql(
"CREATE TABLE t (id INT, data STRING, picture BINARY) TBLPROPERTIES ('row-tracking.enabled'='true', 'data-evolution.enabled'='true', 'blob-field'='picture', 'blob-compaction.enabled'='true')")
for (i <- 1 to 10) {
sql("INSERT INTO t VALUES (" + i + ", 'paimon', X'48656C6C6F')")
}
sql("INSERT INTO t VALUES (1, 'paimon', X'48656C6C6F')")

checkAnswer(
sql("SELECT COUNT(*) FROM `t$files`"),
Seq(Row(22))
)
sql("CALL paimon.sys.compact('t')").collect()
checkAnswer(
sql("SELECT COUNT(*) FROM `t$files`"),
Seq(Row(2))
)
checkAnswer(
sql("SELECT *, _ROW_ID, _SEQUENCE_NUMBER FROM t LIMIT 1"),
Seq(Row(1, "paimon", Array[Byte](72, 101, 108, 108, 111), 0, 11))
)
}
}

test("Blob: merge-into updates non-blob column on raw blob table with split blob files") {
withTable("s", "t") {
sql(
Expand Down
Loading