String Type does not handle special characters "(", ")", "&", "="

AJ 0 Reputation points
2024-08-14T16:15:31.9866667+00:00

I am loading a csv file with fields Speciality and Webpage URL. Datatype for both of these is set to string

Few Examples:

Speciality

Nephrology (NEP)

Internal Medicine (IM)

Nephrology (NEP)

Dermatology (D)

Webpage URL:

play.google.com/store/apps/details?id=jp.gocro.smartnews.android

thespruce.com

allears.net

si.com

newsweek.com

natashaskitchen.com.

However, Azure data flow replaces these with nulls.

Sample Dataset:

Speciality

User's image

website_urlUser's image

Azure data flow with nulls for the selected columnsUser's image

Data is being loaded to mysql: database table columns are marked varchar if that is any relevance.

This is baffling me. Any help is appreciated.

Thanks

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
846 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,823 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 26,261 Reputation points
    2024-08-15T21:01:31.68+00:00

    Some special characters might be interpreted differently by ADF or MySQL. For example, & is often used in SQL for concatenation, and = is a comparison operator.

    The CSV file might have encoding issues that cause certain characters to be misinterpreted.

    The MySQL table might be using a character set or collation that does not support certain special characters.

    If you suspect that (, ), &, and = are causing issues, you could use a derived column transformation to replace these with a safe character sequence:

    replace(replace(replace(replace(Speciality, '(', '[LEFT_PAR]'), ')', '[RIGHT_PAR]'), '&', '[AND]'), '=', '[EQUAL]')
    
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.