github.com/fraugster/parquet-go@v0.12.0/cmd/parquet-tool/cmds/meta.go (about)

     1  package cmds
     2  
     3  import (
     4  	"log"
     5  	"os"
     6  
     7  	"github.com/spf13/cobra"
     8  )
     9  
    10  func init() {
    11  	rootCmd.AddCommand(metaCmd)
    12  }
    13  
    14  var metaCmd = &cobra.Command{
    15  	Use:   "meta file-name.parquet",
    16  	Short: "print the metadata of the parquet file",
    17  	Run: func(cmd *cobra.Command, args []string) {
    18  		if len(args) != 1 {
    19  			_ = cmd.Usage()
    20  			os.Exit(1)
    21  		}
    22  
    23  		if err := metaFile(os.Stdout, args[0]); err != nil {
    24  			log.Fatal(err)
    25  		}
    26  	},
    27  }