You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jiangzhx (via GitHub)" <gi...@apache.org> on 2023/05/31 12:06:10 UTC

[GitHub] [arrow-datafusion] jiangzhx opened a new pull request, #6504: fix count_wildcard_rule when alias in subquery

jiangzhx opened a new pull request, #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #6447 .
   
   # Rationale for this change
   
   <!--
    Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.  
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are these changes tested?
   
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are they covered by existing tests)?
   -->
   
   # Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api change` label.
   -->


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jiangzhx commented on pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#issuecomment-1576000950

   @jackwener hope you have time for review.


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jiangzhx commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218278880


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };

Review Comment:
   Yes, this piece of code is indeed difficult to understand and seems strange. However, I haven't found a good solution for it yet.
   
   thanks for your help.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jiangzhx commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218273945


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,7 +97,12 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>

Review Comment:
   fixed,Thank you for your review.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jiangzhx commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1221265307


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };

Review Comment:
   i did some change.hope you have time for review.
   thanks again.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jiangzhx commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218271921


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };
+                        (expr.clone().rewrite(&mut rewriter).unwrap(), new_field)

Review Comment:
   thanks,fixed.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jiangzhx commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jiangzhx (via GitHub)" <gi...@apache.org>.
jiangzhx commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218271921


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };
+                        (expr.clone().rewrite(&mut rewriter).unwrap(), new_field)

Review Comment:
   thanks,fixed.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jackwener commented on pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#issuecomment-1593286630

   This is a more complicated problem. After discussing with @jiangzhx , I will solve this problem later
   
   


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218262864


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };
+                        (expr.clone().rewrite(&mut rewriter).unwrap(), new_field)
+                    })
+                    .unzip();
+            let new_schema = DFSchemaRef::new(
+                DFSchema::new_with_metadata(
+                    new_fields,
+                    projection.schema.metadata().clone(),
+                )
+                .unwrap(),

Review Comment:
   ```suggestion
                   .unwrap(),
   ```
   ```suggestion
                   )?,
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218267325


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };

Review Comment:
   It isn't a good method to resolve this issue.
   IMO, it looks like a `hack` patch to fix issue.



##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };
+                        (expr.clone().rewrite(&mut rewriter).unwrap(), new_field)

Review Comment:
   `unwrap()` isn't a good choice



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jackwener closed pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener closed pull request #6504: fix count_wildcard_rule when alias in subquery
URL: https://github.com/apache/arrow-datafusion/pull/6504


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] r4ntix commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "r4ntix (via GitHub)" <gi...@apache.org>.
r4ntix commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1217974234


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,7 +97,12 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>

Review Comment:
   Other problems can result here, such as:
   ```shell
   DataFusion CLI v25.0.0
   ❯ with tbl as (SELECT count(a) as "COUNT(*)" from (values (1), (2)) as x(a)) SELECT * from tbl;
   Optimizer rule 'push_down_projection' failed
   caused by
   Internal error: replace column failed. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1226040389


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -98,19 +98,35 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
             })))
         }
         LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
-            Ok(Transformed::Yes(LogicalPlan::Projection(
-                Projection::try_new_with_schema(
-                    projection_expr,
-                    projection.input,
-                    // rewrite_schema(projection.schema.clone()),
-                    rewrite_schema(&projection.schema),
-                )?,
-            )))
+            let input = projection

Review Comment:
   ```suggestion
               // resolve issue: https://github.com/apache/arrow-datafusion/issues/6447
               // TODO: In the future, we can systematically solve the problem about `name changes` and then revert these code and other code to resolve this kind of problem.
               let input = projection
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] jackwener commented on a diff in pull request #6504: fix count_wildcard_rule when alias in subquery

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #6504:
URL: https://github.com/apache/arrow-datafusion/pull/6504#discussion_r1218267325


##########
datafusion/optimizer/src/analyzer/count_wildcard_rule.rs:
##########
@@ -97,19 +98,47 @@ fn analyze_internal(plan: LogicalPlan) -> Result<Transformed<LogicalPlan>> {
                 fetch,
             })))
         }
-        LogicalPlan::Projection(projection) => {
-            let projection_expr = projection
-                .expr
-                .iter()
-                .map(|expr| expr.clone().rewrite(&mut rewriter))
-                .collect::<Result<Vec<_>>>()?;
+        LogicalPlan::Projection(projection)
+            if matches!(
+                projection.input.as_ref(),
+                LogicalPlan::Aggregate(..) | LogicalPlan::Window(..)
+            ) =>
+        {
+            let (new_exprs, new_fields): (Vec<_>, Vec<_>) =
+                izip!(projection.expr.iter(), projection.schema.fields().iter())
+                    .map(|(expr, field)| {
+                        let new_field = match expr {
+                            Expr::Alias(_, _) => field.clone(),
+                            _ => {
+                                let mut name = field.field().name().clone();
+                                if name.contains(COUNT_STAR) {
+                                    name = name.replace(
+                                        COUNT_STAR,
+                                        count(lit(COUNT_STAR_EXPANSION))
+                                            .to_string()
+                                            .as_str(),
+                                    );
+                                }
+                                DFField::new(
+                                    field.qualifier().cloned(),
+                                    &name,
+                                    field.data_type().clone(),
+                                    field.is_nullable(),
+                                )
+                            }
+                        };

Review Comment:
   IMO, it looks like a `hack` patch to fix issue. maybe It isn't a good method to resolve this issue.
   I need to think carefully



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org