---
title: semanticHash
description: "DataFrame.semanticHash method in PySpark: Returns a hash code of the logical query plan against this DataFrame."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/dataframe/semanticHash
---

# semanticHash

Returns a hash code of the logical query plan against this DataFrame.

## Syntax

```
semanticHash()
```

## Returns

int: Hash value.

## Notes

Unlike the standard hash code, the hash is calculated against the query plan simplified by tolerating the cosmetic differences such as attribute names.

This API is a developer API.

## Examples

```python
spark.range(10).selectExpr("id as col0").semanticHash()
# 1855039936
spark.range(10).selectExpr("id as col1").semanticHash()
# 1855039936
```
