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-3238) [SQL] Add builder to BeamRecordSqlType
Date Thu, 23 Nov 2017 03:21:00 GMT


ASF GitHub Bot commented on BEAM-3238:

GitHub user akedin opened a pull request:

    [BEAM-3238][SQL] Add BeamRecordSqlTypeBuilder

    Follow this checklist to help us incorporate your contribution quickly and easily:
     - [ ] Make sure there is a [JIRA issue](
filed for the change (usually before you start working on it).  Trivial changes like typos
do not require a JIRA issue.  Your pull request should address just this issue, without pulling
in other changes.
     - [ ] Each commit in the pull request should have a meaningful subject line and body.
     - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`,
where you replace `BEAM-XXX` with the appropriate JIRA issue.
     - [ ] Write a pull request description that is detailed enough to understand what the
pull request does, how, and why.
     - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
     - [ ] If this contribution is large, please file an Apache [Individual Contributor License

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

    $ git pull sql-record-type-builder

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 #4168
commit 77769aa46dd9a972526f805f6c476c4039121b29
Author: Anton Kedin <>
Date:   2017-11-23T00:04:05Z

    [BEAM-3238][SQL] Move Coders to map in BeamRecordSqlType
    Improve readability. All coders are supposed to be thread safe and
    currently are backed by the static instances.

commit 96c2a67f38c3da501f37797a8f75c23d5baf2ca8
Author: Anton Kedin <>
Date:   2017-11-23T03:17:21Z

    [BEAM-3238][SQL] Add BeamRecordSqlTypeBuilder
    To improve readability of creating BeamRecordSqlTypes.


> [SQL] Add builder to BeamRecordSqlType
> --------------------------------------
>                 Key: BEAM-3238
>                 URL:
>             Project: Beam
>          Issue Type: Improvement
>          Components: dsl-sql
>            Reporter: Anton Kedin
>            Assignee: Anton Kedin
> Currently it's hard to match field names with types when constructing a BeamRecordSqlType,
like [here|]:
> {code:java}
> BeamRecordSqlType type = BeamRecordSqlType.create(
>     Arrays.asList("ts", "c_tinyint", "c_smallint",
>         "c_integer", "c_bigint", "c_float", "c_double", "c_decimal",
>         "c_tinyint_max", "c_smallint_max", "c_integer_max", "c_bigint_max"),
>     Arrays.asList(Types.DATE, Types.TINYINT, Types.SMALLINT,
>         Types.INTEGER, Types.BIGINT, Types.FLOAT, Types.DOUBLE, Types.DECIMAL,
>         Types.TINYINT, Types.SMALLINT, Types.INTEGER, Types.BIGINT)
> );
> {code}
> It would be much more readable to have a builder, along these lines:
> {code:java}
> BeamRecordSqlType.builder()
>   .withField("f_int", Types.INTEGER)
>   .withStringField("f_str")
>   .build();
> {code}

This message was sent by Atlassian JIRA

View raw message