-
Notifications
You must be signed in to change notification settings - Fork 14
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
Panic on TIMESTAMP-returning queries over HTTP with more than one value #349
Comments
Great job sleuthing a minimal repro 🎉 |
- See splitgraph/seafowl#349 - The workaround is manually casting to text first
The issue originates from a bug in arrow-json v33.0.0 that we're currently on. Namely, what happens is that when iterating over the record batches in In the meantime I can add something along the following lines as a mitigation (could pose a problem for very large outputs as it doubles the size of total record batch rows/columns in memory): @@ -106,11 +107,12 @@ async fn physical_plan_to_json(
context: Arc<DefaultSeafowlContext>,
physical: Arc<dyn ExecutionPlan>,
) -> Result<Vec<u8>, DataFusionError> {
+ let schema_ref = physical.schema();
let batches = context.collect(physical).await?;
let mut buf = Vec::new();
let mut writer = LineDelimitedWriter::new(&mut buf);
writer
- .write_batches(&batches)
+ .write_batches(&[concat_batches(&schema_ref, batches.iter())?])
.map_err(DataFusionError::ArrowError)?;
writer.finish().map_err(DataFusionError::ArrowError)?;
Ok(buf) |
Running this query:
results in a
Trying to access an element at index 1 from a PrimitiveArray of length 1
panic:If I remove the
UNION ALL
or cast the timestamp to text before returning it, the error doesn't happen:The text was updated successfully, but these errors were encountered: