You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Kurt Young (JIRA)" <ji...@apache.org> on 2019/08/12 09:22:00 UTC

[jira] [Comment Edited] (FLINK-13690) Connectors/JDBC LookupFunction getFieldFromResultSet BUG

    [ https://issues.apache.org/jira/browse/FLINK-13690?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16905009#comment-16905009 ] 

Kurt Young edited comment on FLINK-13690 at 8/12/19 9:21 AM:
-------------------------------------------------------------

cc [~lzljs3620320] , since JDBCUtils is newly added in 1.9.0, I will change the affected version to 1.9.0


was (Author: ykt836):
cc [~lzljs3620320] , since JDBCUtils is newly added in 1.9.0, I change the affected version to 1.9.0

> Connectors/JDBC LookupFunction getFieldFromResultSet BUG
> --------------------------------------------------------
>
>                 Key: FLINK-13690
>                 URL: https://issues.apache.org/jira/browse/FLINK-13690
>             Project: Flink
>          Issue Type: Bug
>          Components: Connectors / JDBC
>    Affects Versions: 1.9.0
>            Reporter: molsion
>            Priority: Major
>
> JDBCUtils.getFieldFromResultSet(int index, int type, ResultSet set) 
> this method have a bug,  ResultSet.wasNull() reports whether the last column read had a value of SQL NULL, {color:#FF0000}NOT the current column {color}
>  
> *{color:#333333}bug scene:{color}*
> {color:#333333}1. I want to join a dimension table,  column is {color}
>  
> {code:java}
> Id (INT), ProjectType(INT), Desp(VARCHAR),Name(VARCHAR)
> {code}
>  
> 2. select from database table is
> {code:java}
> {"Id": 10, "ProjectType":100,"Desp":NULL,"Name":"ProjectName"}
> {code}
> 3. org.apache.flink.api.java.io.jdbc.JDBCLookupFunction#convertToRowFromResultSet return the row is 
> {code:java}
> {"Id": 10, "ProjectType":100,"Desp":NULL,"Name":NULL}{code}
> beause  JDBCUtils.getFieldFromResultSet(int index, int type, ResultSet set)  when index = 3, ResultSet.wasNull is true, then value of column  Name  is null
>  
> this operator will influence next opertator , then i can not get the column  Name.
>  
> *Bug Fix:*
> org.apache.flink.api.java.io.jdbc.JDBCUtils#getFieldFromResultSet can fix NULL judge to fix this bug
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)