I am trying to build a pipeline for a table we have in our azure sql database into Fabric. One of the columns has varchar(MAX) and can be quite large (intentionally).
When I try to use the copy activity with pipeline it fails, as it seems that the warehouse has a limitation of varchar(8000). Have I understood this correctly? Why does this limitation exist? How can I solve this issue?
So I found it possible to save records larger than the 8000 limit into a delta table in lakehouse, but as you wrote, the SQL analytic endpoint will truncate it.
I have went on and remodelled the column in a notebook to continue my work. Thank you for your answers!
Currently Fabric's data warehouse has a limitation for varchar data types. While varchar(MAX) is supported in Azure SQL Database, Fabric enforces a maximum length of around 8,000 characters for varchar fields.
There are a couple of reasons why Fabric might have this limitation:
Performance: Storing and processing very large strings can be resource-intensive. Limiting the size helps maintain optimal performance within the warehouse.
Data Model Design: Extremely large strings might indicate a poorly designed data model. Splitting the data into smaller chunks or using a separate table for large text fields can improve overall data management.
Solutions for Handling Large Text Fields:
Here are some options for handling your large varchar(MAX) column:
Truncate the Data: If the data exceeding 8,000 characters isn't crucial, consider truncating it before loading into Fabric. You can achieve this during the data extraction process using functions like LEFT or SUBSTRING in your SQL query.
Split the Data: If the entire content is important, you can split the large string into smaller chunks and store them in separate columns. This might require some adjustments to your data model and querying logic.
Use a Separate Table: Consider storing the large text field in a separate table with a foreign key relationship to the main table. This approach keeps your main table size manageable and simplifies querying for frequently used data points.
Hope this is helpful. Please let me know incase of further queries.
Even though the reasons for not having varchar(max) are valid, they are a poor excuse for not supporting it. Every other SQL product in the Microsoft family supports it, but not Fabric. This will make migrations harder. Sometimes we don't have a choice. For example, the source database has a column storing JSON data, which can easily go over 8000 characters. But there's no option to get this data into Fabric...
Appreciate if you could share the feedback on our feedback channel. Which would be open for the user community to upvote & comment on. This allows our product teams to consider this request in priority.
Thank you for your response. As I cannot change how the data is set up in the app I will need to handle it with one of your options. However, I thoguht of another option that might work and that is to bring the data into a lakehouse delta table. Or does the lakehouse have such limitaiton aswell?