From user-zh-return-3320-archive-asf-public=cust-asf.ponee.io@flink.apache.org Wed Apr 29 15:10:34 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3EFA9180654 for ; Wed, 29 Apr 2020 17:10:34 +0200 (CEST) Received: (qmail 94714 invoked by uid 500); 29 Apr 2020 15:10:33 -0000 Mailing-List: contact user-zh-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-zh@flink.apache.org Delivered-To: mailing list user-zh@flink.apache.org Received: (qmail 94683 invoked by uid 99); 29 Apr 2020 15:10:32 -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, 29 Apr 2020 15:10:32 +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 35A371A32A1; Wed, 29 Apr 2020 15:10:32 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.002 X-Spam-Level: X-Spam-Status: No, score=0.002 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Vi9kMv1Aba12; Wed, 29 Apr 2020 15:10:28 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.160.180; helo=mail-qt1-f180.google.com; envelope-from=imjark@gmail.com; receiver= Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 65BD0BB87E; Wed, 29 Apr 2020 15:10:28 +0000 (UTC) Received: by mail-qt1-f180.google.com with SMTP id o10so2105381qtr.6; Wed, 29 Apr 2020 08:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AiTqSR/0DwXuDBzUu+IriWO/BPeqftIZq17DrzGzFGA=; b=RPICyQu6IWMi5+7cgsri9BFJq/cii5zDAKwAunLAUGLAbiXaI7+HVSVGVVDwOMAErl BVTA2MKR+0C3F2Vb/tIhAnjpA3CbQ3mLhu2xU0HcDQu3x91HJm3V7epW/5Vk0VFegDDF zdDApbfooMIi/J2+oGyC3tjUoHlQpZS8JaqwNYJk8eqGf+aMW+h5H5M8gTzdpv7LH+Eu ZLTZJ6GcQeMhWNPx4L9A07Y/ZWwXaecVs31qpqRqsbgosMztF+jxtCqbdDnIS6GM94/X oYDv2GNn6nFOE2r1LSf4bMFy+jZxqigZ0s4G5eYxSKkCj9Fjz+mnN6MDwozkqkeCdeBk LoFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AiTqSR/0DwXuDBzUu+IriWO/BPeqftIZq17DrzGzFGA=; b=qRutRYsHNQND8w6jw1gr6HIHQTNF0CjCG/pjCV9Wzz3S1LlPEI+BvNP+HEm0hEsX9p 9Crx4bHNutrkxNq8Fh6IJINozdfElddmoQzFJ42NBB2TPoTqDihzn0Y7BvH23mDHzmHI /OQfyFVrrlSUvc4yff5zsVI3h7wNR7zvgy4HX0vO0iO8e/0kEBhcYK40xmPqQFQ21dO9 P0jST1UH+tZ5MxzfOohQKVtmPJHFJ66fcCo9vw5v6cjfk9VGkAa2+8OjxOZjzZLBlli/ c5aKjKyn4x1Y1iwR6R2B9t3hlF7lkwlVausCJfwm5y5N/Ge2giVC6bCAHQdl2ZOveeE2 fVIw== X-Gm-Message-State: AGi0PuZgBq/IinEMxE4JXjlU7uVsW04yRe6zvXBcbnCaJtKeZvRoIdZX xm0lhc04Sz/H73nPwj2igRVNluDg8ajJB2hVUiMSEN9jpOIqqA== X-Google-Smtp-Source: APiQypIHXqmgJMRGQWp1Wf67BtT4SbJHpPxEK1PSgbtOm4g0p1FgVl+6J7lVjLzuZsqxg1/Q79WLXHg383RgmTEzDQQ= X-Received: by 2002:ac8:46d8:: with SMTP id h24mr34666661qto.352.1588173027752; Wed, 29 Apr 2020 08:10:27 -0700 (PDT) MIME-Version: 1.0 References: <68a6197a-d5fc-1a86-cab1-f614dadb5fc5@apache.org> In-Reply-To: From: Jark Wu Date: Wed, 29 Apr 2020 23:10:16 +0800 Message-ID: Subject: Re: [DISCUSS] Hierarchies in ConfigOption To: dev Cc: Timo Walther , user , user-zh Content-Type: multipart/alternative; boundary="00000000000029445005a46f5920" --00000000000029445005a46f5920 Content-Type: text/plain; charset="UTF-8" From a user's perspective, I prefer the shorter one "format=json", because it's more concise and straightforward. The "kind" is redundant for users. Is there a real case requires to represent the configuration in JSON style? As far as I can see, I don't see such requirement, and everything works fine by now. So I'm in favor of "format=json". But if the community insist to follow code style on this, I'm also fine with the longer one. Btw, I also CC user mailing list to listen more user's feedback. Because I think this is relative to usability. Best, Jark On Wed, 29 Apr 2020 at 22:09, Chesnay Schepler wrote: > > Therefore, should we advocate instead: > > > > 'format.kind' = 'json', > > 'format.fail-on-missing-field' = 'false' > > Yes. That's pretty much it. > > This is reasonable important to nail down as with such violations I > believe we could not actually switch to a standard YAML parser. > > On 29/04/2020 16:05, Timo Walther wrote: > > Hi everyone, > > > > discussions around ConfigOption seem to be very popular recently. So I > > would also like to get some opinions on a different topic. > > > > How do we represent hierarchies in ConfigOption? In FLIP-122, we > > agreed on the following DDL syntax: > > > > CREATE TABLE fs_table ( > > ... > > ) WITH ( > > 'connector' = 'filesystem', > > 'path' = 'file:///path/to/whatever', > > 'format' = 'csv', > > 'format.allow-comments' = 'true', > > 'format.ignore-parse-errors' = 'true' > > ); > > > > Of course this is slightly different from regular Flink core > > configuration but a connector still needs to be configured based on > > these options. > > > > However, I think this FLIP violates our code style guidelines because > > > > 'format' = 'json', > > 'format.fail-on-missing-field' = 'false' > > > > is an invalid hierarchy. `format` cannot be a string and a top-level > > object at the same time. > > > > We have similar problems in our runtime configuration: > > > > state.backend= > > state.backend.incremental= > > restart-strategy= > > restart-strategy.fixed-delay.delay= > > high-availability= > > high-availability.cluster-id= > > > > The code style guide states "Think of the configuration as nested > > objects (JSON style)". So such hierarchies cannot be represented in a > > nested JSON style. > > > > Therefore, should we advocate instead: > > > > 'format.kind' = 'json', > > 'format.fail-on-missing-field' = 'false' > > > > What do you think? > > > > Thanks, > > Timo > > > > [1] > > > https://flink.apache.org/contributing/code-style-and-quality-components.html#configuration-changes > > > > --00000000000029445005a46f5920--