Interface SessionContext

All Superinterfaces:
AutoCloseable

public interface SessionContext extends AutoCloseable
A session context holds resources and is the entrance for obtaining DataFrame
  • Method Details

    • sql

      Obtain the DataFrame by running the sql against the datafusion library
      Parameters:
      sql - The query to execute
      Returns:
      DataFrame representing the query result
    • registerCsv

      CompletableFuture<Void> registerCsv(String name, Path path)
      Registering a csv file with the context
      Parameters:
      name - The table name to use to refer to the data
      path - Path to the CSV file
      Returns:
      Future that is completed when the CSV is registered
    • registerParquet

      CompletableFuture<Void> registerParquet(String name, Path path)
      Registering a parquet file with the context
      Parameters:
      name - The table name to use to refer to the data
      path - Path to the Parquet file
      Returns:
      Future that is completed when the Parquet file is registered
    • registerTable

      Optional<TableProvider> registerTable(String name, TableProvider tableProvider) throws Exception
      Registers a TableProvider as a table that can be referenced from SQL statements executed against this context.
      Parameters:
      name - table reference
      tableProvider - table provider
      Returns:
      as of Arrow 22 this is only Optional.empty()
      Throws:
      Exception - when the table is already registered
    • getRuntime

      Runtime getRuntime()
      Get the runtime associated with this context
      Returns:
      The context's runtime
    • getPointer

      long getPointer()
      Get a pointer to the native object
      Returns:
      Pointer value as a long