WriteToJdbc does not respect 'statement' parameter in python
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 4.7k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 196
Description
I need to insert geometry into my postgresql database. My pipeline stage is a follows;
```
// code placeholder
| 'Write jdbc' >> WriteToJdbc( jdbc_url='jdbc:postgresql://localhost:5432/postgre',
driver_class_name='org.postgresql.Driver', table_name='test', username='postgres',
password='postgres',
statement="""INSERT INTO test
VALUES(?, ?, ?, ST_GeomFromText(?), ?, ?, ?, ?,
?, ?)"""
```
I expect this code to write data to database and cast my text into geometry type while inserting. But it does not work.
Imported from Jira [BEAM-12693](https://issues.apache.org/jira/browse/BEAM-12693). Original Jira may contain additional context.
Reported by: egeucak.
Contributor guide
Research direction
Start by tracing the Python WriteToJdbc path and how it handles the supplied statement parameter, using the PostgreSQL JDBC example in the issue as the reproduction. Verify the behavior with the shown ST_GeomFromText insert and confirm that the statement is honored when writing to PostgreSQL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, postgresql, python
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100