How to use Python to connect to an Oracle database by ApacheBeam?
Ask Question
import apache_beam as beam
from apache_beam.io.jdbc import ReadFromJdbc
with beam.Pipeline() as p:
result = (p
| 'Read from jdbc' >> ReadFromJdbc(
fetch_size=None,
table_name='table_name',
driver_class_name='oracle.jdbc.driver.OracleDriver',
jdbc_url='jdbc:oracle:thin:@localhost:1521:orcl',
username='xxx',
password='xxx',
query='selec * from table_name'
)
|beam.Map(print)
)
When I run the above code, the following error occurs:
ERROR:apache_beam.utils.subprocess_server:Starting job service with ['java',
'-jar',
'C:\Users\YFater/.apache_beam/cache/jars\beam-sdks-java-extensions-schemaio-expansion-service-2.29.0.jar',
'51933']
ERROR:apache_beam.utils.subprocess_server:Error bringing up service
I would appreciate any help you can give me!!!
| |
yfater
|
|
[email protected]
|
签名由网易邮箱大师定制