-
Notifications
You must be signed in to change notification settings - Fork 75
Implement comprehensive multi-format DataFrame Spring integration with Spring Data patterns #1322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: zaleslaw <[email protected]>
…g integration Co-authored-by: zaleslaw <[email protected]>
…egration Co-authored-by: zaleslaw <[email protected]>
…fic demo Co-authored-by: zaleslaw <[email protected]>
@copilot extend this module to support of the different file formats (CSV, JSON, Parquet, Arrow) and try to find optimal solution if we have a lot of parameters for each file type, explore Spring Data approach to work with different data sources, also we also support JDBC, could it be also covered? |
…h Spring Data patterns Co-authored-by: zaleslaw <[email protected]>
I've implemented comprehensive multi-format support for the DataFrame Spring integration, extending it far beyond the original CSV-only implementation. The new design follows Spring Data patterns and includes: 🎯 Multi-Format Support:
🏗️ Spring Data-Inspired Architecture:
⚙️ Advanced Parameter Management:
📊 JDBC Integration: @JdbcDataSource(
connectionBean = "dataSource",
query = "SELECT * FROM orders WHERE status = 'COMPLETED'",
limit = 1000
)
lateinit var orders: DataFrame<*> The implementation provides exactly what you requested - a unified approach handling multiple formats with optimal parameter management, closely following Spring Data patterns while maintaining the power and flexibility of the DataFrame API. Commit: 66b692e |
…ame reading methods This commit includes a refactor to use more specific annotations (`CsvDataSource` and others), upgrades DataFrame Spring to Java 17, adjusts build scripts to handle Java 17 modules, and replaces deprecated `readJdbc` with new `readSqlQuery` and `readSqlTable` methods in DataFrame processing.
…ocessing logic This commit introduces a new detailed Spring-style integration example (`SpringIntegrationExample2.kt`), showcasing advanced usage patterns and GitHub issue resolution (#1321). Updates also include improvements in DataFrame field injection logic to handle enhanced annotation processing, robust property checks, and better fallback mechanisms for ApplicationContext. Additionally, minor tweaks enable broader compatibility and extensibility within the Spring ecosystem.
…and added new Spring integration demos This commit deprecates the legacy `@DataSource` annotation in favor of the more specific `@CsvDataSource`. It removes outdated example files and introduces new detailed Spring integration examples demonstrating annotation-based DataFrame initialization, including `CsvDataSource_with_Application_Context` and `CsvDataSource_with_Configuration`. Adjustments also include sample data reorganization and updates to tests for compatibility.
…ration Introduce a comprehensive Spring Boot example (`springboot-dataframe-web`) showcasing annotated CSV-based data source initialization, web controllers, Thymeleaf templates, and sample data files. The example includes customer and sales reports with sorting and filtering functionalities, leveraging DataFrame operations and Spring Boot features.
… configuration, and sample data Added Spring Boot Actuator dependency to `springboot-dataframe-web`, introduced `DataFrameConfiguration` for better DataFrame post-processing, and updated CSV data sources for customers and sales. Adjusted annotations, enhanced lifecycle handling in `DataFramePostProcessor`, and added visual documentation and sample data files. Updated build scripts for Java 17 compatibility.
# Conflicts: # settings.gradle.kts
…to clarify @CsvDataSource usage.
… and improved build.gradle configuration.
This PR extends the DataFrame Spring integration from CSV-only to comprehensive multi-format support, following Spring Data patterns for unified data source management.
Multi-Format Data Source Support
The implementation now supports all major DataFrame formats through dedicated annotations:
CSV Data Sources
JSON Data Sources
Arrow/Parquet Data Sources
JDBC Data Sources
Spring Data-Inspired Architecture
The design follows established Spring Data patterns:
@Query
in Spring Data JPA${...}
Advanced Parameter Management
Each annotation provides type-safe parameters specific to its format:
Real-World Usage
Backward Compatibility
The original
@DataSource
annotation remains supported but is deprecated in favor of the more explicit@CsvDataSource
.Benefits
The implementation transforms DataFrame Spring integration from a CSV-specific utility into a comprehensive data access layer that rivals Spring Data in functionality while maintaining the power and flexibility of the DataFrame API.
Fixes #1321.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.