3434import org .apache .pinot .common .datatable .DataTable ;
3535import org .apache .pinot .common .proto .Server ;
3636import org .apache .pinot .common .utils .DataSchema ;
37- import org .apache .pinot .common .utils .grpc .GrpcRequestBuilder ;
37+ import org .apache .pinot .common .utils .grpc .ServerGrpcRequestBuilder ;
3838import org .apache .pinot .core .common .datatable .DataTableBuilder ;
3939import org .apache .pinot .core .common .datatable .DataTableBuilderV4 ;
4040import org .apache .pinot .spi .data .DimensionFieldSpec ;
4141import org .apache .pinot .spi .data .FieldSpec ;
42+ import org .apache .pinot .spi .utils .ByteArray ;
4243import org .apache .pinot .spi .utils .CommonConstants ;
4344import org .testng .annotations .Test ;
4445
@@ -172,9 +173,6 @@ protected static DataTable createDataTableWithAllTypes()
172173 case STRING :
173174 dataTableBuilder .setColumn (colId , generateRandomStringWithLength (RANDOM .nextInt (20 )));
174175 break ;
175- case OBJECT :
176- dataTableBuilder .setColumn (colId , (Object ) RANDOM .nextDouble ());
177- break ;
178176 case BOOLEAN_ARRAY :
179177 int length = RANDOM .nextInt (20 );
180178 int [] booleanArray = new int [length ];
@@ -228,12 +226,12 @@ protected static DataTable createDataTableWithAllTypes()
228226 case JSON :
229227 dataTableBuilder .setColumn (colId ,
230228 "{ " + generateRandomStringWithLength (RANDOM .nextInt (5 )) + " : "
231- + generateRandomStringWithLength (RANDOM .nextInt (10 )) + " }" );
229+ + generateRandomStringWithLength (RANDOM .nextInt (10 )) + " }" );
232230 break ;
233231 case BYTES :
234232 try {
235233 dataTableBuilder .setColumn (colId ,
236- Hex .decodeHex ("0DE0B6B3A7640000" .toCharArray ())); // Hex of BigDecimal.ONE
234+ new ByteArray ( Hex .decodeHex ("0DE0B6B3A7640000" .toCharArray () ))); // Hex of BigDecimal.ONE
237235 }
238236 catch (DecoderException e ) {
239237 throw new RuntimeException (e );
@@ -425,7 +423,7 @@ public void testPinotProxyGrpcRequest()
425423 @ Test
426424 public void testPinotGrpcRequest ()
427425 {
428- final Server .ServerRequest grpcRequest = new GrpcRequestBuilder ()
426+ final Server .ServerRequest grpcRequest = new ServerGrpcRequestBuilder ()
429427 .setSegments (ImmutableList .of ("segment1" ))
430428 .setEnableStreaming (true )
431429 .setRequestId (121 )
@@ -435,7 +433,7 @@ public void testPinotGrpcRequest()
435433 Assert .assertEquals (grpcRequest .getSql (), "SELECT * FROM myTable" );
436434 Assert .assertEquals (grpcRequest .getSegmentsCount (), 1 );
437435 Assert .assertEquals (grpcRequest .getSegments (0 ), "segment1" );
438- Assert .assertEquals (grpcRequest .getMetadataCount (), 5 );
436+ Assert .assertEquals (grpcRequest .getMetadataCount (), 6 );
439437 Assert .assertEquals (grpcRequest .getMetadataOrThrow (CommonConstants .Query .Request .MetadataKeys .REQUEST_ID ), "121" );
440438 Assert .assertEquals (grpcRequest .getMetadataOrThrow (CommonConstants .Query .Request .MetadataKeys .BROKER_ID ), "presto-coordinator-grpc" );
441439 Assert .assertEquals (grpcRequest .getMetadataOrThrow (CommonConstants .Query .Request .MetadataKeys .ENABLE_TRACE ), "false" );
@@ -455,7 +453,7 @@ private static final class TestingPinotStreamingQueryClient
455453 }
456454
457455 @ Override
458- public Iterator <Server .ServerResponse > submit (String host , int port , GrpcRequestBuilder requestBuilder )
456+ public Iterator <Server .ServerResponse > submit (String host , int port , ServerGrpcRequestBuilder requestBuilder )
459457 {
460458 return new Iterator <Server .ServerResponse >()
461459 {
0 commit comments