Hi pinot folks! I have a question related to `Segm...
# troubleshooting
c
Hi pinot folks! I have a question related to
SegmentTarPush
data ingestion jobs. I have segments stored in GCS that I want to upload to my offline table. There was an issue with my table config early on that prevented my
RealtimeToOfflineSegmentsTask
from working properly. Now the segments have been removed from my realtime table (retention date passed), but haven't been uploaded to the offline table. Because I have a GCS deep store configured, those segments that were removed from my realtime table still exist in GCS. So I want to run the
pinot-admin.sh
LaunchDataIngestionJob
command to upload those segments to my offline table. I have written the following job spec:
Copy code
executionFrameworkSpec:
  name: 'standalone'
  segmentGenerationJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentGenerationJobRunner'
  segmentTarPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentTarPushJobRunner'
  segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner'
  segmentMetadataPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentMetadataPushJobRunner'
jobType: SegmentTarPush
inputDirURI: 'gs:://my_bucket/my_table_folder'
outputDirURI: 'gs:://my_bucket/my_table_folder'
overwriteOutput: true
pinotFSSpecs:
  - scheme: gs
    className: org.apache.pinot.plugin.filesystem.GcsPinotFS
tableSpec:
  tableName: 'my_table_OFFLINE'
pinotClusterSpecs:
  - controllerURI: 'http://my_controller_url.com'
pushJobSpec:
  pushAttempts: 2
  pushRetryIntervalMillis: 1000
Am I using the right job type for what I'm trying to achieve? Is what I'm trying to do possible?
After I launch the job and look at the logs, I see that plugins have been successfully loaded, but it seems to exit after the following log line:
Copy code
INFO [IngestionJobLauncher] [main] Trying to create instance for class org.apache.pinot.plugin.ingestion.batch.standalone.Segment
m
These push jobs are for segment generation and push. What you need is to simply push already generated segment. There's upload rest api for that
c
Should I use the POST
/v2/segments
endpoint?
m
yeah. or pinot-admin.sh has an uploadSegment command which also calls the api I think
c
Is this what you're suggesting? https://docs.pinot.apache.org/manage-data/data-import/segment-upload#segment-tar-push
Copy code
pinot-admin.sh UploadSegment \\
  -controllerHost localhost \\
  -controllerPort 9000 \\
  -segmentDir /path/to/local/dir \\
  -tableName myTable
for segmentDir would I just provide a gcs url?
It requires the segment to be stored locally, or that the segment can be opened as an InputStream on PinotFS, so we can stream the entire segment tar file to the controller.
Can a segment stored in GCS be opened as an InputStream on PinotFS?
m
Yeah, it will require to be stored locally.
I am thinking if using the SegmentMetadataPush or SegmentUriPush will just push the existing segments, without the build step. Can you try?
c
yah, I'll give this a try today.
I attempted the SegmentUriPush job with the following spec:
Copy code
executionFrameworkSpec:
  name: 'standalone'
  segmentUriPushJobRunnerClassName: 'org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner'
jobType: SegmentUriPush
inputDirURI: 'gs://my_bucket/my_dir'
outputDirURI: 'gs://my_bucket/my_table_dir'
overwriteOutput: true
pinotFSSpecs:
  - scheme: gs
    className: org.apache.pinot.plugin.filesystem.GcsPinotFS
    configs:
      projectId: 'my-gcp-project-id'
      # We use a service account and not a service account key, so I wonder if I can skip this?
      # gcpKey: 'path-to-gcp json key file'
tableSpec:
  tableName: 'my_table_OFFLINE'
pinotClusterSpecs:
  - controllerURI: 'my_controller_url'
pushJobSpec:
  segmentUriPrefix: 'gs://my_project/my_dir/my_segment_file'
  segmentUriSuffix: ''
  pushAttempts: 2
  pushRetryIntervalMillis: 1000
It didn't seem to work. It failed silently and the logs stop after
2025/07/16 23:47:02.221 INFO [IngestionJobLauncher] [main] Trying to create instance for class org.apache.pinot.plugin.ingestion.batch.standalone.SegmentUriPushJobRunner
m
That seems a different issue
c
Do you think there is an issue with my job spec and that's why the ingestion job wasn't executed?
m
@Kartik Khare @Manish ^^