[ https://issues.apache.org/jira/browse/PARQUET-1212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16480477#comment-16480477 ]
ASF GitHub Bot commented on PARQUET-1212: ----------------------------------------- gszadovszky commented on a change in pull request #479: PARQUET-1212: Column indexes: Show indexes in tools URL: https://github.com/apache/parquet-mr/pull/479#discussion_r189231231 ########## File path: parquet-cli/src/main/java/org/apache/parquet/cli/commands/ShowColumnIndexCommand.java ########## @@ -0,0 +1,165 @@ +/* + * 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 java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.Path; +import org.apache.parquet.cli.BaseCommand; +import org.apache.parquet.column.columnindex.ColumnIndex; +import org.apache.parquet.column.columnindex.OffsetIndex; +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.metadata.ParquetMetadata; +import org.apache.parquet.hadoop.util.HadoopInputFile; +import org.apache.parquet.io.InputFile; +import org.slf4j.Logger; + +import com.beust.jcommander.Parameter; +import com.beust.jcommander.Parameters; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; + +/** + * parquet-cli command to print column and offset indexes. + */ +@Parameters(commandDescription = "Prints the column and offset indexes of a Parquet file") +public class ShowColumnIndexCommand extends BaseCommand { + public ShowColumnIndexCommand(Logger console) { + super(console); + } + + @Parameter(description = "<parquet path>") + List<String> files; + + @Parameter(names = { "-c", "--column" }, description = "Shows the column/offset indexes for the given column only") + List<String> ColumnPaths; + + @Parameter(names = { "-b", + "--block" }, description = "Shows the column/offset indexes for the given block (row-group) only; " + + "blocks are referenced by their indexes from 0") + List<String> blockIndexes; + + @Parameter(names = { "-i", "--column-index" }, description = "Shows the column indexes; " Review comment: `--column -c` is used in other commands. I think, it is better to keep this option as is to be common between the different commands. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > Column indexes: Show indexes in tools > ------------------------------------- > > Key: PARQUET-1212 > URL: https://issues.apache.org/jira/browse/PARQUET-1212 > Project: Parquet > Issue Type: Sub-task > Reporter: Gabor Szadovszky > Assignee: Gabor Szadovszky > Priority: Major > -- This message was sent by Atlassian JIRA (v7.6.3#76005)