# Cannot read footer in a Spark file

You might receive a “Could not read footer for file” error message from Spark when trying to access your data file while running on the Spark engine. This error occurs when Spark does not have an option for reading footer information from an input file. See <https://spark.apache.org/docs/latest/api/java/org/apache/spark/sql/DataFrameWriter.html#csv-java.lang.String-> for more information.

Perform the following steps to work around this issue:

1. Create a new PDI transformation containing either the Hadoop File Input and Hadoop File Output steps or the Text File Input and Text File Output steps.
2. Use the footer option in the **Content** tab of the Hadoop File Input or Text File Input step to specify your footer data. See the **Pentaho Data Integration** document for details on the **Content** tab.
3. Verify the **Footer** option in the **Content** tab of the Hadoop File Output or Text File Output step has been cleared so the data is not written out as a footer. See the **Pentaho Data Integration** document for details on the **Content** tab.
4. Save the transformation and run it on the Pentaho engine. See the **Pentaho Data Integration** document for instructions

You can now read the file resulting from the output step in either Spark or AEL.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/install/9.3-install/pentaho-configuration/tasks-to-be-performed-by-an-it-administrator/set-up-the-adaptive-execution-layer-ael/troubleshooting-ael-cp/cannot-read-footer-in-a-spark-file-ael-troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
