# JSON

**URL:** https://www.singlestore.com/forum/c/support/json/27.md

[Latest](https://www.singlestore.com/forum/latest.md) · [Categories](https://www.singlestore.com/forum/categories.md) · [Tags](https://www.singlestore.com/forum/tags.md)

---

## [JSON syntax error at byte 0 of object 0](https://www.singlestore.com/forum/t/json-syntax-error-at-byte-0-of-object-0/7545)

<div class="topic-metadata">

**Author:** [@Sowmya](https://www.singlestore.com/forum/u/Sowmya)\
**Replies:** 1\
**Last updated:** [March 13, 2024, 7:11am UTC](https://www.singlestore.com/forum/t/json-syntax-error-at-byte-0-of-object-0/7545 "2024-03-13T07:11:00Z")

</div>

Dears, I am trying to insert JSON messages from JSON schema defined topic into a table called jsoncheck. Below is the pipeline syntax I am using CREATE OR REPLACE PIPELINE pl\_b2b\_json\_schema AS LOAD DATA KAFKA ‘10.XX.…

---

## [UPDATE query failure with 'Invalid JSON value' error on unrelated column](https://www.singlestore.com/forum/t/update-query-failure-with-invalid-json-value-error-on-unrelated-column/7414)

<div class="topic-metadata">

**Author:** [@osvaldo](https://www.singlestore.com/forum/u/osvaldo)\
**Replies:** 2\
**Last updated:** [January 28, 2024, 8:29pm UTC](https://www.singlestore.com/forum/t/update-query-failure-with-invalid-json-value-error-on-unrelated-column/7414 "2024-01-28T20:29:20Z")

</div>

Hello community, I’ve been successfully running the following UPDATE query in SingleStore for months: UPDATE app\_events e JOIN users u USING(user\_id) SET e.server\_id = u.server\_id WHERE e.event\_date \>= CURRENT\_DATE() -…

---

## [Out of range error while accessing a boolean field of a JSON object stored in a column](https://www.singlestore.com/forum/t/out-of-range-error-while-accessing-a-boolean-field-of-a-json-object-stored-in-a-column/1832)

<div class="topic-metadata">

**Author:** [@Abhinav](https://www.singlestore.com/forum/u/Abhinav)\
**Replies:** 2\
**Last updated:** [November 22, 2023, 6:48am UTC](https://www.singlestore.com/forum/t/out-of-range-error-while-accessing-a-boolean-field-of-a-json-object-stored-in-a-column/1832 "2023-11-22T06:48:58Z")

</div>

Following the documentation: SingleStoreDB Cloud · SingleStore Documentation and JSON\_EXTRACT\_\<type\> · SingleStore Documentation We’re implementing a stored procedure as part of the Kafka Memsql pipeline. We have a mi…

---

## [How to merge multiple arrays in one?](https://www.singlestore.com/forum/t/how-to-merge-multiple-arrays-in-one/7253)

<div class="topic-metadata">

**Author:** [@emil.rakaev](https://www.singlestore.com/forum/u/emil.rakaev)\
**Replies:** 3\
**Last updated:** [October 31, 2023, 3:07am UTC](https://www.singlestore.com/forum/t/how-to-merge-multiple-arrays-in-one/7253 "2023-10-31T03:07:32Z")

</div>

If i have table with json field like 1 … \[‘label\_1’, ‘label\_2’\] 2 … \[‘label\_3’, ‘label\_4’\] How can i merge them to get result as \[‘label\_1’, ‘label\_2’, ‘label\_3’, ‘label\_4’\] ?

---

## [About iterate nested array json](https://www.singlestore.com/forum/t/about-iterate-nested-array-json/7251)

<div class="topic-metadata">

**Author:** [@emil.rakaev](https://www.singlestore.com/forum/u/emil.rakaev)\
**Replies:** 1\
**Last updated:** [October 25, 2023, 12:17am UTC](https://www.singlestore.com/forum/t/about-iterate-nested-array-json/7251 "2023-10-25T00:17:21Z")

</div>

i have table with json filed which contain array like \[“label\_1”, “label\_2”\]. After use json\_agg i get object as nested list \[\[“label\_1”, “label\_2”\], \[“label\_1”, “label\_2”\], \[“label\_1”, “label\_2”\]\]. Then i create functio…

---

## [JSON Parsing Error](https://www.singlestore.com/forum/t/json-parsing-error/7110)

<div class="topic-metadata">

**Author:** [@himawari](https://www.singlestore.com/forum/u/himawari)\
**Replies:** 1\
**Last updated:** [August 24, 2023, 10:54am UTC](https://www.singlestore.com/forum/t/json-parsing-error/7110 "2023-08-24T10:54:56Z")

</div>

I am trying to create a procedure and a pipeline as following. DELIMITER // CREATE OR REPLACE PROCEDURE party\_proc (q query(msg json)) AS BEGIN insert into party\_interaction select msg::$specversion from q; END // …

---

## [Is there a way to create column on the fly in Singlestore?](https://www.singlestore.com/forum/t/is-there-a-way-to-create-column-on-the-fly-in-singlestore/7081)

<div class="topic-metadata">

**Author:** [@dabhibhaskar2](https://www.singlestore.com/forum/u/dabhibhaskar2)\
**Replies:** 1\
**Last updated:** [August 16, 2023, 12:56am UTC](https://www.singlestore.com/forum/t/is-there-a-way-to-create-column-on-the-fly-in-singlestore/7081 "2023-08-16T00:56:05Z")

</div>

I am trying to load the unstructured data into the Singlestore. I am not sure what different kind of key pairs will be there will i will be loading as the column and data. The number of column may keep changing in the fu…

---

## [Json\_get\_type inconsistent results](https://www.singlestore.com/forum/t/json-get-type-inconsistent-results/6764)

<div class="topic-metadata">

**Author:** [@gtbenedict](https://www.singlestore.com/forum/u/gtbenedict)\
**Replies:** 3\
**Last updated:** [May 9, 2023, 3:14pm UTC](https://www.singlestore.com/forum/t/json-get-type-inconsistent-results/6764 "2023-05-09T15:14:23Z")

</div>

This function seems to return inconsistent results. I have some json docs that are also not consistent. Some have an array at inputjson::Maps::Map and others don’t. I’m trying to bring the json into a procedure and pr…

---

## [Unable to Insert into JSON Column via NodeJS](https://www.singlestore.com/forum/t/unable-to-insert-into-json-column-via-nodejs/6642)

<div class="topic-metadata">

**Author:** [@swateek](https://www.singlestore.com/forum/u/swateek)\
**Replies:** 0\
**Last updated:** [March 27, 2023, 8:45am UTC](https://www.singlestore.com/forum/t/unable-to-insert-into-json-column-via-nodejs/6642 "2023-03-27T08:45:51Z")

</div>

I have a query that works very well when done from the SQL Editor of SingleStore. Here’s the query. INSERT INTO mytbl(interaction\_id, user\_id, msg, created\_by) VALUES ('29','admin@gmail.com','{"query":"What was the diff…

---

## [COALESCE null with json empty array](https://www.singlestore.com/forum/t/coalesce-null-with-json-empty-array/4928)

<div class="topic-metadata">

**Author:** [@benny](https://www.singlestore.com/forum/u/benny)\
**Replies:** 3\
**Last updated:** [August 30, 2022, 10:10am UTC](https://www.singlestore.com/forum/t/coalesce-null-with-json-empty-array/4928 "2022-08-30T10:10:19Z")

</div>

Hi, having a query select User.\*, COALESCE((select JSON\_AGG(Post.\*) from Post where userId = User.userId), '\[\]') as postJson Returns a “postJson” field that is a string when JSON\_AGG(Post.\*) returns null (when there a…

---

## [How to count occurrences in JSON array](https://www.singlestore.com/forum/t/how-to-count-occurrences-in-json-array/4635)

<div class="topic-metadata">

**Author:** [@Bananas](https://www.singlestore.com/forum/u/Bananas)\
**Replies:** 2\
**Last updated:** [June 2, 2022, 10:00pm UTC](https://www.singlestore.com/forum/t/how-to-count-occurrences-in-json-array/4635 "2022-06-02T22:00:56Z")

</div>

I have a table with a JSON field. The field contains one array of strings like: \["apple", "orange"\] \["apple"\] \["banana", "orange"\] \["pineapple", "banana", "orange"\] How can I get the count of each of those value ? Like…

---

## [Querying JSON data from Kafka pipeline](https://www.singlestore.com/forum/t/querying-json-data-from-kafka-pipeline/3999)

<div class="topic-metadata">

**Author:** [@Mayura](https://www.singlestore.com/forum/u/Mayura)\
**Replies:** 1\
**Last updated:** [February 23, 2022, 10:51pm UTC](https://www.singlestore.com/forum/t/querying-json-data-from-kafka-pipeline/3999 "2022-02-23T22:51:19Z")

</div>

We have injested JSON data from a Kafka pipeline into a single column of the Singlestore table. How to achieve the following query given a sample/subset schema as follows - Let me try to depict my scenario with a subset…

---

## [How to access JSON field with DOT in the key](https://www.singlestore.com/forum/t/how-to-access-json-field-with-dot-in-the-key/3797)

<div class="topic-metadata">

**Author:** [@ekrish](https://www.singlestore.com/forum/u/ekrish)\
**Replies:** 1\
**Last updated:** [February 7, 2022, 7:37pm UTC](https://www.singlestore.com/forum/t/how-to-access-json-field-with-dot-in-the-key/3797 "2022-02-07T19:37:24Z")

</div>

Hello All, Is there a way to retrieve a JSON field that has period in the key name. For ex Table Tab has JSON field Amount and the content is as below {“tot.Amt”:1000,“tot.BalAm”:200,“tot.PymtAm”:0} How do I retrieve …

---

## [Get all keys in a Json object](https://www.singlestore.com/forum/t/get-all-keys-in-a-json-object/2866)

<div class="topic-metadata">

**Author:** [@prateek](https://www.singlestore.com/forum/u/prateek)\
**Replies:** 2\
**Last updated:** [January 21, 2022, 10:32pm UTC](https://www.singlestore.com/forum/t/get-all-keys-in-a-json-object/2866 "2022-01-21T22:32:44Z")

</div>

Hi Do we have a method to get all the keys in a json object in memsql? Similar to JSON\_KEYS of MySQL or json\_object\_keys of PostgreSQL. Couldn’t find one in the MemSQL docs. Thanks & Regards.

---

## [Unnesting JSON / Listing Keys](https://www.singlestore.com/forum/t/unnesting-json-listing-keys/193)

<div class="topic-metadata">

**Author:** [@scott](https://www.singlestore.com/forum/u/scott)\
**Replies:** 5\
**Last updated:** [January 21, 2022, 10:31pm UTC](https://www.singlestore.com/forum/t/unnesting-json-listing-keys/193 "2022-01-21T22:31:53Z")

</div>

I would like to unnest JSON with similar semantics to the Presto UNNEST function. So for example, if I had a JSON blob like {foo: "bar"} then I would like to generate table with all the keys in one column and all the va…

---

## [In JSON fields, very large numbers are converted to DOUBLE](https://www.singlestore.com/forum/t/in-json-fields-very-large-numbers-are-converted-to-double/3514)

<div class="topic-metadata">

**Author:** [@smaxwell](https://www.singlestore.com/forum/u/smaxwell)\
**Replies:** 1\
**Last updated:** [November 12, 2021, 10:28pm UTC](https://www.singlestore.com/forum/t/in-json-fields-very-large-numbers-are-converted-to-double/3514 "2021-11-12T22:28:41Z")

</div>

We are running into a situation where we are ingesting large JSON flat files into SingleStore. The tables contain numeric that are very large numbers (some 25+ digits). When querying the data, some of our QA staff noti…

---

## [Unable to call stored procedure with array json parameter from C#](https://www.singlestore.com/forum/t/unable-to-call-stored-procedure-with-array-json-parameter-from-c/3312)

<div class="topic-metadata">

**Author:** [@sgorantla](https://www.singlestore.com/forum/u/sgorantla)\
**Replies:** 2\
**Last updated:** [September 21, 2021, 12:11pm UTC](https://www.singlestore.com/forum/t/unable-to-call-stored-procedure-with-array-json-parameter-from-c/3312 "2021-09-21T12:11:02Z")

</div>

how do we can call stored procedure with json array as input to store procedure from .Net ? I tried below code but it doesnt work. sql: CREATE OR REPLACE PROCEDURE ReportData(jsonArray ARRAY(json)) AS DECLARE C# co…

---

## [JSON datatype length](https://www.singlestore.com/forum/t/json-datatype-length/2763)

<div class="topic-metadata">

**Author:** [@godiyal.sumit](https://www.singlestore.com/forum/u/godiyal.sumit)\
**Replies:** 1\
**Last updated:** [February 12, 2021, 12:58am UTC](https://www.singlestore.com/forum/t/json-datatype-length/2763 "2021-02-12T00:58:31Z")

</div>

Hi All, I want to store a column as a JSON datatype. I want to know what is the maximum column length available for a JSON datatype in SingleStore. If we define a column of JSON datatype is there any column length limit…

---

## [Querying dynamic json array](https://www.singlestore.com/forum/t/querying-dynamic-json-array/2704)

<div class="topic-metadata">

**Author:** [@chris.king](https://www.singlestore.com/forum/u/chris.king)\
**Replies:** 3\
**Last updated:** [January 25, 2021, 9:44pm UTC](https://www.singlestore.com/forum/t/querying-dynamic-json-array/2704 "2021-01-25T21:44:32Z")

</div>

Hi there, We’re having trouble reading json and hoping for some assistance. We have some very large customer profile data files in json format. Within the json are several arrays such as for contact details. For example…

---

## [How to work with relational \<-\> json data?](https://www.singlestore.com/forum/t/how-to-work-with-relational-json-data/2657)

<div class="topic-metadata">

**Author:** [@jckodel](https://www.singlestore.com/forum/u/jckodel)\
**Replies:** 7\
**Last updated:** [January 8, 2021, 2:05am UTC](https://www.singlestore.com/forum/t/how-to-work-with-relational-json-data/2657 "2021-01-08T02:05:54Z")

</div>

I’m having trouble to getting JSON to work in SIngleStore DB. I’m using MSSQL for my project and I’m trying to translate it to SingleStore. Consider this table: CREATE TABLE dbo.Categories ( id int NOT NULL, parentId…

---

## [Unable to ingest JSON data with PIPELINE INTO PROCEDURE](https://www.singlestore.com/forum/t/unable-to-ingest-json-data-with-pipeline-into-procedure/1702)

<div class="topic-metadata">

**Author:** [@pkodavoo](https://www.singlestore.com/forum/u/pkodavoo)\
**Replies:** 4\
**Last updated:** [March 27, 2020, 10:08am UTC](https://www.singlestore.com/forum/t/unable-to-ingest-json-data-with-pipeline-into-procedure/1702 "2020-03-27T10:08:38Z")

</div>

Hi Team, I am facing issue while ingesting a JSON data via PIPELINE to a table using Store Procedure. I see NULL values are getting inserted in the table. Procedure Script: DELIMITER // CREATE OR REPLACE PROCEDURE o…
