@@ -10,7 +10,6 @@ import (
1010 "github.com/prometheus/prometheus/model/labels"
1111 "github.com/stretchr/testify/require"
1212
13- "github.com/grafana/loki/v3/pkg/engine/internal/datatype"
1413 "github.com/grafana/loki/v3/pkg/engine/internal/executor"
1514 "github.com/grafana/loki/v3/pkg/engine/internal/types"
1615 "github.com/grafana/loki/v3/pkg/logproto"
@@ -28,8 +27,8 @@ func TestStreamsResultBuilder(t *testing.T) {
2827 alloc := memory .NewCheckedAllocator (memory .DefaultAllocator )
2928 defer alloc .AssertSize (t , 0 )
3029
31- mdTypeLabel := datatype .ColumnMetadata (types .ColumnTypeLabel , datatype .Loki .String )
32- mdTypeMetadata := datatype .ColumnMetadata (types .ColumnTypeMetadata , datatype .Loki .String )
30+ mdTypeLabel := types .ColumnMetadata (types .ColumnTypeLabel , types .Loki .String )
31+ mdTypeMetadata := types .ColumnMetadata (types .ColumnTypeMetadata , types .Loki .String )
3332
3433 t .Run ("empty builder returns non-nil result" , func (t * testing.T ) {
3534 builder := newStreamsResultBuilder ()
@@ -40,8 +39,8 @@ func TestStreamsResultBuilder(t *testing.T) {
4039 t .Run ("rows without log line, timestamp, or labels are ignored" , func (t * testing.T ) {
4140 schema := arrow .NewSchema (
4241 []arrow.Field {
43- {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : datatype .ColumnMetadataBuiltinTimestamp },
44- {Name : types .ColumnNameBuiltinMessage , Type : arrow .BinaryTypes .String , Metadata : datatype .ColumnMetadataBuiltinMessage },
42+ {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : types .ColumnMetadataBuiltinTimestamp },
43+ {Name : types .ColumnNameBuiltinMessage , Type : arrow .BinaryTypes .String , Metadata : types .ColumnMetadataBuiltinMessage },
4544 {Name : "env" , Type : arrow .BinaryTypes .String , Metadata : mdTypeLabel },
4645 },
4746 nil ,
@@ -97,8 +96,8 @@ func TestStreamsResultBuilder(t *testing.T) {
9796 t .Run ("successful conversion of labels, log line, timestamp, and structured metadata " , func (t * testing.T ) {
9897 schema := arrow .NewSchema (
9998 []arrow.Field {
100- {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : datatype .ColumnMetadataBuiltinTimestamp },
101- {Name : types .ColumnNameBuiltinMessage , Type : arrow .BinaryTypes .String , Metadata : datatype .ColumnMetadataBuiltinMessage },
99+ {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : types .ColumnMetadataBuiltinTimestamp },
100+ {Name : types .ColumnNameBuiltinMessage , Type : arrow .BinaryTypes .String , Metadata : types .ColumnMetadataBuiltinMessage },
102101 {Name : "env" , Type : arrow .BinaryTypes .String , Metadata : mdTypeLabel },
103102 {Name : "namespace" , Type : arrow .BinaryTypes .String , Metadata : mdTypeLabel },
104103 {Name : "traceID" , Type : arrow .BinaryTypes .String , Metadata : mdTypeMetadata },
@@ -167,7 +166,7 @@ func TestStreamsResultBuilder(t *testing.T) {
167166}
168167
169168func TestVectorResultBuilder (t * testing.T ) {
170- mdTypeString := datatype .ColumnMetadata (types .ColumnTypeAmbiguous , datatype .Loki .String )
169+ mdTypeString := types .ColumnMetadata (types .ColumnTypeAmbiguous , types .Loki .String )
171170 alloc := memory .NewCheckedAllocator (memory .DefaultAllocator )
172171 defer alloc .AssertSize (t , 0 )
173172
@@ -180,8 +179,8 @@ func TestVectorResultBuilder(t *testing.T) {
180179 t .Run ("successful conversion of vector data" , func (t * testing.T ) {
181180 schema := arrow .NewSchema (
182181 []arrow.Field {
183- {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : datatype .ColumnMetadataBuiltinTimestamp },
184- {Name : types .ColumnNameGeneratedValue , Type : arrow .PrimitiveTypes .Float64 , Metadata : datatype .ColumnMetadata (types .ColumnTypeGenerated , datatype .Loki .Float )},
182+ {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : types .ColumnMetadataBuiltinTimestamp },
183+ {Name : types .ColumnNameGeneratedValue , Type : arrow .PrimitiveTypes .Float64 , Metadata : types .ColumnMetadata (types .ColumnTypeGenerated , types .Loki .Float )},
185184 {Name : "instance" , Type : arrow .BinaryTypes .String , Metadata : mdTypeString },
186185 {Name : "job" , Type : arrow .BinaryTypes .String , Metadata : mdTypeString },
187186 },
@@ -235,8 +234,8 @@ func TestVectorResultBuilder(t *testing.T) {
235234 t .Run ("rows without timestamp or value are ignored" , func (t * testing.T ) {
236235 schema := arrow .NewSchema (
237236 []arrow.Field {
238- {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : datatype .ColumnMetadataBuiltinTimestamp },
239- {Name : types .ColumnNameGeneratedValue , Type : arrow .PrimitiveTypes .Float64 , Metadata : datatype .ColumnMetadata (types .ColumnTypeGenerated , datatype .Loki .Float )},
237+ {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : types .ColumnMetadataBuiltinTimestamp },
238+ {Name : types .ColumnNameGeneratedValue , Type : arrow .PrimitiveTypes .Float64 , Metadata : types .ColumnMetadata (types .ColumnTypeGenerated , types .Loki .Float )},
240239 {Name : "instance" , Type : arrow .BinaryTypes .String , Metadata : mdTypeString },
241240 },
242241 nil ,
@@ -262,7 +261,7 @@ func TestVectorResultBuilder(t *testing.T) {
262261}
263262
264263func TestMatrixResultBuilder (t * testing.T ) {
265- mdTypeString := datatype .ColumnMetadata (types .ColumnTypeAmbiguous , datatype .Loki .String )
264+ mdTypeString := types .ColumnMetadata (types .ColumnTypeAmbiguous , types .Loki .String )
266265 alloc := memory .NewCheckedAllocator (memory .DefaultAllocator )
267266 defer alloc .AssertSize (t , 0 )
268267
@@ -275,8 +274,8 @@ func TestMatrixResultBuilder(t *testing.T) {
275274 t .Run ("successful conversion of matrix data" , func (t * testing.T ) {
276275 schema := arrow .NewSchema (
277276 []arrow.Field {
278- {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : datatype .ColumnMetadataBuiltinTimestamp },
279- {Name : types .ColumnNameGeneratedValue , Type : arrow .PrimitiveTypes .Float64 , Metadata : datatype .ColumnMetadata (types .ColumnTypeGenerated , datatype .Loki .Float )},
277+ {Name : types .ColumnNameBuiltinTimestamp , Type : arrow .FixedWidthTypes .Timestamp_ns , Metadata : types .ColumnMetadataBuiltinTimestamp },
278+ {Name : types .ColumnNameGeneratedValue , Type : arrow .PrimitiveTypes .Float64 , Metadata : types .ColumnMetadata (types .ColumnTypeGenerated , types .Loki .Float )},
280279 {Name : "instance" , Type : arrow .BinaryTypes .String , Metadata : mdTypeString },
281280 {Name : "job" , Type : arrow .BinaryTypes .String , Metadata : mdTypeString },
282281 },
0 commit comments