beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (BEAM-2151) Type mapping inconsistent in BeamSqlRow & BeamSqlRowCoder
Date Thu, 04 May 2017 03:52:04 GMT


ASF GitHub Bot commented on BEAM-2151:

GitHub user xumingming opened a pull request:

    [BEAM-2151]Fix inconsistent mapping for SQL FLOAT

    This pull request is mainly to fix the SQL FLOAT mapping, previously it is mapped to Float
in `BeamSQLRow`, but mapped to `Double` in `BeamSQLRowCoder`, now we consistently map SQL
FLOAT to java Float.
    When try to unit test this, found another bug in BeamSQLRow: the VARCHAR field is not
encode/decoded correctly(mainly because OUTTER Context vs NESTED Context), so fixed this bug
at the same time.

You can merge this pull request into a Git repository by running:

    $ git pull BEAM-2151

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2886
commit 02ffb848cf536cf631696f68051fecded2907931
Author: James Xu <>
Date:   2017-05-04T03:44:14Z

    Fix inconsistent mapping for SQL FLOAT


> Type mapping inconsistent in BeamSqlRow & BeamSqlRowCoder
> ---------------------------------------------------------
>                 Key: BEAM-2151
>                 URL:
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql
>            Reporter: James Xu
>            Assignee: James Xu
>            Priority: Blocker
> In BeamSqlRow, sql FLOAT is mapping to java Float:
> {code:java}
>     case FLOAT:
>       if (!(fieldValue instanceof Float)) {
>         throw new InvalidFieldException(
>             String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
>       }
>       break;
> {code}
> but in BeamSqlRowCoder, sql FLOAT is treated as java Double:
> {code:java}
>       case DOUBLE:
>       case FLOAT:
>         doubleCoder.encode(value.getDouble(idx), outStream, nested);
>         break;
> {code}
> Let's mapping sql FLOAT consistently to java Float?

This message was sent by Atlassian JIRA

View raw message