# tWindow 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)

These properties are used to configure tWindow running in the Spark Structured Streaming Job framework.

The Spark Structured Streaming tWindow 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> |
| Window Type | Select the type of window to apply from the drop-down list:<br><br><ul> <li><span>Tumbling Window (Fixed-size, non-overlapping)</span>:                        divides the stream into fixed-size, non-overlapping time windows. Each event                        belongs to exactly one window.</li> <li><span>Sliding Window (Fixed-size, overlapping)</span>: applies                        fixed-size windows that slide forward at a defined interval. Events can                        belong to multiple windows.</li> <li><span>Session Window</span>: groups events separated by periods                        of inactivity. A new window starts when the gap between events exceeds the                        defined gap duration.</li> </ul> |
| Time Column | Select the timestamp column from the schema to use as the basis for<br>windowing. |
| Window Duration | Enter the length of each window as a time string, for example<br>"10 minutes" or "1 hour".<br><br>This property is<br>available for Tumbling Window and Sliding<br>Window. |
| Slide Duration | Enter the interval at which the window advances as a time string, for<br>example "5 minutes". The slide duration must be less than or<br>equal to the window duration.<br><br>This property is available for Sliding<br>Window only. |
| Session Gap Duration | Enter the inactivity gap that closes a session window as a time string, for<br>example "5 minutes". A new window opens when the next event<br>arrives after the gap.<br><br>This property is available for Session<br>Window only. |
| Start Time (optional) | Enter an offset to align window boundaries to a specific time, for example<br>"15 minutes". Defaults to "0 seconds" when<br>not set.<br><br>This property is available for Tumbling Window<br>and Sliding Window. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Return window expression for group by (performance<br>optimization) | Select this check box to return the window as a column expression instead<br>of applying it directly to the dataset. Use this option when passing the window<br>expression to a groupBy operation to avoid recomputing the window<br>column. |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rule | This component is used as an intermediate step.<br><br>This component adds a window column to the dataset based on<br>the selected window type and timestamp column.<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. |