////
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 Closure transform allows you to generate a Reflexive Transitive Closure Table for the Mondrian OLAP engine.

= image:transforms/icons/closuregenerator.svg[Closure transform Icon, role="image-doc-icon"] Closure

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

The Closure transform allows you to generate a Reflexive Transitive Closure Table for the Mondrian OLAP engine.
For more information on how a closure table can help Mondrian gain performance, go here Technically, this transform reads all input rows in memory and calculates all possible parent-child relationships.
It attaches the distance (in levels) from parent to child.

|
== 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.
|Parent ID field|The field name that contains the parent ID of the parent-child relationship.
|Child ID field|The field name that contains the child ID of the parent-child relationship.
|Distance field name|The name of the distance field that will be added to the output
|Root is zero|Check this box if the root of the parent-child tree is not empty (null) but zero (0)
|===