beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Xu (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BEAM-2151) Type mapping inconsistent in BeamSqlRow & BeamSqlRowCoder
Date Wed, 03 May 2017 15:28:04 GMT

     [ https://issues.apache.org/jira/browse/BEAM-2151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Xu updated BEAM-2151:
---------------------------
    Description: 
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?

  was:
In BeamSqlRow, sql FLOAT is mapping to java Float:

```java
    case FLOAT:
      if (!(fieldValue instanceof Float)) {
        throw new InvalidFieldException(
            String.format("[%s] doesn't match type [%s]", fieldValue, fieldType));
      }
      break;
```

but in BeamSqlRowCoder, sql FLOAT is treated as java Double:

```java
      case DOUBLE:
      case FLOAT:
        doubleCoder.encode(value.getDouble(idx), outStream, nested);
        break;
```

Let's mapping sql FLOAT consistently to java Float?


> Type mapping inconsistent in BeamSqlRow & BeamSqlRowCoder
> ---------------------------------------------------------
>
>                 Key: BEAM-2151
>                 URL: https://issues.apache.org/jira/browse/BEAM-2151
>             Project: Beam
>          Issue Type: Bug
>          Components: dsl-sql
>            Reporter: James Xu
>
> 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
(v6.3.15#6346)

Mime
View raw message