Skip to content

Commit

Permalink
fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
leaves12138 committed Apr 2, 2024
1 parent 98a5ca9 commit 90beffa
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 574 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

package org.apache.paimon.fileindex;

import org.apache.paimon.CoreOptions;
import org.apache.paimon.annotation.VisibleForTesting;
import org.apache.paimon.fs.SeekableInputStream;
import org.apache.paimon.options.Options;
Expand Down Expand Up @@ -246,7 +245,7 @@ public FileIndexReader readColumnIndex(String columnName) {
FileIndexer.create(
type,
fields.get(columnName).type(),
new CoreOptions(new Options()))
new Options())
.createReader()
.recoverFrom(serializedBytes))
.orElse(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

package org.apache.paimon.fileindex;

import org.apache.paimon.CoreOptions;
import org.apache.paimon.fileindex.bloomfilter.BloomFilter;
import org.apache.paimon.options.Options;
import org.apache.paimon.types.DataType;

import static org.apache.paimon.fileindex.bloomfilter.BloomFilter.BLOOM_FILTER;
Expand All @@ -31,7 +31,7 @@ public interface FileIndexer {

FileIndexReader createReader();

static FileIndexer create(String type, DataType dataType, CoreOptions options) {
static FileIndexer create(String type, DataType dataType, Options options) {
switch (type) {
case BLOOM_FILTER:
return new BloomFilter(dataType, options);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package org.apache.paimon.fileindex.bloomfilter;

import org.apache.paimon.CoreOptions;
import org.apache.paimon.fileindex.FileIndexReader;
import org.apache.paimon.fileindex.FileIndexWriter;
import org.apache.paimon.fileindex.FileIndexer;
import org.apache.paimon.options.Options;
import org.apache.paimon.predicate.FieldRef;
import org.apache.paimon.types.DataType;

Expand All @@ -41,13 +41,11 @@ public class BloomFilter implements FileIndexer {

private final Function<Object, Integer> hashFunction;

public BloomFilter(DataType type, CoreOptions options) {
public BloomFilter(DataType type, Options options) {
int items = options.getInteger("items", 1_000_000);
double fpp = options.getDouble("fpp", 0.1);
this.hashFunction = type.accept(FastHash.INSTANCE);
this.filter =
org.apache.paimon.utils.BloomFilter.builder(
options.fileIndexBloomFilterItems(),
options.fileIndexBloomFilterFPP())
.getFilter();
this.filter = org.apache.paimon.utils.BloomFilter.builder(items, fpp).getFilter();
}

public String name() {
Expand Down
Loading

0 comments on commit 90beffa

Please sign in to comment.