Skip to content

Commit

Permalink
Update en docs
Browse files Browse the repository at this point in the history
  • Loading branch information
avevad authored Dec 13, 2024
1 parent a431145 commit 96295cf
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,22 @@ SELECT
;
```

## Way {#way}

Returns active field (active index) of a variant over struct (over tuple)

### Signature

```yql
VariantItem(Variant<key1: K1, key2: K2, ...>{Flags:AutoMap})->Utf8
VariantItem(Variant<K1, K2, ...>{Flags:AutoMap})->Uint32
```

### Example

```yql
$vr = Variant(1, "0", Variant<Int32, String>);
$vrs = Variant(1, "a", Variant<a:Int32, b:String>);
SELECT Way($vr); -- 0
SELECT Way($vrs); -- "a"
```

0 comments on commit 96295cf

Please sign in to comment.