When creating custom queries, you may want to add additional columns as the result of any other expression or function. If these queries result in an additional string column not part of the original data table, you may get the following error when trying to validate it:
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Spotfire.Dxp.Data.Adapters.Impala.ImpalaAdapterConnection.<ToMetadata>d__49.MoveNext()
at Spotfire.Dxp.Data.Adapters.Impala.ImpalaAdapterConnection.MapColumnsFromCustomQueryToDxp(OdbcConnection connection, MutableDataTableSchema table, DataTable schemaTable)
And an example of adding a string column X not already in the existing table:
SELECT
Existing1,
Existing2,
'x' as X
FROM ExistingTable