@Test public void testCharAsString() throws Exception { TestUtils.assertMemoryLeak(() -> { try (TableModel model = new TableModel( configuration, "char_test", PartitionBy.NONE ).col("cc", ColumnType.STRING)) { CairoTestUtils.create(model); } char[] data = {'a', 'b', 'f', 'g'}; try (TableWriter writer = new TableWriter(configuration, "char_test")) { for (int i = 0, n = data.length; i < n; i++) { TableWriter.Row r = writer.newRow(); r.putStr(0, data[i]); r.append(); } writer.commit(); } try (TableReader reader = new TableReader(configuration, "char_test")) { final RecordCursor cursor = reader.getCursor(); final Record record = cursor.getRecord(); int index = 0; while (cursor.hasNext()) { Assert.assertTrue(index < data.length); CharSequence value = record.getStr(0); Assert.assertEquals(1, value.length()); Assert.assertEquals(data[index], value.charAt(0)); index++; } } }); }
public TableReaderRecordCursor getCursor() { recordCursor.toTop(); return recordCursor; }
TableReader implements Closeable { public TableReaderRecordCursor getCursor() { recordCursor.toTop(); return recordCursor; } }
TableReader implements Closeable { public TableReaderRecordCursor getCursor() { recordCursor.toTop(); return recordCursor; } TableReader(CairoConfiguration configuration, CharSequence tableName); }
TableReader implements Closeable { public TableReaderRecordCursor getCursor() { recordCursor.toTop(); return recordCursor; } TableReader(CairoConfiguration configuration, CharSequence tableName); static int getPrimaryColumnIndex(int base, int index); double avgDouble(int columnIndex); @Override void close(); void closeColumnForRemove(int columnIndex); void closeColumnForRemove(CharSequence columnName); long floorToPartitionTimestamp(long timestamp); BitmapIndexReader getBitmapIndexReader(int columnBase, int columnIndex, int direction); int getColumnBase(int partitionIndex); TableReaderRecordCursor getCursor(); long getDataVersion(); long getMaxTimestamp(); RecordMetadata getMetadata(); long getMinTimestamp(); long getPageAddressAt(int partitionIndex, long row, int columnIndex); long getPageValueCount(int partitionIndex, long rowLo, long rowHi, int columnIndex); int getPartitionCount(); int getPartitionCountBetweenTimestamps(long partitionTimestamp1, long partitionTimestamp2); int getPartitionedBy(); SymbolMapReader getSymbolMapReader(int columnIndex); String getTableName(); long getVersion(); boolean isOpen(); double maxDouble(int columnIndex); double minDouble(int columnIndex); boolean reload(); void reshuffleSymbolMapReaders(long pTransitionIndex); long size(); double sumDouble(int columnIndex); ReadOnlyColumn getColumn(int absoluteIndex); long getColumnTop(int base, int columnIndex); long openPartition(int partitionIndex); }
TableReader implements Closeable { public TableReaderRecordCursor getCursor() { recordCursor.toTop(); return recordCursor; } TableReader(CairoConfiguration configuration, CharSequence tableName); static int getPrimaryColumnIndex(int base, int index); double avgDouble(int columnIndex); @Override void close(); void closeColumnForRemove(int columnIndex); void closeColumnForRemove(CharSequence columnName); long floorToPartitionTimestamp(long timestamp); BitmapIndexReader getBitmapIndexReader(int columnBase, int columnIndex, int direction); int getColumnBase(int partitionIndex); TableReaderRecordCursor getCursor(); long getDataVersion(); long getMaxTimestamp(); RecordMetadata getMetadata(); long getMinTimestamp(); long getPageAddressAt(int partitionIndex, long row, int columnIndex); long getPageValueCount(int partitionIndex, long rowLo, long rowHi, int columnIndex); int getPartitionCount(); int getPartitionCountBetweenTimestamps(long partitionTimestamp1, long partitionTimestamp2); int getPartitionedBy(); SymbolMapReader getSymbolMapReader(int columnIndex); String getTableName(); long getVersion(); boolean isOpen(); double maxDouble(int columnIndex); double minDouble(int columnIndex); boolean reload(); void reshuffleSymbolMapReaders(long pTransitionIndex); long size(); double sumDouble(int columnIndex); ReadOnlyColumn getColumn(int absoluteIndex); long getColumnTop(int base, int columnIndex); long openPartition(int partitionIndex);  }