---
title: bigint function
description: Learn the syntax of the bigint function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/bigint
---

# `bigint` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime

Casts the value `expr` to BIGINT. This function is a synonym for `CAST(expr AS BIGINT)`. See [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md) for details.

## Syntax

```
bigint(expr)
```

## Arguments

* `expr`: Any expression which is castable to BIGINT.

## Returns

A BIGINT.

If `expr` is a `STRING` that cannot be parsed as a number, Databricks raises a [CAST\_INVALID\_INPUT](https://docs.databricks.com/aws/en/error-messages/cast-invalid-input-error-class.md) error. If the value overflows the `BIGINT` range, Databricks raises a [CAST\_OVERFLOW](https://docs.databricks.com/aws/en/error-messages/error-classes.md#cast_overflow) error.

## Common error conditions

* [CAST\_INVALID\_INPUT](https://docs.databricks.com/aws/en/error-messages/cast-invalid-input-error-class.md)
* [CAST\_OVERFLOW](https://docs.databricks.com/aws/en/error-messages/error-classes.md#cast_overflow)

## Examples

```sql
> SELECT bigint(current_timestamp);
 1616168320
> SELECT bigint('5');
 5

> SELECT bigint('abc');
  Error: CAST_INVALID_INPUT
```

## Related functions

* [`cast` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/cast.md)
