From dev-return-16275-apmail-calcite-dev-archive=calcite.apache.org@calcite.apache.org Thu May 28 09:14:29 2020 Return-Path: X-Original-To: apmail-calcite-dev-archive@www.apache.org Delivered-To: apmail-calcite-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id 249B4195CC for ; Thu, 28 May 2020 09:14:29 +0000 (UTC) Received: (qmail 57538 invoked by uid 500); 28 May 2020 09:14:28 -0000 Delivered-To: apmail-calcite-dev-archive@calcite.apache.org Received: (qmail 57392 invoked by uid 500); 28 May 2020 09:14:27 -0000 Mailing-List: contact dev-help@calcite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@calcite.apache.org Delivered-To: mailing list dev@calcite.apache.org Received: (qmail 57379 invoked by uid 99); 28 May 2020 09:14:27 -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, 28 May 2020 09:14:27 +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 7EB97C009A for ; Thu, 28 May 2020 09:14:26 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=digiverse-si.20150623.gappssmtp.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id q-A6alD4bBpd for ; Thu, 28 May 2020 09:14:25 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.67; helo=mail-ed1-f67.google.com; envelope-from=bozzo@digiverse.si; receiver= Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id CC91BBB8CA for ; Thu, 28 May 2020 09:14:24 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id g9so22593243edw.10 for ; Thu, 28 May 2020 02:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=digiverse-si.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=EC/pZhEk1KmVFIMn6qNxa/o8DAjP4PshqEEqqcGkp+Y=; b=cybv1pG1YG80G8IU8WW7ax75i/4ofia6PNNanyB8cWUJaDgOVLqfBymELG4UgLneIx uaiTEhSJy0gK9nqoawV5Q9krUtjyusUVFTp2z+6Q+4UQOe4dTwJLHDqBl+bGzyfPvl92 8ZdWBvqc+FyzVFUBsWOXexQYMyIK4zbyZnZAFK5RrIJpgpzPl164kYt4XJtziGwCCrh3 K9luG8xlRU8Grp4n9TcbpeScy0dsFfyhDo+JtnS7I/gZl5HTvYhcYwkigOhnvl/iTUn8 L8nbHeyWRa9Ou1YwvE+KCb1QFCdJnNlKfLt71DbyiuvnQfc51r6FhOxnjkSZXvVhDJtx xdBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=EC/pZhEk1KmVFIMn6qNxa/o8DAjP4PshqEEqqcGkp+Y=; b=pHLh5fuw/nXeSYs+mkpNTir/EMiDT8O1wTsY0cBh4nv4rGaXZNF8aO/sXkwKYJjHTa p6NaFyUHxJKsf8E9w7h7o76F8/AeOp3dMzOnUUFKhP6dyRFhlmbkexGqxHCYc629bHqh k47frWOehGU1L/3mbJhWA7rnKi6i5//BqDQpi65Pjed4RkHoFcJU9l50PgI2XBcBkfoT BmnskKU4MjoHOdAut+zt9cd0sadZRT6ssRC1JBJZyNxojbGso2DJ0RlEIyEffsAFmOPT xwhIKFOs7Dhcqg/lowdHOcRagFOFcYKRyW9/FF3bRDZtoVWp8ve+BkD0/grfNQODIq/h XiIg== X-Gm-Message-State: AOAM533w+HaV42+Zo3fIM4wZsibXxRI3o6AFrQuFAqSc+JyGHxbiwSD9 eGmLI2XDaEoS9LaC7QBDFMLtEj4ktZy7uA== X-Google-Smtp-Source: ABdhPJxi+hUC0WYkVp1Jaxqq6c/XD9KUMl7hc0xJXeU3nPbAHUmVAZLEboBKjS2d+J7V+LC028/7mg== X-Received: by 2002:a50:fb1a:: with SMTP id d26mr2055314edq.83.1590657263581; Thu, 28 May 2020 02:14:23 -0700 (PDT) Received: from [192.168.2.98] ([193.77.221.230]) by smtp.googlemail.com with ESMTPSA id c23sm4729068ejm.116.2020.05.28.02.14.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 May 2020 02:14:22 -0700 (PDT) To: dev@calcite.apache.org From: Bozo Dragojevic Subject: SqlNode.toSqlString() not parseable by calcite? Message-ID: <397fb644-c8a9-c5b9-fefe-e9693de856ac@digiverse.si> Date: Thu, 28 May 2020 11:14:21 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US Hi! In trying to fix https://issues.apache.org/jira/browse/DRILL-7722 I think the path leads to calcite... So a question, is SqlNode.toSqlString() supposed to produce a SQL string that is parseable by calcite? I've created this little change to the TesterImpl.check() method to also parse the expected result and that fails for all the tests. Is this behavior by design? Cheers, Bozzo ----- $ git diff diff --git a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java index 21b664fb4..0c79a16b6 100644 --- a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java +++ b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java @@ -8838,6 +8838,10 @@ public void check(String sql, SqlDialect dialect, String expected,            dialect == null ? UnaryOperator.identity() : dialect::configureParser,            parserChecker);        check(sqlNode, dialect, expected); +      final SqlNode expectedSqlNode  = parseStmtAndHandleEx(expected, +          dialect == null ? UnaryOperator.identity() : dialect::configureParser, +          parserChecker); +      check(expectedSqlNode, dialect, expected);      }      protected SqlNode parseStmtAndHandleEx(String sql,