# tWriteJSONFields properties for Apache Spark Structured Streaming

[Preview](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Introduction/feature-preview-program-overview.htm)

Use these properties to configure tWriteJSONFields running in the Spark Structured Streaming Job framework.

The Spark Structured Streaming tWriteJSONFields component belongs to the Processing family.

The streaming version of this component is available in Talend Real-Time Big Data Platform and in Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Output type | Select the output format of the serialized JSON from the drop-down list:<br><br><ul> <li><span>byte[]</span>: outputs the JSON as a binary byte                        array.</li> <li><span>String</span>: outputs the JSON as a UTF-8 string.</li> </ul> |
| Schema and Edit schema | A schema is a row description. It defines the fields (columns) processed by the<br>component. When you create a Spark Job, avoid the reserved word<br>line when naming fields.<br><br><ul> <li><p><span>Built-In</span>: create and store the schema locally for                        this component only.</p></li> <li><p><span>Repository</span>: reuse a schema created and stored in                        the Repository across projects and Job designs.</p></li> </ul><br><br>Click Edit schema to modify the schema. If you modify a<br>Repository schema, the available options include:<br><br><ul> <li><p><span>View schema</span>: view the schema without modifying it.</p></li> <li><p><span>Change to built-in property</span>: change the schema to                        <span>Built-in</span> for local changes.</p></li> <li><p><span>Update repository connection</span>: modify the Repository                        schema and choose whether to propagate the changes to other Jobs.</p></li> </ul> |
| Use data column as partition key | Select this check box to use a data column as the partition key when<br>writing to a downstream component such as<br>tKinesisOutput. |
| Editor | Click ... to open the JSON mapping editor, where<br>you define the JSON structure by mapping input columns to JSON paths. The editor<br>supports three mapping tables:<br><br><ul> <li><span>Root</span>: defines the top-level JSON structure and                        maps input columns to root-level JSON fields.</li> <li><span>Group</span>: defines intermediate grouping nodes in the                        JSON structure.</li> <li><span>Loop</span>: defines the repeated elements that are                        serialized as a JSON array, with one entry per grouped row.</li> </ul> |
| Group by | Add the input columns used to group rows when building nested JSON arrays<br>in the loop table. Click the plus button to add a column. |
| Remove root node | Select this check box to output the JSON content without the root element<br>wrapper. This check box is selected by default. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is used as an intermediate step.<br><br>This component, along with the Spark Structured Streaming component Palette it belongs to,<br>appears only when you are creating a Spark Structured Streaming Job. |
| Spark Connection | You need to use the Structured Streaming Configuration<br>tab in the Run view to define the connection to a Spark cluster for<br>the whole Job.<br><br>This connection is effective on a per-Job basis. |