-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Optimization of Parquet Predicate Pushdown Capability #4608
Changes from 5 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -810,6 +810,65 @@ public void testDeletionVectorsWithFileIndexInFile() throws Exception { | |
"1|4|500|binary|varbinary|mapKey:mapVal|multiset")); | ||
} | ||
|
||
@Test | ||
public void testDeletionVectorsWithParquetFilter() throws Exception { | ||
FileStoreTable table = | ||
createFileStoreTable( | ||
conf -> { | ||
conf.set(BUCKET, 1); | ||
conf.set(DELETION_VECTORS_ENABLED, true); | ||
conf.set(FILE_FORMAT, "parquet"); | ||
conf.set("parquet.block.size", "1048576"); | ||
conf.set("parquet.page.size", "1024"); | ||
}); | ||
|
||
BatchWriteBuilder writeBuilder = table.newBatchWriteBuilder(); | ||
|
||
BatchTableWrite write = | ||
(BatchTableWrite) | ||
writeBuilder | ||
.newWrite() | ||
.withIOManager(new IOManagerImpl(tempDir.toString())); | ||
|
||
for (int i = 0; i < 2000; i++) { | ||
write.write(rowData(i, i, i * 100L)); | ||
} | ||
|
||
List<CommitMessage> messages = write.prepareCommit(); | ||
BatchTableCommit commit = writeBuilder.newCommit(); | ||
commit.commit(messages); | ||
write = | ||
(BatchTableWrite) | ||
writeBuilder | ||
.newWrite() | ||
.withIOManager(new IOManagerImpl(tempDir.toString())); | ||
for (int i = 1000; i < 2000; i++) { | ||
write.write(rowDataWithKind(RowKind.DELETE, i, i, i * 100L)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same rowDataWithKind(RowKind.DELETE, 0, i, i * 100L) |
||
} | ||
|
||
messages = write.prepareCommit(); | ||
commit = writeBuilder.newCommit(); | ||
commit.commit(messages); | ||
|
||
PredicateBuilder builder = new PredicateBuilder(ROW_TYPE); | ||
List<Split> splits = toSplits(table.newSnapshotReader().read().dataSplits()); | ||
|
||
for (int i = 500; i < 510; i++) { | ||
TableRead read = table.newRead().withFilter(builder.equal(0, i)).executeFilter(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe builder.equal(1, i) is what you want. Partition predicate will not push down. |
||
assertThat(getResult(read, splits, BATCH_ROW_TO_STRING)) | ||
.isEqualTo( | ||
Arrays.asList( | ||
String.format( | ||
"%d|%d|%d|binary|varbinary|mapKey:mapVal|multiset", | ||
i, i, i * 100L))); | ||
} | ||
|
||
for (int i = 1500; i < 1510; i++) { | ||
TableRead read = table.newRead().withFilter(builder.equal(0, i)).executeFilter(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I misunderstood the first column as the primary key... I'll make the correction. |
||
assertThat(getResult(read, splits, BATCH_ROW_TO_STRING)).isEmpty(); | ||
} | ||
} | ||
|
||
@Test | ||
public void testDeletionVectorsWithFileIndexInMeta() throws Exception { | ||
FileStoreTable table = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want test datas in one bucket in deletion vector, just rowData(0, i, i*100L), the first column is "pt" for partition .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (int i = 0; i < 2000; i++) {
write.write(rowData(i, i, i * 100L));
The code above will write 2000 records in 2000 partitions.