MCPcopy
hub / github.com/grafana/tempo / Run

Method Run

cmd/tempo-cli/cmd-convert-parquet-3to4.go:29–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27}
28
29func (cmd *convertParquet3to4) Run() error {
30 cmd.In = getPathToBlockDir(cmd.In)
31
32 // open the input parquet file
33 in, pf, err := openParquetFile(cmd.In)
34 if err != nil {
35 return err
36 }
37 defer in.Close()
38
39 // open the input metadata file
40 meta, err := readBlockMeta(cmd.In)
41 if err != nil {
42 return err
43 }
44
45 // create output block
46 outR, outW, _, err := local.New(&local.Config{
47 Path: cmd.Out,
48 })
49 if err != nil {
50 return err
51 }
52
53 // calculate dedicated columns
54 var dedicatedCols backend.DedicatedColumns
55
56 if len(cmd.DedicatedColumns) > 0 {
57 dedicatedCols = make(backend.DedicatedColumns, 0, len(cmd.DedicatedColumns))
58
59 for _, col := range cmd.DedicatedColumns {
60 att, err := traceql.ParseIdentifier(col)
61 if err != nil {
62 return err
63 }
64
65 scope := backend.DedicatedColumnScopeSpan
66 if att.Scope == traceql.AttributeScopeResource {
67 scope = backend.DedicatedColumnScopeResource
68 }
69
70 fmt.Printf("add dedicated column scope=%s name=%s\n", scope, att.Name)
71
72 dedicatedCols = append(dedicatedCols, backend.DedicatedColumn{
73 Scope: scope,
74 Name: att.Name,
75 Type: backend.DedicatedColumnTypeString,
76 })
77 }
78 } else {
79 dedicatedCols = meta.DedicatedColumns
80 }
81
82 // copy block
83 blockCfg := &common.BlockConfig{
84 BloomFP: 0.99,
85 BloomShardSizeBytes: 1024 * 1024,
86 Version: vparquet4.VersionString,

Callers

nothing calls this directly

Calls 11

NewFunction · 0.92
ParseIdentifierFunction · 0.92
CreateBlockFunction · 0.92
NewReaderFunction · 0.92
NewWriterFunction · 0.92
getPathToBlockDirFunction · 0.85
openParquetFileFunction · 0.85
readBlockMetaFunction · 0.85
CloseMethod · 0.65
JoinMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected