From issues-return-228419-apmail-flink-issues-archive=flink.apache.org@flink.apache.org Fri Apr 26 10:56:02 2019 Return-Path: X-Original-To: apmail-flink-issues-archive@minotaur.apache.org Delivered-To: apmail-flink-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id B726B18753 for ; Fri, 26 Apr 2019 10:56:01 +0000 (UTC) Received: (qmail 92291 invoked by uid 500); 26 Apr 2019 10:56:01 -0000 Delivered-To: apmail-flink-issues-archive@flink.apache.org Received: (qmail 92188 invoked by uid 500); 26 Apr 2019 10:56:01 -0000 Mailing-List: contact issues-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list issues@flink.apache.org Received: (qmail 92141 invoked by uid 99); 26 Apr 2019 10:56:00 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Apr 2019 10:56:00 +0000 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 5E633E2B07 for ; Fri, 26 Apr 2019 10:56:00 +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 208A625813 for ; Fri, 26 Apr 2019 10:56:00 +0000 (UTC) Date: Fri, 26 Apr 2019 10:56:00 +0000 (UTC) From: "Artsem Semianenka (JIRA)" To: issues@flink.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FLINK-12337) [TableSQL/Planner] InsertInto method should configure TableSink MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FLINK-12337?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D168= 26885#comment-16826885 ]=20 Artsem Semianenka commented on FLINK-12337: ------------------------------------------- I will attach the pull request as an illustrative example of my proposal.= =C2=A0 > [TableSQL/Planner] InsertInto method should configure TableSink=20 > ---------------------------------------------------------------- > > Key: FLINK-12337 > URL: https://issues.apache.org/jira/browse/FLINK-12337 > Project: Flink > Issue Type: New Feature > Reporter: Artsem Semianenka > Assignee: Artsem Semianenka > Priority: Major > > In the current implementation of TableEnvironment the *insertInto(..)* me= thod check is the source Table Schema exactly the same as sink schema other= wise, it throws a ValidationException. > Let's imagine the following setup: > I have a sink wich produce the Row with fields A and B. (for example Kaf= ka) > By the other hand, I have an External Catalog which produce the sink for= Database which support UPSERT (for example PostgreSQL or Cloudera Kudu in = my case) with schema of fields : > * A _required_ > * B _required_ > * C _+optional+_ > I want to UPSERT only A and B fields in the sink. But as far as sink was = created from the external catalog it knows only the schema of the table. (f= ields A B C) and when I create the query like this I got the ValidationExce= ption. > {code:java} > INSERT INTO sink.table > SELECT A, B FROM src.topic{code} > =C2=A0I propose to validate in *insertInto(..)* method does the source sc= hema is the subset of sink schema and if yes call the configure(..) method = for the sink. In this case, the sink can adapt for source schema if it is p= ossible. -- This message was sent by Atlassian JIRA (v7.6.3#76005)