# tWritePositionalFields 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 tWritePositionalFields running in the Spark Structured Streaming Job framework.

The Spark Structured Streaming tWritePositionalFields 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 |
| --- | --- |
| 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> |
| Output type | Select the type of serialized positional record from the drop-down list:<br><br><ul> <li><span>byte[]</span>: outputs the record as a binary byte array.</li> <li><span>String</span>: outputs the record as a string.</li> </ul> |
| Schema and Edit schema | Use the schema to define the output column that stores the serialized<br>positional record. Click Edit schema to modify the output<br>schema. |
| 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 tKinesisOutput. |
| Include Header | Select this check box to include a header row in the output. When selected,<br>specify the following separators:<br><br><ul> <li><span>Row separator</span>: enter the character that separates                        rows in the output record. The default value is <span>\n</span>.</li> <li><span>Field separator (header)</span>: enter the character that                        separates fields in the header row.</li> </ul> |
| Custom encoding | Select this check box to specify the character encoding for the output<br>record. When selected, choose the encoding from the Encoding<br>drop-down list. |
| Field formats | Configure the format of each input column. The field formats are applied<br>in schema order to create the output record:<br><br><ul> <li><span>Size</span>: enter the fixed width of the field. A value                        less than or equal to zero does not enforce a width.</li> <li><span>Padding char</span>: enter the character to add when                        the value is shorter than the specified size.</li> <li><span>Alignment</span>: select <span>Left</span>,                           <span>Center</span>, or <span>Right</span> to                        control where padding is added.</li> <li><span>Keep</span>: select the portion of a value to retain when                        it exceeds the specified size.</li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| Advanced separator (for number) | Select this check box to define the separators used when serializing<br>number values. Then specify the following characters:<br><br><ul> <li><span>Thousands separator</span>: enter the character used to                        separate groups of thousands.</li> <li><span>Decimal separator</span>: enter the character used to                        separate the integer and fractional parts of a number.</li> </ul> |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rule | This component is used as an intermediate step.<br><br>This component serializes input rows as fixed-width positional records.<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. |