Package io.delta.kernel.internal.util
Class InternalUtils
Object
io.delta.kernel.internal.util.InternalUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic intdaysSinceEpoch(Date date) Utility method to get the number of days since epoch this given date is.static <T> Optional<T>getSingularElement(CloseableIterator<T> iter) Utility method to read at most one element from aCloseableIterator.getSingularRow(CloseableIterator<ColumnarBatch> dataIter) Utility method to read at most one row from the given dataColumnarBatchiterator.static longmicrosSinceEpoch(Timestamp timestamp) Utility method to get the number of microseconds since the unix epoch for the given timestamp interpreted in UTC.static PathrelativizePath(Path child, URI root) Relativize the given child path with respect to the given root URI.static ColumnVectorrequireNonNull(ColumnVector vector, int rowId, String columnName) static RowrequireNonNull(Row row, int ordinal, String columnName) static ColumnVectorUtility method to create a singleton stringColumnVectortoLowerCaseSet(Collection<String> set)
-
Method Details
-
getSingularRow
public static Optional<Row> getSingularRow(CloseableIterator<ColumnarBatch> dataIter) throws IOException Utility method to read at most one row from the given dataColumnarBatchiterator. If there is more than one row, an exception will be thrown.- Parameters:
dataIter-- Returns:
- Throws:
IOException
-
getSingularElement
Utility method to read at most one element from aCloseableIterator. If there is more than element row, an exception will be thrown.- Throws:
IOException
-
daysSinceEpoch
Utility method to get the number of days since epoch this given date is. -
microsSinceEpoch
Utility method to get the number of microseconds since the unix epoch for the given timestamp interpreted in UTC. -
singletonStringColumnVector
Utility method to create a singleton stringColumnVector- Parameters:
value- the string element to create the vector with- Returns:
- A
ColumnVectorwith a single elementvalue
-
requireNonNull
-
requireNonNull
-
relativizePath
Relativize the given child path with respect to the given root URI. If the child path is already a relative path, it is returned as is.- Parameters:
child-root- Root directory as URI. Relativization is done with respect to this root. The relativize operation requires conversion to URI, so the caller is expected to convert the root directory to URI once and use it for relativizing for multiple child paths.- Returns:
-
toLowerCaseSet
-