Skip to content

Commit

Permalink
Merge branch 'branch-24.12' into json-quote-char-parsing-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shrshi authored Oct 30, 2024
2 parents 3784be9 + 5ee7d7c commit f351242
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions cpp/doxygen/developer_guide/DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,17 @@ struct, and therefore `cudf::struct_view` is the data type of a `cudf::column` o

`cudf::type_dispatcher` dispatches to the `struct_view` data type when invoked on a `STRUCT` column.

# Empty Columns

The libcudf columns support empty, typed content. These columns have no data and no validity mask.
Empty strings or lists columns may or may not contain a child offsets column.
It is undefined behavior (UB) to access the offsets child of an empty strings or lists column.
Nested columns like lists and structs may require other children columns to provide the
nested structure of the empty types.

Use `cudf::make_empty_column()` to create fixed-width and strings columns.
Use `cudf::empty_like()` to create an empty column from an existing `cudf::column_view`.

# cuIO: file reading and writing

cuIO is a component of libcudf that provides GPU-accelerated reading and writing of data file
Expand Down
6 changes: 4 additions & 2 deletions java/src/main/java/ai/rapids/cudf/HostMemoryBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,16 +255,18 @@ public final void copyFromHostBuffer(long destOffset, HostMemoryBuffer srcData,
* @param destOffset offset in bytes in this buffer to start copying to
* @param in input stream to copy bytes from
* @param byteLength number of bytes to copy
* @throws EOFException If there are not enough bytes in the stream to copy.
* @throws IOException If there is an error reading from the stream.
*/
final void copyFromStream(long destOffset, InputStream in, long byteLength) throws IOException {
public final void copyFromStream(long destOffset, InputStream in, long byteLength) throws IOException {
addressOutOfBoundsCheck(address + destOffset, byteLength, "copy from stream");
byte[] arrayBuffer = new byte[(int) Math.min(1024 * 128, byteLength)];
long left = byteLength;
while (left > 0) {
int amountToCopy = (int) Math.min(arrayBuffer.length, left);
int amountRead = in.read(arrayBuffer, 0, amountToCopy);
if (amountRead < 0) {
throw new EOFException();
throw new EOFException("Unexpected end of stream, expected " + left + " more bytes");
}
setBytes(destOffset, arrayBuffer, 0, amountRead);
destOffset += amountRead;
Expand Down

0 comments on commit f351242

Please sign in to comment.