////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The Switch Case transform implements the Switch/Case statement found in popular programming languages like Java.

= image:transforms/icons/switchcase.svg[Switch / Case transform Icon, role="image-doc-icon"] Switch / Case

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The Switch Case transform implements the https://en.wikipedia.org/wiki/Switch_statement[Switch/Case statement] found in popular programming languages like Java.

In our case we route rows of data to one or more target transforms based on the value encountered in a certain field.

|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Maybe Supported, 24]
!Flink! image:question_mark.svg[Maybe Supported, 24]
!Dataflow! image:question_mark.svg[Maybe Supported, 24]
!===
|===

== Options

[options="header"]
|===
|Option|Description
|Transform name|The name that uniquely identifies the transform.
|Field name to switch|The field name that contains the value to use as a bases for the row routing.
|Use string contains comparison|If checked, the comparison will be true if the value is found anywhere in the field being tested.
Unchecked and the value has to exactly match the field.
|Case value data type|The data type of the values specified in this dialog
|Case value conversion mask|The conversion mask of the values specified in this dialog (numeric / date values)
|Case value decimal symbol|The decimal symbol of the values specified in this dialog (numeric values)
|Case value grouping symbol|The grouping symbol of the values specified in this dialog (numeric values)
|Case values|Here you can specify a value-target transform pair, one per row.
To specify a null value, simply leave the value column blank while entering a target transform.
Please note that it is possible to specify the same target transform more than once.
|Default target transform|All the rows that don't match any of the case values above are sent to this target transform.
|===
