Package app.babylon.table.plans
Interface TablePlan
- All Known Implementing Classes:
TablePlanAggregate,TablePlanCommon,TablePlanRead,TablePlanReadJdbc
public interface TablePlan
-
Method Summary
Modifier and TypeMethodDescriptionExecutes this plan against an already-open row supplier.Executes this plan against a configured row source.withTableDescription(TableDescription tableDescription) withTableName(TableName tableName)
-
Method Details
-
withTableName
-
getTableName
TableName getTableName() -
withTableDescription
-
getTableDescription
TableDescription getTableDescription() -
execute
Executes this plan against an already-open row supplier.Use this lower-level entry point when the caller already owns the live source resource and wants to control its lifetime explicitly.
CSV example:
JDBC example:DataResource streamSource = ...; TablePlanRead plan = new TablePlanRead(); ReadOptionsCsv options = ReadOptionsCsv.builder().withSeparator(';').build(); try (InputStream inputStream = streamSource.openStream(); RowCursor rowCursor = RowCursors.create(options, inputStream)) { TableColumnar table = plan.execute(rowCursor); }PreparedStatement preparedStatement = ...; TablePlanRead plan = new TablePlanRead(); try (ResultSet resultSet = preparedStatement.executeQuery(); RowCursor rowCursor = new RowCursorResultSet(resultSet)) { TableColumnar table = plan.execute(rowCursor); }- Parameters:
rowCursor- open row supplier to consume- Returns:
- the resulting table
-
execute
Executes this plan against a configured row source.This is the simplest high-level entry point when the source should handle opening and closing its own row supplier internally.
CSV example:
JDBC example:DataResource streamSource = ...; TablePlanRead plan = new TablePlanRead(); ReadOptionsCsv options = ReadOptionsCsv.builder().withSeparator(';').build(); TableColumnar table = plan.execute(RowSources.create(options, streamSource));PreparedStatement preparedStatement = ...; TablePlanRead plan = new TablePlanRead(); TableColumnar table = plan.execute(RowSourceResultSet.builder() .withPreparedStatement(preparedStatement) .build());- Parameters:
rowSource- configured source that opens rows for this execution- Returns:
- the resulting table
-