parameters: (
      filepath_or_buffer,
      engine="cudf",
      columns=None,
      filters=None,
      stripes=None,
      skiprows=None,
      num_rows=None,
      use_index=True,
      decimal_cols_as_float=None,
      timestamp_type=None,
      use_python_file_object=True,
      **kwargs,
  )
return_statement: return df
docstring: {docstring}
docstring_summary: {docstring}
docstring_tokens: { docstring }
function: def read_orc(
      filepath_or_buffer,
      engine="cudf",
      columns=None,
      filters=None,
      stripes=None,
      skiprows=None,
      num_rows=None,
      use_index=True,
      decimal_cols_as_float=None,
      timestamp_type=None,
      use_python_file_object=True,
      **kwargs,
  ):
      """{docstring}"""
      if decimal_cols_as_float is not None:
          warnings.warn(
              "`decimal_cols_as_float` is deprecated and will be removed in "
              "the future",
              FutureWarning,
          )
      from cudf import DataFrame
  
      # Multiple sources are passed as a list. If a single source is passed,
      # wrap it in a list for unified processing downstream.
      if not is_list_like(filepath_or_buffer):
          filepath_or_buffer = [filepath_or_buffer]
  
      # Each source must have a correlating stripe list. If a single stripe list
      # is provided rather than a list of list of stripes then extrapolate that
      # stripe list across all input sources
      if stripes is not None:
          if any(not isinstance(stripe, list) for stripe in stripes):
              stripes = [stripes]
  
          # Must ensure a stripe for each source is specified, unless None
          if not len(stripes) == len(filepath_or_buffer):
              raise ValueError(
                  "A list of stripes must be provided for each input source"
              )
  
      filepaths_or_buffers = []
      for source in filepath_or_buffer:
          if ioutils.is_directory(source, **kwargs):
              fs = ioutils._ensure_filesystem(
                  passed_filesystem=None, path=source, **kwargs,
              )
              source = stringify_path(source)
              source = fs.sep.join([source, "*.orc"])
  
          tmp_source, compression = ioutils.get_filepath_or_buffer(
              path_or_data=source,
              compression=None,
              use_python_file_object=use_python_file_object,
              **kwargs,
          )
          if compression is not None:
              raise ValueError(
                  "URL content-encoding decompression is not supported"
              )
          if isinstance(tmp_source, list):
              filepaths_or_buffers.extend(tmp_source)
          else:
              filepaths_or_buffers.append(tmp_source)
  
      if filters is not None:
          selected_stripes = _filter_stripes(
              filters, filepaths_or_buffers, stripes, skiprows, num_rows
          )
  
          # Return empty if everything was filtered
          if len(selected_stripes) == 0:
              return _make_empty_df(filepaths_or_buffers[0], columns)
          else:
              stripes = selected_stripes
  
      if engine == "cudf":
          return DataFrame._from_data(
              *liborc.read_orc(
                  filepaths_or_buffers,
                  columns,
                  stripes,
                  skiprows,
                  num_rows,
                  use_index,
                  decimal_cols_as_float,
                  timestamp_type,
              )
          )
      else:
  
          def read_orc_stripe(orc_file, stripe, columns):
              pa_table = orc_file.read_stripe(stripe, columns)
              if isinstance(pa_table, pa.RecordBatch):
                  pa_table = pa.Table.from_batches([pa_table])
              return pa_table
  
          warnings.warn("Using CPU via PyArrow to read ORC dataset.")
          if len(filepath_or_buffer) > 1:
              raise NotImplementedError(
                  "Using CPU via PyArrow only supports a single a "
                  "single input source"
              )
  
          orc_file = orc.ORCFile(filepath_or_buffer[0])
          if stripes is not None and len(stripes) > 0:
              for stripe_source_file in stripes:
                  pa_tables = [
                      read_orc_stripe(orc_file, i, columns)
                      for i in stripe_source_file
                  ]
                  pa_table = pa.concat_tables(pa_tables)
          else:
              pa_table = orc_file.read(columns=columns)
          df = cudf.DataFrame.from_arrow(pa_table)
  
      return df
function_tokens: def read_orc ( filepath_or_buffer , engine = "cudf" , columns = None , filters = None , stripes = None , skiprows = None , num_rows = None , use_index = True , decimal_cols_as_float = None , timestamp_type = None , use_python_file_object = True , * * kwargs , ) : if decimal_cols_as_float is not None : warnings . warn ( "`decimal_cols_as_float` is deprecated and will be removed in " "the future" , FutureWarning , ) from cudf import DataFrame # Multiple sources are passed as a list. If a single source is passed, # wrap it in a list for unified processing downstream. if not is_list_like ( filepath_or_buffer ) : filepath_or_buffer = [ filepath_or_buffer ] # Each source must have a correlating stripe list. If a single stripe list # is provided rather than a list of list of stripes then extrapolate that # stripe list across all input sources if stripes is not None : if any ( not isinstance ( stripe , list ) for stripe in stripes ) : stripes = [ stripes ] # Must ensure a stripe for each source is specified, unless None if not len ( stripes ) == len ( filepath_or_buffer ) : raise ValueError ( "A list of stripes must be provided for each input source" ) filepaths_or_buffers = [ ] for source in filepath_or_buffer : if ioutils . is_directory ( source , * * kwargs ) : fs = ioutils . _ensure_filesystem ( passed_filesystem = None , path = source , * * kwargs , ) source = stringify_path ( source ) source = fs . sep . join ( [ source , "*.orc" ] ) tmp_source , compression = ioutils . get_filepath_or_buffer ( path_or_data = source , compression = None , use_python_file_object = use_python_file_object , * * kwargs , ) if compression is not None : raise ValueError ( "URL content-encoding decompression is not supported" ) if isinstance ( tmp_source , list ) : filepaths_or_buffers . extend ( tmp_source ) else : filepaths_or_buffers . append ( tmp_source ) if filters is not None : selected_stripes = _filter_stripes ( filters , filepaths_or_buffers , stripes , skiprows , num_rows ) # Return empty if everything was filtered if len ( selected_stripes ) == 0 : return _make_empty_df ( filepaths_or_buffers [ 0 ] , columns ) else : stripes = selected_stripes if engine == "cudf" : return DataFrame . _from_data ( * liborc . read_orc ( filepaths_or_buffers , columns , stripes , skiprows , num_rows , use_index , decimal_cols_as_float , timestamp_type , ) ) else : def read_orc_stripe ( orc_file , stripe , columns ) : pa_table = orc_file . read_stripe ( stripe , columns ) if isinstance ( pa_table , pa . RecordBatch ) : pa_table = pa . Table . from_batches ( [ pa_table ] ) return pa_table warnings . warn ( "Using CPU via PyArrow to read ORC dataset." ) if len ( filepath_or_buffer ) > 1 : raise NotImplementedError ( "Using CPU via PyArrow only supports a single a " "single input source" ) orc_file = orc . ORCFile ( filepath_or_buffer [ 0 ] ) if stripes is not None and len ( stripes ) > 0 : for stripe_source_file in stripes : pa_tables = [ read_orc_stripe ( orc_file , i , columns ) for i in stripe_source_file ] pa_table = pa . concat_tables ( pa_tables ) else : pa_table = orc_file . read ( columns = columns ) df = cudf . DataFrame . from_arrow ( pa_table ) return df