AliRana30 opened a new pull request, #839: URL: https://github.com/apache/wayang/pull/839
### Key Changes - **SqlIdentifierUtils**: Added a utility in `wayang-basic` to strictly validate single-part and multipart table/column identifiers using regex patterns (`^[a-zA-Z_][a-zA-Z0-9_$]*(?:\.[a-zA-Z_][a-zA-Z0-9_$]*)*$`) and escape/quote identifiers according to database dialect. - **TableSink**: Integrated validation in the constructor and setter so any invalid or malicious table/column identifier is rejected early with an `IllegalArgumentException`. - **JdbcTableSinkOperator & JdbcExecutor**: Quoted table names in generated `DROP TABLE IF EXISTS`, `CREATE TABLE ... AS`, and `INSERT INTO` clauses. Multipart identifiers (such as Trino `catalog.schema.table`) are quoted segment-by-segment (`"catalog"."schema"."table"`). - **JavaTableSink & SparkTableSink**: Updated to use `SqlIdentifierUtils` for safe identifier quoting. - **Unit Tests**: Added `SqlIdentifierUtilsTest` and updated `JdbcTableSinkExecutorTest` to assert proper quoting and rejection of SQL injection payloads. ## Fixes : #836. ### Verification - `SqlIdentifierUtilsTest` (10 tests passed) - `JdbcTableSinkExecutorTest` (8 tests passed) - `JavaTableSinkTest` (7 tests passed) - `SparkTableSinkTest` (10 tests passed) - `apache-rat:check` (0 unapproved licenses) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
