Hi @Sivagnana Sundaram, Krithiga ,
We got response from product team on the above issue. Kindly have a look:
" Yes, this is the current behavior of Synapse/Polybase: an empty string gets treated as null on export. The upcoming Gen3 DW (ded SQL Pool) will address this which will preview late 2022. Since the fix is non-trivial, there are no plans to fix for current Gen2.
However, a couple options can be done to get unblocked here:
1. When doing CETAS export, convert the empty strings to a unique placeholder value or even an empty space. The round-trip will work and differentiate null vs. empty fields.
CREATE EXTERNAL TABLE [dbo].[abc]
WITH (DATA_SOURCE = [SQLAnalyticsConnectorDataSourceTest1],LOCATION = N'/abc',FILE_FORMAT = [SQLAnalyticsConnectorDefaultFileFormat798e8ca0543342a6b43e0787ab2a7db1])
AS
SELECT
CASE WHEN name = '' THEN ' ' END AS name
FROM "dbo"."abc1"
2. Use CSV instead of parquet and specify a STRING_DELIMITER. This will natively support null/empty string differentiation as well without any work-arounds. "
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on or upvote button whenever the information provided helps you.
Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators