I have a scenario wherein, I have a file(resides in ADLS) which contains 30 columns , but when i am creating external table.. i wanted to pick only 5 columns.
My question is : is it possible to selectively choose the columns while creating external table.
Right now creating external table works.. but when i do select query on top of that ext table.. it throws an exception
HadoopExecutionException: Too many columns in the line
Thanks in advance.
Unfortunately, according to CREATE EXTERNAL TABLE (Transact-SQL), column selection when creating external tables is not supported:
The column definitions, including the data types and number of columns, must match the data in the external files. If there is a mismatch, the file rows will be rejected when querying the actual data.
Hope it helps!