I want to select all columns in a table except StudentAddress and hence I wrote following query:
select `(StudentAddress)?+.+` from student;
It gives following error in Squirrel Sql client.
org.apache.spark.sql.AnalysisException: cannot resolve '(StudentAddress)?+.+' given input columns
Using spark sql try with
select * except(<columns to be excluded>) from tablename
Example:
select * from tmp
#+----+----+----+----+
#|col1|col2|col3|col4|
#+----+----+----+----+
#|a |b |c |d |
#+----+----+----+----+
#exclude col1,col2
select * except(col1,col2) from table_name
#+----+----+
#|col3|col4|
#+----+----+
#|c |d |
#+----+----+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With