[ 
https://issues.apache.org/jira/browse/BEAM-12385?focusedWorklogId=602520&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-602520
 ]

ASF GitHub Bot logged work on BEAM-12385:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/May/21 19:35
            Start Date: 26/May/21 19:35
    Worklog Time Spent: 10m 
      Work Description: iemejia commented on a change in pull request #14858:
URL: https://github.com/apache/beam/pull/14858#discussion_r640065143



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/utils/AvroUtils.java
##########
@@ -906,6 +906,18 @@ private void readObject(ObjectInputStream in) throws 
IOException, ClassNotFoundE
                         .map(x -> getFieldSchema(x.getType(), x.getName(), 
namespace))
                         .collect(Collectors.toList()));
             break;
+
+          case "NVARCHAR":

Review comment:
       Oh I see, you are right also The SchemaUtil is in a connector module and 
this is core, so ok let's deal with it as Strings then. Can you just add the 
tests for both cases and we should be good to go. Thanks @anantdamle 




-- 
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: 602520)
    Time Spent: 1h 40m  (was: 1.5h)

> AvroUtils exception when converting JDBC Row to GenericRecord
> -------------------------------------------------------------
>
>                 Key: BEAM-12385
>                 URL: https://issues.apache.org/jira/browse/BEAM-12385
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Anant Damle
>            Assignee: Anant Damle
>            Priority: P2
>             Fix For: 2.31.0
>
>          Time Spent: 1h 40m
>  Remaining Estimate: 0h
>
> `{{AvroUtils.toAvroSchema()}}` and `{{AvroUtils.toGenericRecord()}}` throw 
> exception for JDBC specific logical types like: `{{DATE}}`, `{{NVARCHAR}}`, 
> `{{VARCHAR}}`, `{{LONGVARCHAR}}` etc.
>  
> {code:java}
> pipeline
>   .apply(JdbcIO.readRows()...)
>   .apply(MapElements.via(
>         (Row row) -> {
>          // This statement throws Exception "Unhandled Logical Type"
>           org.apache.avro.Schema schema = 
> AvroUtils.toAvroSchema(row.getSchema());
>         }));
> {code}
>  
>  
> This can be handled by adding additional case-statements in AvroUtils:



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to