-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Barrage Refactor Read/Write Chunk Factories #6065
base: main
Are you sure you want to change the base?
Conversation
a6ad4c9
to
c4e970d
Compare
c4e970d
to
28b25d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little nervous about the scope, and the willingness to truncate inputs or infer units.
engine/table/src/main/java/io/deephaven/engine/table/impl/QueryTable.java
Outdated
Show resolved
Hide resolved
engine/table/src/main/java/io/deephaven/engine/table/impl/sources/ReinterpretUtils.java
Show resolved
Hide resolved
@@ -18,7 +20,56 @@ | |||
/** | |||
* Consumes Flight/Barrage streams and transforms them into WritableChunks. | |||
*/ | |||
public interface ChunkReader { | |||
public interface ChunkReader<ReadChunkType extends WritableChunk<Values>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We wondered if you could make the bound looser, e.g. PoolableChunk
or SafeCloseable
. Looks like maybe not? Should PoolableChunk
be a Chunk
(it's not right now)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need these to return the Chunks to support usages such as LongChunkReader#transformTo
. Since ownership is also being passed, it is best to advertise that they're WritableChunk
s.
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ChunkReader.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private static long factorForTimeUnit(final TimeUnit unit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ryan's placeholder.
flakiness (#9948)"
…Time64 to ColumnSource
extensions/flight-sql/src/main/java/io/deephaven/server/flightsql/FlightSqlResolver.java
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BaseChunkWriter.java
Outdated
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ChunkWriter.java
Outdated
Show resolved
Hide resolved
...sions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BigDecimalChunkWriter.java
Outdated
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BooleanChunkWriter.java
Outdated
Show resolved
Hide resolved
...rage/src/main/java/io/deephaven/extensions/barrage/chunk/array/ByteArrayExpansionKernel.java
Show resolved
Hide resolved
...ge/src/main/java/io/deephaven/extensions/barrage/chunk/vector/ByteVectorExpansionKernel.java
Show resolved
Hide resolved
...e/src/main/java/io/deephaven/extensions/barrage/chunk/array/BooleanArrayExpansionKernel.java
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/MapChunkWriter.java
Outdated
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/util/BarrageUtil.java
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkReaderFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkReaderFactory.java
Outdated
Show resolved
Hide resolved
final float value = src.get(ii); | ||
dst.set(dstOffset + ii, value == QueryConstants.NULL_FLOAT | ||
? null | ||
: BigInteger.valueOf((long) value)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The long conversion in the middle here is causing us to truncate things inappropriately. I think you need to do a BigDecimal.valueOf followed by a toBigInteger. Same for double. For the Float16, we should be safe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. I wonder why the random tests never pick a value that hit the early truncation. Maybe my equality tolerance is too loose?
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkWriterFactory.java
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkReaderFactory.java
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkReaderFactory.java
Outdated
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkReaderFactory.java
Show resolved
Hide resolved
...s/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/DefaultChunkReaderFactory.java
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/BooleanChunkReader.java
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ByteChunkReader.java
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/ListChunkWriter.java
Show resolved
Hide resolved
extensions/barrage/src/main/java/io/deephaven/extensions/barrage/chunk/MapChunkWriter.java
Show resolved
Hide resolved
@@ -0,0 +1,74 @@ | |||
// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't get hit in the Java test, but presumably it is fine because we are exercising it with C++ tests on each nightly build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are explicit unit tests for this; just not in the type-cross sectional use. (FlightMessageRoundTripTest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an overhaul of type mapping from arrow to deephaven columns. We can now coerce from many kinds of types, enabling widening / truncating and conversion between types. For example uint64_t is now mapped to BigInteger by default, but can be explicitly mapped to
long.class
(may overflow).To set an explicit mapping set the attribute "deephaven:type" to the canonical name of the class.
Fixes #58 (custom type serialization / deserialization).
Fixes #936 (ColumnConversionModes is being replaced with easy to integrate custom serialization).
Fixes #2984 (refactoring has good interface documentation).
Fixes #3403 (by supporting a variety of mappings, these now must match client wiring).
Fixes #5258 (snapshot/subscribe methods with default w2w options).
Fixes #5453 (support other Timestamp arrow wire encodings).
Fixes #5864 (support for uint64_t).
Fixes #6114 (supports ObjectVector properly).
nightlies: https://github.com/nbauernfeind/deephaven-core/actions/runs/13208235220/