Say I have an Application Insights query like the following:
dependencies
| join kind=leftouter (traces | summarize take_any(customDimensions) by operation_ParentId) on $left.id == $right.operation_ParentId
| join kind=leftouter (traces | where condition | summarize take_any(customDimensions) by operation_ParentId) on $left.id == $right.operation_ParentId
| where customDimensions2['foo'] == 'bar'
My resultset will have columns customDimensions, customDimensions1 and customDimensions2.
However when I make a change to the first join so that it doesn't return a column named customDimensions, my resultset will no longer have a column customDimensions2 and what was customDimensions2 will now be in customDimensions1. As a user this is very confusing. Making a change to the first join affects other parts of the query that didn't operate on the data from this join, like customDimensions2.
This makes writing and refactoring queries very hard and error-prone. I'd like to see a way to refer to a column by some stable identifier. For example give the columns from a join a user-defined prefix: join ... as join_2 -> join2_customDimensions.
Have you considered using the project-rename operator – within the joins – to prevent duplicate column names so that the issue you experience won't happen.
Say I have an Application Insights query like the following:
My resultset will have columns
customDimensions
,customDimensions1
andcustomDimensions2
.However when I make a change to the first join so that it doesn't return a column named
customDimensions
, my resultset will no longer have a columncustomDimensions2
and what wascustomDimensions2
will now be incustomDimensions1
. As a user this is very confusing. Making a change to the first join affects other parts of the query that didn't operate on the data from this join, likecustomDimensions2
.This makes writing and refactoring queries very hard and error-prone. I'd like to see a way to refer to a column by some stable identifier. For example give the columns from a join a user-defined prefix:
join ... as join_2
->join2_customDimensions
.