Kontinuation commented on code in PR #92:
URL: https://github.com/apache/sedona-db/pull/92#discussion_r2352715832
##########
rust/sedona/src/context.rs:
##########
@@ -292,9 +292,23 @@ impl SedonaDataFrame for DataFrame {
self,
ctx: &SedonaContext,
limit: Option<usize>,
- options: DisplayTableOptions<'a>,
+ mut options: DisplayTableOptions<'a>,
) -> Result<String> {
- let df = self.limit(0, limit)?;
+ let df = if matches!(
+ self.logical_plan(),
+ LogicalPlan::Explain(_) | LogicalPlan::DescribeTable(_) |
LogicalPlan::Analyze(_)
+ ) {
+ // Show multi-line output without truncation for plans like
`EXPLAIN`
+ options.max_row_height = usize::MAX;
+
+ // We don't want to apply an additional .limit() to plans like
`Explain`
+ // as that will trigger an internal error: Unsupported logical
plan: Explain must be root of the plan
+ self
+ } else {
+ // Apply limit if specified
+ self.limit(0, limit)?
Review Comment:
This approach introduces additional copies, and probably make the code look
worse.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]