apache / apache/pinot

Can't use SegmentUriPush job

Open
#11,601 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
2d 55m
Merged PRs (30d)
182

Description

When running jobs like :
`pinot-admin.sh LaunchDataIngestionJob -jobSpecFile job.yaml`
with job.yaml a simple SegmentUriPush job type
Controller server raise a `HttpErorStatusException ... Could not find paramName tableName in path or query ...`

I think there is maybe an issue with [`FileUploadDownloadClient.getSegmentUriRequest`](https://github.com/apache/pinot/blob/master/pinot-common/src/main/java/org/apache/pinot/common/utils/FileUploadDownloadClient.java#L461).

It seems that in HttpClient RequestBuilder, when used with POST or PUT methods and no entity (which is the case here) choose to put the parameters (tableName) in a form entity ([RequestBuilder source](https://github.com/apache/httpcomponents-client/blob/54900db4653d7f207477e6ee40135b88e9bcf832/httpclient/src/main/java/org/apache/http/client/methods/RequestBuilder.java#L465))

Currently, the controller doesn't seems to accept this kind of way to pass the tableName as the method param is annotated with @QueryParam ([PinotSegmentUploadDownloadRestletResource.uploadSegmentAsJsonV2](https://github.com/apache/pinot/blob/4292356500870d960f016267660392550879c28d/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSegmentUploadDownloadRestletResource.java#L579))

It doesn't seem possible to influence RequestBuilder behavior about this. So my temporary working hack is to add `.setEntity(new StringEntity("", ContentType.DEFAULT_TEXT))` in the getSegmentUriRequest RequestBuilder initialisation

Not sure if the best fix is to change the client request or the controller server rest Api definition...

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.