[
https://issues.apache.org/jira/browse/PARQUET-2138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17525273#comment-17525273
]
ASF GitHub Bot commented on PARQUET-2138:
-----------------------------------------
shangxinli commented on code in PR #958:
URL: https://github.com/apache/parquet-mr/pull/958#discussion_r854534798
##########
parquet-cli/src/main/java/org/apache/parquet/cli/commands/ShowBloomFilterCommand.java:
##########
@@ -0,0 +1,135 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.parquet.cli.commands;
+
+import com.beust.jcommander.Parameter;
+import com.beust.jcommander.Parameters;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import java.io.IOException;
+import java.util.List;
+import java.util.Optional;
+import org.apache.commons.text.TextStringBuilder;
+import org.apache.parquet.cli.BaseCommand;
+import org.apache.parquet.cli.Util;
+import org.apache.parquet.column.values.bloomfilter.BloomFilter;
+import org.apache.parquet.hadoop.BloomFilterReader;
+import org.apache.parquet.hadoop.ParquetFileReader;
+import org.apache.parquet.hadoop.metadata.BlockMetaData;
+import org.apache.parquet.hadoop.metadata.ColumnChunkMetaData;
+import org.apache.parquet.hadoop.util.HadoopInputFile;
+import org.apache.parquet.io.InputFile;
+import org.apache.parquet.io.api.Binary;
+import org.apache.parquet.schema.MessageType;
+import org.apache.parquet.schema.PrimitiveType;
+import org.slf4j.Logger;
+
+@Parameters(commandDescription="Check bloom filters for a Parquet column")
+public class ShowBloomFilterCommand extends BaseCommand {
+
+ public ShowBloomFilterCommand(Logger console) {
+ super(console);
+ }
+
+ @Parameter(description = "<parquet path>")
+ List<String> files;
+
+ @Parameter(
+ names = { "-c", "--column" },
+ description = "Check the bloom filter indexes for the given column",
+ required = true)
+ String columnPath;
+
+ @Parameter(
+ names = { "-v", "--values" },
+ description = "Check if the given values match bloom filter",
+ required = true)
+ List<String> testValues;
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public int run() throws IOException {
+ Preconditions.checkArgument(files != null && files.size() >= 1,
+ "A Parquet file is required.");
+ Preconditions.checkArgument(files.size() == 1,
Review Comment:
Can we merge it into the above?
> Add ShowBloomFilterCommand to parquet-cli
> -----------------------------------------
>
> Key: PARQUET-2138
> URL: https://issues.apache.org/jira/browse/PARQUET-2138
> Project: Parquet
> Issue Type: Improvement
> Components: parquet-cli
> Reporter: EdisonWang
> Priority: Minor
>
> Add ShowBloomFilterCommand to parquet-cli, which can check whether given
> values of a column match bloom filter
--
This message was sent by Atlassian Jira
(v8.20.7#820007)