[
https://issues.apache.org/jira/browse/BEAM-12790?focusedWorklogId=646484&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-646484
]
ASF GitHub Bot logged work on BEAM-12790:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 03/Sep/21 21:28
Start Date: 03/Sep/21 21:28
Worklog Time Spent: 10m
Work Description: ibzib commented on pull request #15373:
URL: https://github.com/apache/beam/pull/15373#issuecomment-912820487
@apilloud Escaping strings is difficult, since JDBC has to work with various
[incompatible SQL
implementations](https://stackoverflow.com/a/10574031/4400443). The answers to
[this Stack Overflow
question](https://stackoverflow.com/questions/2038169/how-to-quote-escape-identifiers-such-as-column-names-with-jdbc/64863308)
suggest that we can learn the database's quoting syntax via the JDBC
Connection. The good news is that we can access the Connection through the
PreparedStatement in JdbcIO's
[StatementPreparator](https://github.com/apache/beam/blob/c4e0b4ac0777f37f5eb775a8a83c56f66b3baac3/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java#L545-L552).
The bad news is there's no way to change the query, aside from setting
parameters, which cannot be used for column and table names.
https://github.com/apache/beam/blob/c4e0b4ac0777f37f5eb775a8a83c56f66b3baac3/sdks/java/io/jdbc/src/main/java/org/apache/beam/sdk/io/jdbc/JdbcIO.java#L1168-L1173
So to get this to work I think we would have to add a method to JdbcIO that
takes a functional interface that takes a Connection and returns a fresh
PreparedStatement.
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 646484)
Time Spent: 40m (was: 0.5h)
> Projection pushdown in JDBC SchemaIO
> ------------------------------------
>
> Key: BEAM-12790
> URL: https://issues.apache.org/jira/browse/BEAM-12790
> Project: Beam
> Issue Type: New Feature
> Components: io-java-jdbc
> Reporter: Kyle Weaver
> Assignee: Kyle Weaver
> Priority: P2
> Time Spent: 40m
> Remaining Estimate: 0h
>
> It's now possible to enable projection pushdown in JDBC SchemaIO (which will
> then automatically be applied in Beam SQL). SeeĀ BEAM-12609
--
This message was sent by Atlassian Jira
(v8.3.4#803005)