Faster perspective flattening

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Refactor
Clarity
Needs clarification
Activity status
Stale
Tech stack
python

Research direction

Start by tracing the current GatewayStruct → to_json → orjson → flatten → JSONL → pyarrow → perspective ingestion path described in the issue. Compare the three proposed directions—enhancing csp, emitting record batches directly, or having perspective flatten—and establish a measurable performance target; the issue currently names no files, tests, or acceptance criterion.

Written by the indexing model from the issue text.

Description

type: enhancement

Right now to ingest into perspective we go GatewayStruct to JSON via to_json, then from json to plain python objects via orjson, then we flatten, then we dump back to jsonl for ingestion into pyarrow and finally from pyarrow into perspective. This is done to balance performance (pyarrow json loading and perspective ingestion of pyarrow are very fast, gateway struct to json is in C++ so also faster than flattening as structured objects, orjson very fast) with the fact that we want to flatten things. In increasing order of preference, we can:

  • enhance csp to flatten
  • try to emit record batches directly instead of flattening into json and moving back and forth between python objects
  • have perspective flatten for us
Dominant language
Python
Stars
32
Forks
9
Avg merge
14h 58m
Merged PRs (30d)
17

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Point72/csp-gateway

All issues in Point72/csp-gateway

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.