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 9C2FB200CFD for ; Wed, 6 Sep 2017 11:38:47 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9AE5B161198; Wed, 6 Sep 2017 09:38:47 +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 E09D7160CD8 for ; Wed, 6 Sep 2017 11:38:46 +0200 (CEST) Received: (qmail 66520 invoked by uid 500); 6 Sep 2017 09:38:45 -0000 Mailing-List: contact user-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list user@flink.apache.org Received: (qmail 66510 invoked by uid 99); 6 Sep 2017 09:38:45 -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; Wed, 06 Sep 2017 09:38:45 +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 36FF51A068A for ; Wed, 6 Sep 2017 09:38:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.48 X-Spam-Level: ** X-Spam-Status: No, score=2.48 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=okkam-it.20150623.gappssmtp.com 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 hbPD5VPLGBwE for ; Wed, 6 Sep 2017 09:38:43 +0000 (UTC) Received: from mail-vk0-f41.google.com (mail-vk0-f41.google.com [209.85.213.41]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 60A2B5F257 for ; Wed, 6 Sep 2017 09:38:43 +0000 (UTC) Received: by mail-vk0-f41.google.com with SMTP id t10so11019951vke.0 for ; Wed, 06 Sep 2017 02:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=okkam-it.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=8cv8bZl+pT5Wni84HgB3uFZFIXoWVdxnKyq1psUyNXY=; b=0kfoN52Hd2EXv3ACPrpa/ymfUq/MtcMKuH6OpEva17fnXwmVzs85H/ACm3Pm1img8z OARNDycfqhGmv5jHyQj2tiWOOduKYpedTWeIXVlLCZ812F/odkSX4oOkpaK6ejSvbUyB NfUU1GKeCbk88ACAcpIX70pb+vWq5SFyuqEy5o6mHxh5RFhZnW9hM47VLGy+H2i9Y+1t mf9/HAUOgtIIMM9rFd1mTMKUqSiri2Dh2ikPjXdXZxneKHJ3ztq73ic0cw5zedosYD/2 3ltZu3OTsw5c4YLaZMTIu28d1zJBzAit4m5XXeyERKHgbRtI4pAbUoxsz9xc+9cmoJRk ZgtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=8cv8bZl+pT5Wni84HgB3uFZFIXoWVdxnKyq1psUyNXY=; b=FqYf5tnAm46Xyh1npcDWhX6weQFKxTlvvi8alLUpMIMT3+mBIOZIh0LNFDlv0WWm6e XoFXy90CSSRDMFLldawwUeVCKydbPsSZ4m7wpWcaWky1sAvnFNwSyKU/Crfb1UcIEnZR RuE09jMkdakkB7z4wen736HsurmTOroX2Y0pL6gwN4gTGpOvBhOD4CXxgaLYKPOzlX4t YhppLC9o6W1kumNoMKX+1mWlDbHCoHX36ru97iiQ+2KbxCILiwrgdd6jaMvNlkwGVao2 GZt8frl3HV5mGHcm33OkUzDTDdpJaiYPTYYKz0b0Z8TEuBRdJbPVGU0ZdVYrvN+j6K/+ N8XA== X-Gm-Message-State: AHPjjUjONk/kJg4eL22fvQhFogG71/KrVplTj48C9mu1AU6GED488kl+ T9JzSIHrsp/L3FVv1oxWBvdvp0Gdd1d5aGM= X-Google-Smtp-Source: ADKCNb6CTwls54E+0LRzIi8S2+71TJa51RUSUncTXrH/cEYXBYPr0i6QxSxeoDI0D/1+3+o2C93klslPbNnK0M6uKr0= X-Received: by 10.31.52.87 with SMTP id b84mr1103730vka.115.1504690722702; Wed, 06 Sep 2017 02:38:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.33.103 with HTTP; Wed, 6 Sep 2017 02:38:22 -0700 (PDT) X-Originating-IP: [77.43.114.114] From: Flavio Pompermaier Date: Wed, 6 Sep 2017 11:38:22 +0200 Message-ID: Subject: Apache Phenix integration To: user Content-Type: multipart/alternative; boundary="001a1143f4700624690558821c33" archived-at: Wed, 06 Sep 2017 09:38:47 -0000 --001a1143f4700624690558821c33 Content-Type: text/plain; charset="UTF-8" Hi to all, I'm writing a job that uses Apache Phoenix. At first I used the PhoenixOutputFormat as (hadoop) OutputFormat but it's not well suited to work with Table API because it cannot handle generic objects like Rows (it need a DBWritable Object that should be already present at compile time). So I've looked into the code of the PhoenixOutputFormat and it's nothing else than a JDBCOutputFormat (basically). However, to make it work I had to slightly modify the Flink JDBCOutputformat, adding a dbConn.commit() after the executeBatch() on the PreparedStatement. E.g: upload.executeBatch(); dbConn.commit(); For the moment I've just created a dedicated PhoenixJdbcOutpuFormat where I've added these 2 lines of code starting from the code of the JDBCOutputformat (it couldn't be extended in this case because all fields are private). What do you think about this? Should I open a ticket to add a connection commit after executeBatch (in order to be compatible with Phoenix) or something else (e.g. create a Phoenix connector that basically extend JDBCOutputConnector and ovewrite 2 methods, changing also the visibility of its fields to protected)? Best, Flavio --001a1143f4700624690558821c33 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi to all,
I'm writing a job that uses Apache Phoe= nix.

At first I used the PhoenixOutputFormat as (h= adoop) OutputFormat but it's not well suited to work with Table API bec= ause it cannot handle generic objects like Rows (it need a DBWritable Objec= t that should be already present at compile time). So I've looked into = the code of the PhoenixOutputFormat and it's nothing else than a JDBCOu= tputFormat (basically).

However, to make it work I= had to slightly modify the Flink JDBCOutputformat, adding a dbConn.commit(= ) after the executeBatch() on the PreparedStatement. E.g:

=C2=A0 =C2=A0 upload.executeBatch();
=C2=A0 =C2=A0 dbConn= .commit();

For the moment I've just created a = dedicated PhoenixJdbcOutpuFormat where I've added these 2 lines of code= starting from the code of the JDBCOutputformat (it couldn't be extende= d in this case because all fields are private).

Wh= at do you think about this? Should I open a ticket to add a connection comm= it after executeBatch (in order to be compatible with Phoenix) or something= else (e.g. create a Phoenix connector that basically extend JDBCOutputConn= ector and ovewrite 2 methods, changing also the visibility of its fields to= protected)?

Best,
Flavio

--001a1143f4700624690558821c33--