Databricks community edition- Error in SQL statement: IOException: Path: /FileStore/tables/clinicaltrial_2021/mesh.csv is a directory, which is not supported by the record reader when `mapreduce.input.fileinputformat.input.dir.recursive` is false.

prathyush paruchuri 1 Reputation point
2022-05-11T21:23:22.367+00:00

I am writing code in hiveQL using databricks community edition.
I have loaded the csv dataset files into dbfs, and created hive external table and tried loading table with data from uploaded dbfs file.

CREATE EXTERNAL TABLE IF NOT EXISTS data_table(
Id STRING,
Sponsor STRING,
Status STRING,
Start_Date STRING,
Completion_Date STRING,
Type STRING,
Submission STRING,
Conditions ARRAY<STRING>,
Interventions STRING
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY '|'
LOCATION '/FileStore/tables/CT21/clinicaltrial_2021-1.csv'
TBLPROPERTIES("skip.header.line.count"="2");

result was OK.
But when I queried
select * from data_table

It throws an exception:
Error in SQL statement: IOException: Path: /FileStore/tables/clinicaltrial_2021/mesh.csv is a directory, which is not supported by the record reader when mapreduce.input.fileinputformat.input.dir.recursive is false.

When I checked dbfs directory:
There exists a new directory mesh.csv created by dbfs with many subdirectories with same mesh.csv201197-capture.png

Any help is highly appreciated.

Azure AI Immersive Reader
Azure AI Immersive Reader
An Azure Applied AI Service that embeds text reading and comprehension capabilities into your applications.
30 questions
Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,284 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prathyush Paruchuri 6 Reputation points
    2022-06-02T00:43:13.22+00:00

    Hello @PRADEEPCHEEKATLA
    I didn't able to check my email in a while. I have resolved the aforementioned error using the command
    SET mapreduce.input.fileinputformat.input.dir.recursive=True.

    Thank you very much for your response.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.