โ11-03-2026 02:38 AM
Data Ingestion (Lakeflow) Feature Bug:
While creating Data Ingestion streaming table for ingesting pdf files, so that it can store into Binary format, it doesn't allow to select for BINARY data type for a column like (content), but it chose default data type as String, which gives error as Data Type mismatch.
This bug needs to be fixed by Databricks
a month ago - last edited a month ago
Reading the PDFs with the binaryFile format returns a fixed schema (path, modificationTime, length, content) with content already typed as BINARY, so there's no column type to set (binary file data source, read_files). You can run this in the SQL editor on a pro or serverless SQL warehouse (requirements) :
CREATE OR REFRESH STREAMING TABLE <catalog>.<schema>.pdf_raw
AS SELECT * FROM STREAM read_files(
'/Volumes/<catalog>/<schema>/<volume>/<folder>/',
format => 'binaryFile',
fileNamePattern => '*.{pdf,PDF}'
);
Add SCHEDULE EVERY 1 hour after the table name if you want scheduled refreshes (standalone streaming tables).
a month ago
hI, @kapil_dua., to isolate the UI issue, first verify the source schema directly in a notebook:
df = (
spark.read
.format("binaryFile")
.option("pathGlobFilter", "*.pdf")
.load("/Volumes/<catalog>/<schema>/<volume>/<folder>/")
)
df.printSchema()
The binaryFile reader returns content as BinaryType, alongside path, modificationTime, and length.
If this produces the correct schema while the ingestion UI generates STRING, that helps narrow the problem to the generated table definition or UI configuration.
Could you share the generated SQL and exact type-mismatch error, with sensitive paths removed? Also check whether the destination table already defines content as STRING.
a month ago
a month ago
a week ago
Hello @kapil_dua, just following up. Did the suggestions here help with the binary column issue? If yes, please mark the reply that worked as the accepted solution.
a week ago
For PDF ingestion, I would separate the file ingestion mechanism from the table schema configuration.
A PDF contains binary content, so attempting to store the raw bytes in a STRING column can result in a type mismatch or an incorrect representation of the file.
I have worked with PDF extraction workflows on Databricks Apps, and for a similar use case I would first confirm whether the objective is to store the original PDF bytes or extract document content for downstream processing.
For example, consider three PDF documents.
contract_001.pdf contains two pages.
contract_002.pdf contains five pages.
contract_003.pdf contains an image-based document.
If the requirement is to retain the original files, I would consider storing them in a Unity Catalog Volume and maintaining a Delta metadata table containing the file path, document identifier and processing status.
If the requirement is to load file bytes into a Delta table, I would evaluate binaryFile ingestion through an appropriate Spark or Auto Loader pipeline instead of depending on a UI option that does not expose the required data type.
This would let the pipeline handle the raw content as binary data while preserving file metadata.
I would validate the following.
File ingestion succeeds for all three documents.
The original file sizes match the ingested binary content.
Metadata is associated with the correct document.
The downstream extraction process can access the required file content.
This does not resolve the UI limitation itself, but it offers a different ingestion approach while the limitation is investigated.
Could you confirm whether the BINARY type is unavailable only in the ingestion UI or whether the same pipeline fails when the schema is defined programmatically?