Can't use SegmentUriPush job
- 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
Assessment
This issue has not been assessed yet.