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 B5EC0200CAF for ; Thu, 22 Jun 2017 19:02:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B4776160BE7; Thu, 22 Jun 2017 17:02:04 +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 0317F160BD3 for ; Thu, 22 Jun 2017 19:02:03 +0200 (CEST) Received: (qmail 74991 invoked by uid 500); 22 Jun 2017 17:02:03 -0000 Mailing-List: contact dev-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@avro.apache.org Delivered-To: mailing list dev@avro.apache.org Received: (qmail 74980 invoked by uid 99); 22 Jun 2017 17:02:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Jun 2017 17:02:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 7FA2DCF33A for ; Thu, 22 Jun 2017 17:02:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.011 X-Spam-Level: X-Spam-Status: No, score=-100.011 tagged_above=-999 required=6.31 tests=[SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qIu6iD9iGnnh for ; Thu, 22 Jun 2017 17:02:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2E5B35F666 for ; Thu, 22 Jun 2017 17:02:01 +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 6C91CE0933 for ; Thu, 22 Jun 2017 17:02: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 1C28A21942 for ; Thu, 22 Jun 2017 17:02:00 +0000 (UTC) Date: Thu, 22 Jun 2017 17:02:00 +0000 (UTC) From: "Doug Cutting (JIRA)" To: dev@avro.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AVRO-2035) enable validation of default values in schemas by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 22 Jun 2017 17:02:04 -0000 [ https://issues.apache.org/jira/browse/AVRO-2035?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Doug Cutting updated AVRO-2035: ------------------------------- Assignee: Doug Cutting Status: Patch Available (was: Open) > enable validation of default values in schemas by default > --------------------------------------------------------- > > Key: AVRO-2035 > URL: https://issues.apache.org/jira/browse/AVRO-2035 > Project: Avro > Issue Type: Bug > Components: java > Affects Versions: 1.8.1 > Reporter: radai rosenblatt > Assignee: Doug Cutting > Fix For: 1.9.0 > > Attachments: AVRO-2035.patch > > > suppose i have the following schema evolution: > {code} > { > "name": "Bob", > "type": "record", > "fields": [ > {"name": "f1", "type": "int"} > ] > } > {code} > and then: > {code} > { > "name": "Bob", > "type": "record", > "fields": [ > {"name": "f1", "type": "int"}, > {"name": "f2", "type": "boolean", "default": "true"} > ] > } > {code} > the default value for "f2" is specified as the _STRING_ "true" (and not the literal boolean true). > if this default value is ever accessed (when reading a gen1-serialized object as a gen2) we get this: > {code} > org.apache.avro.AvroTypeException: Non-boolean default for boolean: "true" > at org.apache.avro.io.parsing.ResolvingGrammarGenerator.encode(ResolvingGrammarGenerator.java:408) > at org.apache.avro.io.parsing.ResolvingGrammarGenerator.getBinary(ResolvingGrammarGenerator.java:307) > at org.apache.avro.io.parsing.ResolvingGrammarGenerator.resolveRecords(ResolvingGrammarGenerator.java:285) > at org.apache.avro.io.parsing.ResolvingGrammarGenerator.generate(ResolvingGrammarGenerator.java:118) > at org.apache.avro.io.parsing.ResolvingGrammarGenerator.generate(ResolvingGrammarGenerator.java:50) > at org.apache.avro.io.ResolvingDecoder.resolve(ResolvingDecoder.java:85) > at org.apache.avro.io.ResolvingDecoder.(ResolvingDecoder.java:49) > at org.apache.avro.io.DecoderFactory.resolvingDecoder(DecoderFactory.java:307) > at org.apache.avro.generic.GenericDatumReader.getResolver(GenericDatumReader.java:127) > at org.apache.avro.generic.GenericDatumReader.read(GenericDatumReader.java:142) > {code} > yet Schema.parse() passes for this -- This message was sent by Atlassian JIRA (v6.4.14#64029)