def read_parquet(cls, path, engine, columns, **kwargs):
        """Load a parquet object from the file path, returning a DataFrame.
           Ray DataFrame only supports pyarrow engine for now.

        Args:
            path: The filepath of the parquet file.
                  We only support local files for now.
            engine: Ray only support pyarrow reader.
                    This argument doesn't do anything for now.
            kwargs: Pass into parquet's read_pandas function.

        Notes:
            ParquetFile API is used. Please refer to the documentation here
            https://arrow.apache.org/docs/python/parquet.html
        """

        from pyarrow.parquet import ParquetFile

        if cls.read_parquet_remote_task is None:
            return super(RayIO, cls).read_parquet(path, engine, columns, **kwargs)

        if not columns:
            pf = ParquetFile(path)
            columns = [
                name
                for name in pf.metadata.schema.names
                if not PQ_INDEX_REGEX.match(name)
            ]
        num_partitions = cls.frame_mgr_cls._compute_num_partitions()
        num_splits = min(len(columns), num_partitions)
        # Each item in this list will be a list of column names of the original df
        column_splits = (
            len(columns) // num_partitions
            if len(columns) % num_partitions == 0
            else len(columns) // num_partitions + 1
        )
        col_partitions = [
            columns[i : i + column_splits]
            for i in range(0, len(columns), column_splits)
        ]
        # Each item in this list will be a list of columns of original df
        # partitioned to smaller pieces along rows.
        # We need to transpose the oids array to fit our schema.
        blk_partitions = np.array(
            [
                cls.read_parquet_remote_task._remote(
                    args=(path, cols, num_splits, kwargs),
                    num_return_vals=num_splits + 1,
                )
                for cols in col_partitions
            ]
        ).T
        remote_partitions = np.array(
            [
                [cls.frame_partition_cls(obj) for obj in row]
                for row in blk_partitions[:-1]
            ]
        )
        index_len = ray.get(blk_partitions[-1][0])
        index = pandas.RangeIndex(index_len)
        new_query_compiler = cls.query_compiler_cls(
            cls.frame_mgr_cls(remote_partitions), index, columns
        )

        return new_query_compiler
def read_parquet ( cls , path , engine , columns , ** kwargs ) : from pyarrow . parquet import ParquetFile if cls . read_parquet_remote_task is None : return super ( RayIO , cls ) . read_parquet ( path , engine , columns , ** kwargs ) if not columns : pf = ParquetFile ( path ) columns = [ name for name in pf . metadata . schema . names if not PQ_INDEX_REGEX . match ( name ) ] num_partitions = cls . frame_mgr_cls . _compute_num_partitions ( ) num_splits = min ( len ( columns ) , num_partitions ) column_splits = ( len ( columns ) // num_partitions if len ( columns ) % num_partitions == 0 else len ( columns ) // num_partitions + 1 ) col_partitions = [ columns [ i : i + column_splits ] for i in range ( 0 , len ( columns ) , column_splits ) ] blk_partitions = np . array ( [ cls . read_parquet_remote_task . _remote ( args = ( path , cols , num_splits , kwargs ) , num_return_vals = num_splits + 1 , ) for cols in col_partitions ] ) . T remote_partitions = np . array ( [ [ cls . frame_partition_cls ( obj ) for obj in row ] for row in blk_partitions [ : - 1 ] ] ) index_len = ray . get ( blk_partitions [ - 1 ] [ 0 ] ) index = pandas . RangeIndex ( index_len ) new_query_compiler = cls . query_compiler_cls ( cls . frame_mgr_cls ( remote_partitions ) , index , columns ) return new_query_compiler
Load a parquet object from the file path, returning a DataFrame.
           Ray DataFrame only supports pyarrow engine for now.

        Args:
            path: The filepath of the parquet file.
                  We only support local files for now.
            engine: Ray only support pyarrow reader.
                    This argument doesn't do anything for now.
            kwargs: Pass into parquet's read_pandas function.

        Notes:
            ParquetFile API is used. Please refer to the documentation here
            https://arrow.apache.org/docs/python/parquet.html