Package org.apache.arrow.datafusion
Interface SessionContext
- All Superinterfaces:
AutoCloseable
A session context holds resources and is the entrance for obtaining
DataFrame-
Method Summary
Modifier and TypeMethodDescriptionlongGet a pointer to the native objectGet the runtime associated with this contextregisterCsv(String name, Path path) Registering a csv file with the contextregisterParquet(String name, Path path) Registering a parquet file with the contextregisterTable(String name, TableProvider tableProvider) Registers a TableProvider as a table that can be referenced from SQL statements executed against this context.Obtain theDataFrameby running thesqlagainst the datafusion libraryMethods inherited from interface java.lang.AutoCloseable
close
-
Method Details
-
sql
Obtain theDataFrameby running thesqlagainst the datafusion library- Parameters:
sql- The query to execute- Returns:
- DataFrame representing the query result
-
registerCsv
Registering a csv file with the context- Parameters:
name- The table name to use to refer to the datapath- Path to the CSV file- Returns:
- Future that is completed when the CSV is registered
-
registerParquet
Registering a parquet file with the context- Parameters:
name- The table name to use to refer to the datapath- Path to the Parquet file- Returns:
- Future that is completed when the Parquet file is registered
-
registerTable
Registers a TableProvider as a table that can be referenced from SQL statements executed against this context.- Parameters:
name- table referencetableProvider- 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
-