Questions tagged [ndjson]

NDJSON is a newline delimited JSON format.

NDJSON is a newline delimited JSON format. It is a convenient format for storing or streaming structured data that may be processed one record at a time. It works well with unix-style text processing tools and shell pipelines. It's a great format for log files. It's also a flexible format for passing messages between cooperating processes.

Spec: http://ndjson.org

119 questions
1
vote
0 answers

Mike Bostock's ndjson-split discards data?

I've gone through Mike Bostock's excellent tutorials on Command-Line Cartography and I'm confused by his use of his ndjson-split utility. That program is used to split up an array of objects in a json file, putting each object in the array on a…
Timothy Barmann
  • 598
  • 7
  • 17
1
vote
3 answers

How to parse ndjson in Pharo with NeoJSON

I want to parse ndjson (newline delimited json) data with NeoJSON on Pharo Smalltalk. ndjson data looks like this: {"smalltalk": "cool"} {"pharo": "cooler"} At the moment I convert my file stream to a string, split it on newline and then parse the…
MartinW
  • 4,966
  • 2
  • 24
  • 60
0
votes
0 answers

How to Implement Spring Boot controller that can accept a batch of records?

I'm currently working on a Spring Boot application where I need to create a service endpoint similar to the one mentioned in the Confluent Cloud documentation (link). The cURL example provided in the documentation is as follows: curl -X POST -H…
0
votes
0 answers

How to make a http request in retrofit with nd-json format?

I am using kotlin/java for android. For a module I have to make request to our elasticsearch instance. For multiple queries _msearch elastic search accepts nd-json format. {} // Index defined here {} // Query and other settings here // Repeat for…
vhmvd
  • 192
  • 3
  • 15
0
votes
0 answers

ndjson: TypeError: __init__() got an unexpected keyword argument 'encoding'

When I run the Flask app on my home PC (python 3.10.5), everything works fine. I try to run the same code on pythonanywhere using Python 3.10 and get error: Traceback (most recent call last): File "/home/speedclub/mysite/speedclub.py", line 90,…
0
votes
1 answer

Chunked or Streamed output of Azure Function Response with python

the question is very simple. I am in an azure function environment using python as programming language. My goal is to create a nd-json because I have a huge result and I want it to be returned to the caller as nd-json in a stream so I can easily…
tuxmania
  • 906
  • 2
  • 9
  • 28
0
votes
0 answers

Removing unwanted characters and indentations from a json files using jq

I have to export the data from an oracle table to the new delimited JSON format. This is the command that i used in sqlcl. SET COLSEP ',' SET SQLFORMAT json; SPOOL 'C:\json_o\employee.json' SELECT * FROM employee / SPOOL OFF and the result look…
0
votes
0 answers

Update document fields using Sanity.io CLI

I want to bulk update a single field on 100+ documents of the same document type. With the goal of keeping my import file as slim as possible, I want to just be able to include the _id and the key/value pair of the field I am updating, rather than…
0
votes
1 answer

how can i process ndjson by rxjs(Angular)?

For example, I can send request to openai-api by http-client import { HttpClient } from '@angular/common/http'; return this.http.post(open-ai-interface).subscribe(...); But, this interface returns ndjson, not json, so, how can I process this? I…
ygz
  • 9
  • 1
0
votes
0 answers

How to consume API endpoint that streams data?

I'm trying to consume an API endpoint that returns data in ndjson form. I'm using the can-ndjson-stream and undici packages. When I try to hit the endpoint, a status code of 200 is returned, but the status in Chrome's developer tools says,…
boing
  • 499
  • 2
  • 6
  • 22
0
votes
0 answers

Use Apache Beam to GroupByKey and read_csv and export to ndjson

I have a csv file without any headers that contains unique transaction IDs of various properties that have been bought and sold. Details of the dataset can be found here under 2022. I am trying to use Apache Beam to construct a new key that groups…
sk97
  • 3
  • 3
0
votes
1 answer

Mapping multiple ndJson records with Gson

I want to map multiple records in ndJson with my DTO class. Following is my ndJson file: // Record # 1 (This line is not included in the file and is only for clarification) { "profile":{ "salutation":"Mr", "title":null, …
Dragon
  • 25
  • 4
0
votes
1 answer

How to Read ndJSON file in Java

I am new to ndJSON. I have an ndJSON file with the following data: { "Top-level":{ "customer_no":"1", "created":"2019-03-27 14:24:54", "last_visited_day_time":null, "login":"roni_cost@example.com" }, "profile":{ …
Dragon
  • 25
  • 4
0
votes
1 answer

How to parse a string of multiple jsons without separators in python?

Given a single-lined string of multiple, arbitrary nested json-files without separators, like for example: contents = r'{"payload":{"device":{"serial":213}}}{"payload":{"device":{"serial":123}}}' How can contents be parsed into an array of…
benito_h
  • 460
  • 5
  • 16
0
votes
1 answer

JSON structure quesiton: multiple and different JSON entries, one txt file

I am trying to do some work with log visualization tools (Elastic and/or Splunk), but first I need to produce and format the log files from a simulation I am writing. My question, which I can't seem to find clear guidance on is: How to store…
scm.tf
  • 1