Class GeodeFilter.Translator

  • Enclosing class:
    GeodeFilter

    static class GeodeFilter.Translator
    extends java.lang.Object
    Translates RexNode expressions into Geode expression strings.
    • Field Detail

      • fieldNames

        private final java.util.List<java.lang.String> fieldNames
    • Method Detail

      • literalValue

        private static java.lang.String literalValue​(RexLiteral literal)
        Converts the value of a literal to a string.
        Parameters:
        literal - Literal to translate
        Returns:
        String representation of the literal
      • translateMatch

        private java.lang.String translateMatch​(RexNode condition)
        Produce the OQL predicate string for the given condition.
        Parameters:
        condition - Condition to translate
        Returns:
        OQL predicate string
      • translateAnd

        private java.lang.String translateAnd​(RexNode condition)
        Translate a conjunctive predicate to a OQL string.
        Parameters:
        condition - A conjunctive predicate
        Returns:
        OQL string for the predicate
      • getLeftNodeFieldName

        private java.lang.String getLeftNodeFieldName​(RexNode left)
        Get the field name for the left node to use for IN SET query
      • useInSetQueryClause

        private boolean useInSetQueryClause​(java.util.List<RexNode> disjunctions)
        Check if we can use IN SET Query clause to improve query performance
      • translateInSet

        private java.lang.String translateInSet​(java.util.List<RexNode> disjunctions)
        Creates OQL IN SET predicate string
      • getLeftNodeFieldNameForNode

        private java.lang.String getLeftNodeFieldNameForNode​(RexNode node)
      • getLeftNodeDisjunctions

        private java.util.List<RexNode> getLeftNodeDisjunctions​(RexNode node,
                                                                java.util.List<RexNode> disjunctions)
      • translateOr

        private java.lang.String translateOr​(java.util.List<RexNode> disjunctions)
      • translateMatch2

        private java.lang.String translateMatch2​(RexNode node)
        Translate a binary relation.
      • translateBinary

        private java.lang.String translateBinary​(java.lang.String op,
                                                 java.lang.String rop,
                                                 RexCall call)
        Translates a call to a binary operator, reversing arguments if necessary.
      • translateBinary2

        private java.lang.String translateBinary2​(java.lang.String op,
                                                  RexNode left,
                                                  RexNode right)
        Translates a call to a binary operator. Returns null on failure.
      • quoteCharLiteral

        private java.lang.String quoteCharLiteral​(RexLiteral literal)
      • translateOp2

        private java.lang.String translateOp2​(java.lang.String op,
                                              java.lang.String name,
                                              RexLiteral right)
        Combines a field name, operator, and literal to produce a predicate string.