private bool UpdatePartitionGetIsNull(int partitionID, long localRowID, int nullIndex) { _lastPartitionReader = _tx.Read(partitionID); _lastPartitionID = partitionID; byte[] bitset = ((IBitsetColumn)_lastPartitionReader.ReadColumn(_bitSetColIndex)) .GetValue(localRowID, _tx.ReadCache); return(new ByteArray(bitset).IsSet(nullIndex)); }
public bool IsMatch(IPartitionReader partition, ReadContext readCache, long localRowID) { if (_columnPartition != partition.PartitionID) { _columnPartition = partition.PartitionID; _columnReader = (ITypedColumn <T>)partition.ReadColumn(_column.ColumnID); } var value = _columnReader.Get(localRowID, readCache); return(IsMatch(value)); }
public T?GetNullable <T>(long rowId, int columnIndex) where T : struct { int partitionID = RowIDUtil.ToPartitionIndex(rowId); long localRowID = RowIDUtil.ToLocalRowID(rowId); if (_columnMaps != null) { columnIndex = _columnMaps[columnIndex]; } var nullable = _metadata.GetColumnByID(columnIndex).Nullable; var nullIndex = _metadata.GetColumnByID(columnIndex).NullIndex; if (nullable && _bitSetColIndex != -1) { if (partitionID == _lastPartitionID) { byte[] bitset = ((IBitsetColumn)_lastPartitionReader.ReadColumn(_bitSetColIndex)) .GetValue(localRowID, _tx.ReadCache); if (new ByteArray(bitset).IsSet(nullIndex)) { return(default(T?)); } } else if (UpdatePartitionGetIsNull(partitionID, localRowID, nullIndex)) { return(default(T?)); } } if (partitionID == _lastPartitionID) { return(((ITypedColumn <T>)_lastPartitionReader.ReadColumn(columnIndex)).Get(localRowID, _tx.ReadCache)); } return(UpdatePartition <T>(partitionID, localRowID, columnIndex)); }
private T UpdatePartition <T>(int partitionID, long localRowID, int columnIndex) { _lastPartitionReader = _tx.Read(partitionID); _lastPartitionID = partitionID; return(((ITypedColumn <T>)_lastPartitionReader.ReadColumn(columnIndex)).Get(localRowID, _tx.ReadCache)); }