databricks.koalas.read_parquet

databricks.koalas.read_parquet(path, columns=None, index_col=None, **options) → databricks.koalas.frame.DataFrame[source]

Load a parquet object from the file path, returning a DataFrame.

Parameters
pathstring

File path

columnslist, default=None

If not None, only these columns will be read from the file.

index_colstr or list of str, optional, default: None

Index column of table in Spark.

optionsdict

All other options passed directly into Spark’s data source.

Returns
DataFrame

See also

DataFrame.to_parquet, DataFrame.read_table, DataFrame.read_delta, DataFrame.read_spark_io

Examples

>>> ks.range(1).to_parquet('%s/read_spark_io/data.parquet' % path)
>>> ks.read_parquet('%s/read_spark_io/data.parquet' % path, columns=['id'])
   id
0   0

You can preserve the index in the roundtrip as below.

>>> ks.range(1).to_parquet('%s/read_spark_io/data.parquet' % path, index_col="index")
>>> ks.read_parquet('%s/read_spark_io/data.parquet' % path, columns=['id'], index_col="index")
... 
       id
index
0       0