Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 46942200D52 for ; Sat, 2 Dec 2017 09:35:06 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 44F9B160BF7; Sat, 2 Dec 2017 08:35:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6643D160BF8 for ; Sat, 2 Dec 2017 09:35:05 +0100 (CET) Received: (qmail 96995 invoked by uid 500); 2 Dec 2017 08:35:04 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 96985 invoked by uid 99); 2 Dec 2017 08:35:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 02 Dec 2017 08:35:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id C2A741A0718 for ; Sat, 2 Dec 2017 08:35:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ZIUv5HvkdlRh for ; Sat, 2 Dec 2017 08:35:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 2895F5FB02 for ; Sat, 2 Dec 2017 08:35:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A9B34E0D7D for ; Sat, 2 Dec 2017 08:35:01 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 47415255CA for ; Sat, 2 Dec 2017 08:35:00 +0000 (UTC) Date: Sat, 2 Dec 2017 08:35:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (BEAM-3157) BeamSql transform should support other PCollection types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Sat, 02 Dec 2017 08:35:06 -0000 [ https://issues.apache.org/jira/browse/BEAM-3157?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16275= 479#comment-16275479 ]=20 ASF GitHub Bot commented on BEAM-3157: -------------------------------------- akedin opened a new pull request #4204: [BEAM-3157] Generate BeamRecord typ= es from Pojos URL: https://github.com/apache/beam/pull/4204 =20 =20 This implements automatic generation of BeamRecordTypes and BeamRecordSq= lTypes from pojo types. Work is being done as part of [BEAM-3157](https://i= ssues.apache.org/jira/browse/BEAM-3157). =20 Main piece is [RecordFactory](https://github.com/apache/beam/compare/mas= ter...akedin:generate-record-types?expand=3D1#diff-55e6442c81f404c1004a445b= 550f03c9) which exposes a method to generate BeamRecords from pojos. See [R= ecordFactoryTest](https://github.com/apache/beam/compare/master...akedin:ge= nerate-record-types?expand=3D1#diff-869b654afa6699d55098a8fc3f2e5740) for u= sage examples.=20 =20 The plan is to integrate this into the Beam SQL framework. Integration i= nto SQL will be done in the future PRs. =20 Records generation is a major step to simplify conversion of pojo model = to BeamRecords. Immediate use case is implementation of Nexmark queries in = Beam SQL using existing pojo models.=20 This can also be used as a starting point for code generation for schema= -aware collections. =20 =20 =20 =20 =20 Follow this checklist to help us incorporate your contribution quickly a= nd easily: =20 - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/= projects/BEAM/issues/) filed for the change (usually before you start worki= ng on it). Trivial changes like typos do not require a JIRA issue. Your p= ull request should address just this issue, without pulling in other change= s. - [ ] 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 Appro= ximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA is= sue. - [ ] Write a pull request description that is detailed enough to under= stand what the pull request does, how, and why. - [ ] Run `mvn clean verify` to make sure basic checks pass. A more tho= rough check will be performed on your pull request automatically. - [ ] If this contribution is large, please file an Apache [Individual = Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). =20 --- =20 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. =20 For queries about this service, please contact Infrastructure at: users@infra.apache.org > BeamSql transform should support other PCollection types > -------------------------------------------------------- > > Key: BEAM-3157 > URL: https://issues.apache.org/jira/browse/BEAM-3157 > Project: Beam > Issue Type: Improvement > Components: dsl-sql > Reporter: Isma=C3=ABl Mej=C3=ADa > Assignee: Anton Kedin > > Currently the Beam SQL transform only supports input and output data repr= esented as a BeamRecord. This seems to me like an usability limitation (eve= n if we can do a ParDo to prepare objects before and after the transform). > I suppose this constraint comes from the fact that we need to map name/ty= pe/value from an object field into Calcite so it is convenient to have a sp= ecific data type (BeamRecord) for this. However we can accomplish the same = by using a PCollection of JavaBean (where we know the same information via = the field names/types/values) or by using Avro records where we also have t= he Schema information. For the output PCollection we can map the object via= a Reference (e.g. a JavaBean to be filled with the names of an Avro object= ). > Note: I am assuming for the moment simple mappings since the SQL does not= support composite types for the moment. > A simple API idea would be something like this: > A simple filter: > PCollection col =3D BeamSql.query("SELECT * FROM .... WHERE ...")= .from(MyPojo.class); > A projection: > PCollection newCol =3D BeamSql.query("SELECT id, name").from(M= yPojo.class).as(MyNewPojo.class); > A first approach could be to just add the extra ParDos + transform DoFns = however I suppose that for memory use reasons maybe mapping directly into C= alcite would make sense. -- This message was sent by Atlassian JIRA (v6.4.14#64029)