You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by Julian Hyde <jh...@gmail.com> on 2018/09/01 08:43:41 UTC
Re: calcite git commit: [CALCITE-2498] fix bug when geode adapter quotes booleans as strings (Andrei Sereda)
When you commit, please make sure the commit message is high quality. A commit message should never start with “fix bug when...” and should always start with a capital letter.
Julian
> On Aug 31, 2018, at 6:55 PM, vladimirsitnikov@apache.org wrote:
>
> Repository: calcite
> Updated Branches:
> refs/heads/master 2817bda61 -> 9589a3606
>
>
> [CALCITE-2498] fix bug when geode adapter quotes booleans as strings (Andrei Sereda)
>
> GeodeFilter was incorrectly quoting boolean literals as SQL strings ('true' instead of true)
>
> fixes #809
>
>
> Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
> Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/9589a360
> Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/9589a360
> Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/9589a360
>
> Branch: refs/heads/master
> Commit: 9589a360656a752be73fb27ce285cd32b22bc0e0
> Parents: 2817bda
> Author: Andrei Sereda <25...@users.noreply.github.com>
> Authored: Tue Aug 28 18:08:09 2018 -0400
> Committer: Vladimir Sitnikov <si...@gmail.com>
> Committed: Sat Sep 1 04:55:29 2018 +0300
>
> ----------------------------------------------------------------------
> .../java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/calcite/blob/9589a360/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> ----------------------------------------------------------------------
> diff --git a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> index e4e5ac9..ca0b482 100644
> --- a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> +++ b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> @@ -36,6 +36,7 @@ import java.util.ArrayList;
> import java.util.Collections;
> import java.util.List;
>
> +import static org.apache.calcite.sql.type.SqlTypeName.BOOLEAN_TYPES;
> import static org.apache.calcite.sql.type.SqlTypeName.CHAR;
> import static org.apache.calcite.sql.type.SqlTypeName.NUMERIC_TYPES;
>
> @@ -225,7 +226,7 @@ public class GeodeFilter extends Filter implements GeodeRel {
> private String translateOp2(String op, String name, RexLiteral right) {
> String valueString = literalValue(right);
> SqlTypeName typeName = rowType.getField(name, true, false).getType().getSqlTypeName();
> - if (NUMERIC_TYPES.contains(typeName)) {
> + if (NUMERIC_TYPES.contains(typeName) || BOOLEAN_TYPES.contains(typeName)) {
> // leave the value as it is
> } else if (typeName != SqlTypeName.CHAR) {
> valueString = "'" + valueString + "'";
>
Re: calcite git commit: [CALCITE-2498] fix bug when geode adapter
quotes booleans as strings (Andrei Sereda)
Posted by Andrei Sereda <an...@sereda.cc>.
I'll be more careful on my next commits
On Sat, Sep 1, 2018, 04:43 Julian Hyde <jh...@gmail.com> wrote:
> When you commit, please make sure the commit message is high quality. A
> commit message should never start with “fix bug when...” and should always
> start with a capital letter.
>
> Julian
>
> > On Aug 31, 2018, at 6:55 PM, vladimirsitnikov@apache.org wrote:
> >
> > Repository: calcite
> > Updated Branches:
> > refs/heads/master 2817bda61 -> 9589a3606
> >
> >
> > [CALCITE-2498] fix bug when geode adapter quotes booleans as strings
> (Andrei Sereda)
> >
> > GeodeFilter was incorrectly quoting boolean literals as SQL strings
> ('true' instead of true)
> >
> > fixes #809
> >
> >
> > Project: http://git-wip-us.apache.org/repos/asf/calcite/repo
> > Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/9589a360
> > Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/9589a360
> > Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/9589a360
> >
> > Branch: refs/heads/master
> > Commit: 9589a360656a752be73fb27ce285cd32b22bc0e0
> > Parents: 2817bda
> > Author: Andrei Sereda <25...@users.noreply.github.com>
> > Authored: Tue Aug 28 18:08:09 2018 -0400
> > Committer: Vladimir Sitnikov <si...@gmail.com>
> > Committed: Sat Sep 1 04:55:29 2018 +0300
> >
> > ----------------------------------------------------------------------
> > .../java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/calcite/blob/9589a360/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> > ----------------------------------------------------------------------
> > diff --git
> a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> > index e4e5ac9..ca0b482 100644
> > ---
> a/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> > +++
> b/geode/src/main/java/org/apache/calcite/adapter/geode/rel/GeodeFilter.java
> > @@ -36,6 +36,7 @@ import java.util.ArrayList;
> > import java.util.Collections;
> > import java.util.List;
> >
> > +import static org.apache.calcite.sql.type.SqlTypeName.BOOLEAN_TYPES;
> > import static org.apache.calcite.sql.type.SqlTypeName.CHAR;
> > import static org.apache.calcite.sql.type.SqlTypeName.NUMERIC_TYPES;
> >
> > @@ -225,7 +226,7 @@ public class GeodeFilter extends Filter implements
> GeodeRel {
> > private String translateOp2(String op, String name, RexLiteral
> right) {
> > String valueString = literalValue(right);
> > SqlTypeName typeName = rowType.getField(name, true,
> false).getType().getSqlTypeName();
> > - if (NUMERIC_TYPES.contains(typeName)) {
> > + if (NUMERIC_TYPES.contains(typeName) ||
> BOOLEAN_TYPES.contains(typeName)) {
> > // leave the value as it is
> > } else if (typeName != SqlTypeName.CHAR) {
> > valueString = "'" + valueString + "'";
> >
>