[
https://issues.apache.org/jira/browse/BEAM-8897?focusedWorklogId=611538&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-611538
]
ASF GitHub Bot logged work on BEAM-8897:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Jun/21 19:08
Start Date: 15/Jun/21 19:08
Worklog Time Spent: 10m
Work Description: pabloem merged pull request #14918:
URL: https://github.com/apache/beam/pull/14918
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 611538)
Time Spent: 0.5h (was: 20m)
> JdbcIO.readRows issue when type is Numeric
> ------------------------------------------
>
> Key: BEAM-8897
> URL: https://issues.apache.org/jira/browse/BEAM-8897
> Project: Beam
> Issue Type: Bug
> Components: io-java-jdbc
> Affects Versions: 2.16.0
> Environment: Java 8
> Reporter: Mark Gates
> Assignee: Vitaly Terentyev
> Priority: P3
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> The actual use case is such that I am connecting to Oracle via JDBC making
> the query: "select 1 from dual". If I try this on real data with a Number
> type column the same issue occurs.
> The number type results in an exception. Example:
> {code:java}
> PCollection<Row> row = p.apply(
> JdbcIO.readRows()
>
> .withDataSourceProviderFn(JdbcIO.PoolableDataSourceProvider.of(configuration))
> .withQuery("select 1 as t1 from dual")
> .withFetchSize(10000)
> .withOutputParallelization(true));
> row.apply(ParDo.of(new DoFn<Row, Row>() {
> @ProcessElement
> public void processElement(@Element Row row, OutputReceiver<Row> out,
> ProcessContext pc) {
> System.out.println(row.getSchema().toString() + " : " +
> row.toString());
> out.output(row);
> }
> }));
> p.run().waitUntilFinish();
> {code}
> Exception:
> Exception in thread "main"
> org.apache.beam.sdk.Pipeline$PipelineExecutionException:
> java.lang.IllegalArgumentException
> at
> org.apache.beam.runners.direct.DirectRunner$DirectPipelineResult.waitUntilFinish(DirectRunner.java:348)
> at
> org.apache.beam.runners.direct.DirectRunner$DirectPipelineResult.waitUntilFinish(DirectRunner.java:318)
> at
> org.apache.beam.runners.direct.DirectRunner.run(DirectRunner.java:213)
> at org.apache.beam.runners.direct.DirectRunner.run(DirectRunner.java:67)
> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:315)
> at org.apache.beam.sdk.Pipeline.run(Pipeline.java:301)
> at SimpleJdbc.main(SimpleJdbc.java:45)
> Caused by: java.lang.IllegalArgumentException
> at
> org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions.checkArgument(Preconditions.java:127)
> at
> org.apache.beam.sdk.io.jdbc.LogicalTypes$FixedPrecisionNumeric.toInputType(LogicalTypes.java:237)
> at
> org.apache.beam.sdk.io.jdbc.LogicalTypes$FixedPrecisionNumeric.toInputType(LogicalTypes.java:221)
> at
> org.apache.beam.sdk.io.jdbc.SchemaUtil.lambda$createLogicalTypeExtractor$ca0ab2ec$1(SchemaUtil.java:272)
> at
> org.apache.beam.sdk.io.jdbc.SchemaUtil$BeamRowMapper.mapRow(SchemaUtil.java:337)
> at
> org.apache.beam.sdk.io.jdbc.SchemaUtil$BeamRowMapper.mapRow(SchemaUtil.java:315)
> at
> org.apache.beam.sdk.io.jdbc.JdbcIO$ReadFn.processElement(JdbcIO.java:854)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)