public class FrameWriterUtils extends Object
FrameWriter implementations.| Modifier and Type | Field and Description |
|---|---|
static byte |
NULL_STRING_MARKER |
static byte[] |
NULL_STRING_MARKER_ARRAY |
static String |
RESERVED_FIELD_PREFIX |
| Constructor and Description |
|---|
FrameWriterUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copyByteBufferToMemory(ByteBuffer src,
org.apache.datasketches.memory.WritableMemory dst,
long dstPosition,
int len,
boolean allowNullBytes)
Copies "len" bytes from
src.position() to "dstPosition" in "memory". |
static Set<String> |
findDisallowedFieldNames(RowSignature signature)
Checks the provided signature for any disallowed field names.
|
static List<ByteBuffer> |
getUtf8ByteBuffersFromStringArraySelector(ColumnValueSelector selector)
Retrieves UTF-8 byte buffers from a
ColumnValueSelector, which is expected to be the kind of
selector you get for an ARRAY<STRING> column. |
static List<ByteBuffer> |
getUtf8ByteBuffersFromStringSelector(DimensionSelector selector,
boolean multiValue)
Retrieves UTF-8 byte buffers from a
DimensionSelector, which is expected to be the kind of
selector you get for an STRING column. |
static RowSignature |
replaceUnknownTypesWithNestedColumns(RowSignature rowSignature) |
static void |
verifySortColumns(List<KeyColumn> keyColumns,
RowSignature signature)
Verifies whether the provided sortColumns are all sortable, and are a prefix of the signature.
|
static long |
writeFrameHeader(org.apache.datasketches.memory.WritableMemory memory,
long startPosition,
FrameType frameType,
long totalSize,
int numRows,
int numRegions,
boolean permuted)
Writes a frame header to a memory locations.
|
public static final byte NULL_STRING_MARKER
public static final byte[] NULL_STRING_MARKER_ARRAY
public static final String RESERVED_FIELD_PREFIX
public static long writeFrameHeader(org.apache.datasketches.memory.WritableMemory memory,
long startPosition,
FrameType frameType,
long totalSize,
int numRows,
int numRegions,
boolean permuted)
public static List<ByteBuffer> getUtf8ByteBuffersFromStringSelector(DimensionSelector selector, boolean multiValue)
DimensionSelector, which is expected to be the kind of
selector you get for an STRING column.
Null strings are returned as NULL_STRING_MARKER_ARRAY.selector - the selectormultiValue - if true, return an array that corresponds exactly to DimensionSelector.getRow().
if false, always return a single-valued array. In particular, this means [] is
returned as [NULL_STRING_MARKER_ARRAY].public static List<ByteBuffer> getUtf8ByteBuffersFromStringArraySelector(ColumnValueSelector selector)
ColumnValueSelector, which is expected to be the kind of
selector you get for an ARRAY<STRING> column.
Null strings are returned as NULL_STRING_MARKER_ARRAY.public static Set<String> findDisallowedFieldNames(RowSignature signature)
public static void verifySortColumns(List<KeyColumn> keyColumns, RowSignature signature)
IllegalArgumentException - if there is a problempublic static void copyByteBufferToMemory(ByteBuffer src, org.apache.datasketches.memory.WritableMemory dst, long dstPosition, int len, boolean allowNullBytes)
src.position() to "dstPosition" in "memory". Does not update the position of src.InvalidNullByteException - if "allowNullBytes" is false and a null byte is encounteredpublic static RowSignature replaceUnknownTypesWithNestedColumns(RowSignature rowSignature)
Copyright © 2011–2023 The Apache Software Foundation. All rights reserved.