dbutils.fs.head() itself does not have a documented hard cap like 10 MB.
From the official dbutils reference, the signature is:
dbutils.fs.head(file: String, max_bytes: int = 65536): String
โReturns up to the specified maximum number of bytes in the given file. The bytes are returned as a UTF-8 encoded string.โ
So:
- Default: If you donโt pass
max_bytes, it returns up to 65,536 bytes (~64 KB).
- Upper limit: Docs only say โmax_bytes: intโ and do not specify a fixed maximum. In practice the limit is whatever:
- The driver can hold in memory, and
- The notebook output UI can render (thereโs a separate per-cell output cap, e.g. via
%set_cell_max_output_size_in_mb with a range of 1โ20 MB).
Thatโs why your experiments show it being โlimited by the driver memoryโ: thatโs effectively the real bound. The โ10 MBโ figure some AIs cite is likely confusing the notebook output limit with an intrinsic dbutils.fs.head limit, which isnโt documented.
Source - https://docs.databricks.com/aws/en/notebooks/notebooks-code , https://learn.microsoft.com/en-us/azure/databricks/dev-tools/databricks-utils
If this answers your question, please mark it as the accepted solution so others can find it more easily.