@KrishK I think the error message is pretty descriptive: you don't have a column called col2 in your index named index.
Assuming that the column name was just a typo, SELECTing multiple columns and GROUPing BY only one of them is not standard SQL and, as expected, will not work with ES SQL either. You need to have group by col1, col2.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.