# @timestamp field problem while reading data from elasticsearch using spark-sql

**URL:** <https://discuss.elastic.co/t/timestamp-field-problem-while-reading-data-from-elasticsearch-using-spark-sql/273382>\
**Category:** Elasticsearch\
**Created:** [May 19, 2021, 10:12am UTC](https://discuss.elastic.co/t/timestamp-field-problem-while-reading-data-from-elasticsearch-using-spark-sql/273382 "2021-05-19T10:12:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)\
**Post date:** [May 19, 2021, 10:12am UTC](https://discuss.elastic.co/t/timestamp-field-problem-while-reading-data-from-elasticsearch-using-spark-sql/273382/1 "2021-05-19T10:12:25Z")

</div>

i am trying to read data from elasticsearch using spark-sql, my index contains @timestamp field. below is my query

 ![df](https://us1.discourse-cdn.com/elastic/original/3X/5/d/5d15dd503cc43346aa5276b3f284047abfa7fef6.png)  
the field name contains a special character so i am escaping it. the problem here is i am not getting any data in my output for the field **@timestamp** , below is my output.  
 ![data](https://us1.discourse-cdn.com/elastic/original/3X/d/4/d468722e2dcded1be4ea8be89f0a18cdcea8ec89.png)  
please help 🙂  
i referred this topic [Problem with SQL Query with special character in field and table name](https://discuss.elastic.co/t/problem-with-sql-query-with-special-character-in-field-and-table-name/146359)

---

<div class="post-metadata">

**Author:** ![Gokul6](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gokul6/32/84049_2.png) [@Gokul6](https://discuss.elastic.co/u/Gokul6)\
**Post date:** [May 19, 2021, 1:49pm UTC](https://discuss.elastic.co/t/timestamp-field-problem-while-reading-data-from-elasticsearch-using-spark-sql/273382/2 "2021-05-19T13:49:16Z")

</div>

found the solution from official spark documentation [Identifiers - Spark 3.1.1 Documentation](https://spark.apache.org/docs/latest/sql-ref-identifier.html)

use ` to escape special characters. below is my query  
 ![df](https://us1.discourse-cdn.com/elastic/original/3X/6/8/68b6f8723801db8138b5c48a15e1f7ce84cc5523.png)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 16, 2021, 1:49pm UTC](https://discuss.elastic.co/t/timestamp-field-problem-while-reading-data-from-elasticsearch-using-spark-sql/273382/3 "2021-06-16T13:49:32Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
