public class InternalUtils
extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
daysSinceEpoch(java.sql.Date date)
Utility method to get the number of days since epoch this given date is.
|
static <T> java.util.Optional<T> |
getSingularElement(CloseableIterator<T> iter)
Utility method to read at most one element from a
CloseableIterator. |
static java.util.Optional<Row> |
getSingularRow(CloseableIterator<ColumnarBatch> dataIter)
Utility method to read at most one row from the given data
ColumnarBatch
iterator. |
static ColumnVector |
requireNonNull(ColumnVector vector,
int rowId,
String columnName) |
static Row |
requireNonNull(Row row,
int ordinal,
String columnName) |
static ColumnVector |
singletonStringColumnVector(String value)
Utility method to create a singleton string
ColumnVector |
public static java.util.Optional<Row> getSingularRow(CloseableIterator<ColumnarBatch> dataIter) throws java.io.IOException
ColumnarBatch
iterator. If there is more than one row, an exception will be thrown.dataIter - java.io.IOExceptionpublic static <T> java.util.Optional<T> getSingularElement(CloseableIterator<T> iter) throws java.io.IOException
CloseableIterator.
If there is more than element row, an exception will be thrown.java.io.IOExceptionpublic static int daysSinceEpoch(java.sql.Date date)
public static ColumnVector singletonStringColumnVector(String value)
ColumnVectorvalue - the string element to create the vector withColumnVector with a single element valuepublic static ColumnVector requireNonNull(ColumnVector vector, int rowId, String columnName)