> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# fl_get_offset

> Extracts the offset field of a FILE value.

**Experimental feature**

[Advice on use of experimental features](/documents/4.2/maturity/features.md)

Extracts the `offset` field of a [FILE](/documents/4.2/sql-reference/data-types/other-data-types/FILE.md) value.

## Syntax

```sql theme={null}
BIGINT fl_get_offset(FILE file_expr)
```

## Parameters

`file_expr`: a FILE expression, such as the result of [to\_file](/documents/4.2/sql-reference/sql-functions/file-functions/to_file.md) or [try\_to\_file](/documents/4.2/sql-reference/sql-functions/file-functions/try_to_file.md).

## Return value

Returns a BIGINT value. Returns NULL if the FILE value or the `offset` field is NULL. The field is returned unchanged, with no defaults.

## Examples

### Example 1: Extract the field

```sql theme={null}
SELECT fl_get_offset(to_file(named_struct('uri', 'a.jpg', 'offset', 0))) AS file_offset;
```

```plaintext theme={null}
+-------------+
| file_offset |
+-------------+
| 0           |
+-------------+
```

### Example 2: The field is NULL

```sql theme={null}
SELECT fl_get_offset(to_file(named_struct('uri', 'a.jpg'))) AS file_offset;
```

```plaintext theme={null}
+-------------+
| file_offset |
+-------------+
| NULL        |
+-------------+
```

## keyword

FL\_GET\_OFFSET, FILE


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.