Class RowUtils


  • @PublicEvolving
    public final class RowUtils
    extends Object
    Utilities to deal with Row instances.

    This class exists to keep the Row class itself slim.

    • Field Detail

      • USE_LEGACY_TO_STRING

        public static boolean USE_LEGACY_TO_STRING
        Internal flag to enable the legacy Row.toString() implementation for tests. In general, tests should not depend on the string representation of rows but should fully compare instances (especially data types of fields). This flag will be dropped once all tests have been updated.
    • Method Detail

      • compareRows

        public static boolean compareRows​(List<Row> l1,
                                          List<Row> l2)
        Compares two Lists of Row for deep equality. This method supports all conversion classes of the table ecosystem.
      • compareRows

        public static boolean compareRows​(List<Row> l1,
                                          List<Row> l2,
                                          boolean ignoreOrder)
        Compares two Lists of Row for deep equality. This method supports all conversion classes of the table ecosystem. The top-level lists can be compared with or without order.
      • createRowWithNamedPositions

        @Internal
        public static Row createRowWithNamedPositions​(RowKind kind,
                                                      Object[] fieldByPosition,
                                                      LinkedHashMap<String,​Integer> positionByName)
        Internal utility for creating a row in static named-position field mode.