Hi @Nitish Sharma
Welcome to Microsoft Q&A platform and thanks for posting your query here.
I understand that you're facing issues when writing from Spark to a Synapse dedicated SQL pool due to the default Clustered Columnstore Index (CCI) restrictions on MAX
data types. Since Synapse does not support MAX
in a CCI table, here are some alternative approaches you can consider:
- Use VarChar with a Fixed Length – Instead of
VARCHAR(MAX)
, define a reasonable fixed-lengthVARCHAR(n)
that fits your data requirements. - Create the Table in Advance – Instead of letting Spark create the table dynamically, predefine it in Synapse with a compatible schema.
- Use Delta Lake or External Tables – If flexibility is needed, you can store data in Delta Lake on ADLS and query it using Synapse.
- Manually Define Indexes – Use
DISTRIBUTION
and indexing strategies explicitly when creating the table, ensuring compatibility with Synapse's CCI requirements.
Let me know if you need further clarification or additional recommendations!
Hope this helps. Do let us know if you any further queries.
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.