I am using Spark 2.1.0
I have a View which is owned by some other group AND we CANNOT change it as we don't own it.
create or replace view testUnderscore AS
SELECT
lookup_id,
source_table,
`_c3` AS lookup_type,
`_c5` AS transaction_type,
start_date,
end_date,
`_c8` AS transaction_grp,
`_c9` AS transaction_source
From table_1;
While creating, the view got created but when i am trying to use this view in Spark i am getting this Error :
Error in query: cannot resolve '`_c3`' given input columns:
My Query which gives above Error :
Select a,b,c
from some_table1,
testUnderscore --(This is the View created above & bcoz of which getting error)
where some_table1.key1 = testUnderscore.lookup_id
I know that this Error is due to the Column Names starting with an 'underscore' but as i mentioned earlier we cannot change it as it is owned by some other team and also as u can see that i am not even using that _c3 column in my SQL query. Its just that when the Query parser reads through the Query it encounters the _c3 & throws Error.
So I need a help here to bypass this _c3. Like i have many columns starting with an underscore and i have to use this View in my Query , How can i escape or bypass this .??