Questions tagged [json-flattener]

To be used for "JSON Flattener" java utility available at https://github.com/wnameless/json-flattener

38 questions
4
votes
2 answers

JSON Flattening and table creation

Could somebody help me to create an SQL statement to flatten JSON data in Snowflake Table1 table, in one JSON_DATA column that has an array? JSON Data { "id": "1234-567-890", "parent_id": "00-123-safsf-3345", "data": [ { "id":…
2
votes
3 answers

How to make JSON flattening memory efficient?

Problem Statement: I have around 500 ZIP files with lots of XMLS, i am able to convert them to JSON and parse them to parquet files as example below for one nested JSON file. Not able to process multiple files with spark also I have below code that…
user9946307
2
votes
3 answers

Flatting a JSON file into Pandas Dataframe in Python

I have the json in this format: { "fields": { "tcidte": { "mode": "required", "type": "date", "format": "%Y%m%d" }, "tcmcid": { "mode": "required", "type":…
Elliot_J
  • 25
  • 5
2
votes
2 answers

swift: How can I decode an array of json objects, without creating a struct, that holds an array of said objects?

My data looks like this: "places": [ { "id": 15, "name": "København", "typeId": 6, "coordinates": { "lat": "55.6760968", "lng": "12.5683372" }, …
1
vote
2 answers

snowflake json data flatten in existing table fields

I have a snowflake table as below table name: raw_data id conv_type transcript 1 chat [{"by":"sys", "text":" can I help you?", "time":"2023-01-01 11:11:11", "comments":""},{"by":"person1", "text":" yes tell me", "time":"2023-01-01 11:12:11",…
1
vote
2 answers

Converting JSON/dict to flatten string with indicator tokens

Given an input like: {'example_id': 0, 'query': ' revent 80 cfm', 'query_id': 0, 'product_id': 'B000MOO21W', 'product_locale': 'us', 'esci_label': 'I', 'small_version': 0, 'large_version': 1, 'split': 'train', 'product_title': 'Panasonic…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
vote
0 answers

Using Recursive feature while Flattening in Snowflake

I have a JSON string, which needs to be parsed in order to retrieve particular values.Here is an example I am working with; { "assignable_type": "SHIPMENT", "rule": { "rules": [ { "meta_data": {}, "rules": [ …
jay
  • 1,319
  • 6
  • 23
  • 42
1
vote
1 answer

Snowflake : Json data flattern

I have below sql to fetch the data from JSON file, but my file contains array of data with multiple values. SELECT select DISTINCT ,REPLACE(DOCUMENT:"_id"::VARCHAR(50),'guests-','') GUEST_ID ,PARSE_JSON(DOCUMENT):"_rev"::string as…
Bharat
  • 31
  • 1
1
vote
1 answer

How to flatten objects in mongodb automatically

I have some data that needs to be flattened, which means go from this format: "user": { "id": "AEC77ACD-02D3-0057-842F-DC23D6312389", "name": "Eliza Chukiua", "email": "eliza.chukiua@booking.com", "group": "SSO", …
mstolet
  • 11
  • 2
1
vote
1 answer

Python - Method needed to flatten highly nested json, i.e. "class.properties.name.properties.firstname"

I am needing to take a highly nested json file (i.e. Elasticsearch mapping for an index) and produce a list of items. Example Elasticsearch Mapping: { "mappings": { "properties": { "class": { "properties": { …
Jennifer Crosby
  • 185
  • 1
  • 1
  • 14
1
vote
1 answer

Pandas more time efficient flatten

In this question I got help with flatten of each row in a column of a dataframe. [{'first_open_time': {'int_value': '1652796000000', 'set_timestamp_micros': '1652792823456000'}}, {'User_dedication': {'string_value': '1', 'set_timestamp_micros':…
Gwinbleid
  • 55
  • 7
1
vote
1 answer

Flattening nested JSON with LIST values in it using Pandas

I am trying to flatten this nested JSON file: { "1": { "name": "Treez #0001", "description": "Treez #0001", "image": "", "atributes": [ { "trait_type": "Apple Count", …
erikci
  • 159
  • 7
1
vote
1 answer

How to convert this nested array JSON response column to DataFrame in pandas Python

I have a pandas data frame which has a json response column I have read the data using this code: data = pd.read_csv(f"""bureau_response_1.csv""",sep=";") Later i use eval function to evaluate using this…
Ak Suhail
  • 11
  • 3
1
vote
1 answer

Query to count all records without certain key in the json column of the snowflake table

I am trying to fetch the count the number of records from a Snowflake table without certain keys in the json column of that particular record. Here’s how the snowflake table looks like : EMP_ID|DEPARTMENT_NAME|EID|DETAILS EMP10001 | Finance…
1
vote
0 answers

Flatten / un-flatten nested JSON objects

I am using this online fattening script - https://jsfiddle.net/S2hsS . I am using. It is flatting plain array also. ie, I have an array in my json [43322, 454353, 56546] It converting "events.events[0]._source.Ids[0]": 43322, …
Sun
  • 3,444
  • 7
  • 53
  • 83
1
2 3