Question: here I am trying to validate structure of hive table and CSV file which is stored in s3.

This is schema of CSV file in dataframe.

```
+----+----------------+----+---+-----------+-----------+
|S_No|        Variable|Type|Len|     Format|   Informat|
+----+----------------+----+---+-----------+-----------+
|   1|        DATETIME| Num|  8|DATETIME20.|DATETIME20.|
|   2|   LOAD_DATETIME| Num|  8|DATETIME20.|DATETIME20.|
|   3|     SOURCE_BANK|Char| 1 |       null|       null|
|   4|        EMP_NAME|Char| 50|       null|       null|
|   5|HEADER_ROW_COUNT| Num|  8|       null|       null|
|   6|      EMP _HOURS| Num|  8|       15.2|       15.1|
+----+----------------+----+---+-----------+-----------+

```

I need to compare it with O/p of 

```
import org.apache.spark.sql.hive.HiveContext
val targetTableName = "TableA"
val hc = new HiveContext(sc)
val sqlContext = new org.apache.spark.sql.SQLContext(sc)
val targetRawData = hc.sql("Select datetime,load_datetime,trim(source_bank) as source_bank,trim(emp_name) as emp_name,header_row_count, emp_hours from " + targetTableName)

val schema= targetRawData.schema

```

which is :schema: `org.apache.spark.sql.types.StructType = StructType(StructField(datetime,TimestampType,true), StructField(load_datetime,TimestampType,true), StructField(source_bank,StringType,true), StructField(emp_name,StringType,true), StructField(header_row_count,IntegerType,true), StructField(emp_hours,DoubleType,true))`

Answer: 
It is been blocked by the PHP Session.

You can't serve to pages that requires access to the same session id.

Although once you close/serve/release the session on the slow page, another page can be served on the same session. On the slow page just call [`Session::save()`](http://api.symfony.com/3.4/Symfony/Component/HttpFoundation/Session/Session.html#method_save) as soon as possible on your controller. This will release the session. Take into consideration that everything you do after saving the session will not be stored in the session.
We had a similar problem. When sending a couple of consecutive requests to the server in a short period, the server became very slow. I enabled the profiler bar, and a lot of time was spent by the ContextListener
[![screenshot of the profiler information](https://i.stack.imgur.com/lTCsP.png)](https://i.stack.imgur.com/lTCsP.png)

The problem was that file server access on our server is very slow, and session information was stored on the file system, as is the default for symfony.

I configured my app to use the [PdoSessionHandler](https://symfony.com/doc/current/doctrine/pdo_session_storage.html), and the problem was gone.