Column Names with Parentheses
In an effort to faithfully recreate an existing report, I have been asked to create some column names that include parentheses. I'm using a SQL Query code recipe to write the query in such a way as to give me the desired output. However, it creates the columns in the output dataset with underscores in the place of all parentheses.
I have found a workaround for this, but I'm worried because it is brittle. From the Schema tab of the output dataset, I can change the column names to include parentheses. And if I run the recipe to build the dataset, I get the column names the way I need them - containing parentheses. However, the reason I say this is brittle is because if anyone tries to Validate the SQL Query recipe, it will detect changes in the schema and attempt to put the underscores back. I am hesitant to build a long-term business process with such a vulnerability, and am therefore not considering this workaround to be a solution.
The next workaround I plan to attempt is to union a row containing my desired columns names as the first row of the dataset and to then extract my data without the proper headers so that the first row of the dataset acts as the header row. I would like to avoid this if I can, but I think it's the next logical step.
I know I'm not the first person to need parentheses in column names. Has anyone else solved this problem more gracefully than either of my workarounds? My destination connection is an Azure SQL DB.
Thank you!
Answers
-
Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,225 Dataiker
Hi @MossandRoy
,
Indeed we don't support column names with parenthesis. Some possible workarounds would be :
1) Create a view that renames these columns without parentheses and query the view instead of the table
2) Use a SQL query dataset instead of SQL table dataset in which they make a query that renames the columns
Thanks