Class RexMultisetUtil


  • public class RexMultisetUtil
    extends java.lang.Object
    Utility class for various methods related to multisets.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  RexMultisetUtil.RexCallMultisetOperatorCounter
      A RexShuttle that traverse all RexNode and counts total number of RexCalls traversed and number of multiset calls traversed.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Set<SqlOperator> MULTISET_OPERATORS
      A set defining all implementable multiset calls
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RexMultisetUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean containsMixing​(RexNode node)
      Returns true if a node contains a mixing between multiset and non-multiset calls.
      static boolean containsMixing​(RexProgram program)
      Returns true if any expression in a program contains a mixing between multiset and non-multiset calls.
      static boolean containsMultiset​(java.util.List<RexNode> nodes, boolean deep)
      Returns whether a list of expressions contains a multiset.
      static boolean containsMultiset​(RexNode node, boolean deep)
      Returns true if node contains a multiset operator, otherwise false.
      static boolean containsMultiset​(RexProgram program)
      Returns whether a program contains a multiset.
      static RexCall findFirstMultiset​(RexNode node, boolean deep)
      Returns a reference to the first found multiset call or null if none was found
      static boolean isMultisetCast​(RexCall call)
      Returns true if call is a call to CAST and the to/from cast types are of multiset types.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MULTISET_OPERATORS

        private static final java.util.Set<SqlOperator> MULTISET_OPERATORS
        A set defining all implementable multiset calls
    • Constructor Detail

      • RexMultisetUtil

        private RexMultisetUtil()
    • Method Detail

      • containsMixing

        public static boolean containsMixing​(RexProgram program)
        Returns true if any expression in a program contains a mixing between multiset and non-multiset calls.
      • containsMixing

        public static boolean containsMixing​(RexNode node)
        Returns true if a node contains a mixing between multiset and non-multiset calls.
      • containsMultiset

        public static boolean containsMultiset​(RexNode node,
                                               boolean deep)
        Returns true if node contains a multiset operator, otherwise false. Use it with deep=false when checking if a RexCall is a multiset call.
        Parameters:
        node - Expression
        deep - If true, returns whether expression contains a multiset. If false, returns whether expression is a multiset.
      • containsMultiset

        public static boolean containsMultiset​(java.util.List<RexNode> nodes,
                                               boolean deep)
        Returns whether a list of expressions contains a multiset.
      • containsMultiset

        public static boolean containsMultiset​(RexProgram program)
        Returns whether a program contains a multiset.
      • isMultisetCast

        public static boolean isMultisetCast​(RexCall call)
        Returns true if call is a call to CAST and the to/from cast types are of multiset types.
      • findFirstMultiset

        public static RexCall findFirstMultiset​(RexNode node,
                                                boolean deep)
        Returns a reference to the first found multiset call or null if none was found