Quantcast
Channel: Spark-csv data source: infer data types - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Olga for Spark-csv data source: infer data types

Starting from Spark 2 we can use option 'inferSchema' like this:getSparkSession().read().option("inferSchema", "true").csv("YOUR_CSV_PATH")

View Article


Answer by dpeacock for Spark-csv data source: infer data types

Unfortunately this is not currently supported but it would be a very useful feature. Currently they must be declared in DLL. From the documentation we have:header: when set to true the first line of...

View Article

Spark-csv data source: infer data types

I'm experimenting with Spark-CSV package (https://github.com/databricks/spark-csv) for reading csv files into Spark DataFrames.Everything works but all columns are assumed to be of StringType.As shown...

View Article
Browsing latest articles
Browse All 3 View Live