@@ -1713,76 +1713,4 @@ ref_type Cluster::typed_write(ref_type ref, _impl::ArrayWriterBase& out) const
17131713 }
17141714 return written_cluster.write (out);
17151715}
1716-
1717- void Cluster::typed_print (std::string prefix) const
1718- {
1719- REALM_ASSERT_DEBUG (!get_is_inner_bptree_node_from_header (get_header ()));
1720- std::cout << " Cluster of size " << size () << " " << header_to_string (get_header ()) << std::endl;
1721- const auto table = get_owning_table ();
1722- for (unsigned j = 0 ; j < size (); ++j) {
1723- RefOrTagged rot = get_as_ref_or_tagged (j);
1724- auto pref = prefix + " " + std::to_string (j) + " :\t " ;
1725- if (rot.is_ref () && rot.get_as_ref ()) {
1726- if (j == 0 ) {
1727- std::cout << pref << " Keys as ArrayUnsigned as " ;
1728- Array a (m_alloc);
1729- a.init_from_ref (rot.get_as_ref ());
1730- a.typed_print (pref);
1731- }
1732- else {
1733- auto col_key = table->m_leaf_ndx2colkey [j - 1 ];
1734- auto col_type = col_key.get_type ();
1735- auto col_attr = col_key.get_attrs ();
1736- std::string attr_string;
1737- if (col_attr.test (col_attr_Dictionary))
1738- attr_string = " Dict:" ;
1739- if (col_attr.test (col_attr_List))
1740- attr_string = " List:" ;
1741- if (col_attr.test (col_attr_Set))
1742- attr_string = " Set:" ;
1743- if (col_attr.test (col_attr_Nullable))
1744- attr_string += " Null:" ;
1745- std::cout << pref << " Column[" << attr_string << col_type << " ] as " ;
1746- // special cases for the types we want to compress
1747- if (col_attr.test (col_attr_List) || col_attr.test (col_attr_Set)) {
1748- // That is a single bplustree
1749- // propagation of nullable missing here?
1750- // handling of mixed missing here?
1751- BPlusTreeBase::typed_print (pref, m_alloc, rot.get_as_ref (), col_type);
1752- }
1753- else if (col_attr.test (col_attr_Dictionary)) {
1754- Array dict_top (m_alloc);
1755- dict_top.init_from_ref (rot.get_as_ref ());
1756- if (dict_top.size () == 0 ) {
1757- std::cout << " { empty }" << std::endl;
1758- continue ;
1759- }
1760- std::cout << " {" << std::endl;
1761- auto ref0 = dict_top.get_as_ref (0 );
1762- if (ref0) {
1763- auto p = pref + " 0:\t " ;
1764- std::cout << p;
1765- BPlusTreeBase::typed_print (p, m_alloc, ref0, col_type);
1766- }
1767- if (dict_top.size () == 1 ) {
1768- continue ; // is this really possible? or should all dicts have both trees?
1769- }
1770- auto ref1 = dict_top.get_as_ref (1 );
1771- if (ref1) {
1772- auto p = pref + " 1:\t " ;
1773- std::cout << p;
1774- BPlusTreeBase::typed_print (p, m_alloc, dict_top.get_as_ref (1 ), col_type);
1775- }
1776- }
1777- else {
1778- // handle all other cases as generic arrays
1779- Array a (m_alloc);
1780- a.init_from_ref (rot.get_as_ref ());
1781- a.typed_print (pref);
1782- }
1783- }
1784- }
1785- }
1786- }
1787-
17881716} // namespace realm
0 commit comments