Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-11 Thread via GitHub
jonahgao commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2651214933 > Computing a schema for a wildcard differs from expanding the actual expressions that match the wildcard I think their logic is basically the same, otherwise there would

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-11 Thread via GitHub
findepi commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2650821795 > but some users do not want the casts introduced by `TypeCoercion` This is very broad statement. I don't like the DataFusion coercion logic per se because it has bugs (

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-10 Thread via GitHub
jayzhan211 commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2649641630 > Since `exprlist_to_fields` is called in the builder, it seems that wildcard expansion still hasn't been delayed. Computing schema for wildcard is different from expan

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-10 Thread via GitHub
jayzhan211 commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2649605687 > but some users do not want the casts introduced by `TypeCoercion` We can make it optional -- This is an automated message from the Apache Git Service. To respond to

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-10 Thread via GitHub
jonahgao commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2648181791 > Should we move `TypeCoercion` into builder 🤔 ? I also thought about that, but some users do not want the casts introduced by `TypeCoercion`. See https://github.co

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-10 Thread via GitHub
findepi commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2648109414 I appreciate the conciseness of representing all columns of a table with a wildcard. This doesn't change the fact that `Expr::Wildcard` is not an expression. If there are a

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-09 Thread via GitHub
jayzhan211 commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2646822350 > That could potentially unlock removing Expr::Wildcard. It's not really an expression (just like Expr::Alias isn't https://github.com/apache/datafusion/issues/1468 and Sort

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-09 Thread via GitHub
jayzhan211 commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2646820171 > > Hmm, my immediate thought here is that if we cannot guarantee correctly coerced inputs during the first pass, then it's probably not worth attempting to coerce in the bui

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-09 Thread via GitHub
goldmedal commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2646780333 > Since `exprlist_to_fields` is called in the builder, it seems that wildcard expansion still hasn't been delayed. > I see. I think we can revert the change https://gith

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-08 Thread via GitHub
jonahgao commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2645780946 > Hmm, my immediate thought here is that if we cannot guarantee correctly coerced inputs during the first pass, then it's probably not worth attempting to coerce in the builder

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-08 Thread via GitHub
jonahgao commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2645778218 > The original discussion about wildcard expansion is [#11639 (comment)](https://github.com/apache/datafusion/issues/11639#issuecomment-2250895868). It's used to delay the wild

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-07 Thread via GitHub
goldmedal commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2644487765 > Perhaps [@goldmedal](https://github.com/goldmedal) have some thoughts on it. The original discussion about wildcard expansion is https://github.com/apache/datafusion/

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-07 Thread via GitHub
rkrishn7 commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2644143759 +1 on moving `ExpandWildcardRule`! > We might need to perform union coercion twice: once in the builder, and once in TypeCoercion(after coercion of exprs). Hmm, my

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-07 Thread via GitHub
findepi commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2643654770 > I also think it's necessary to move the `ExpandWildcardRule` to the builder. That would be great! That could potentially unlock removing `Expr::Wildcard`. It's no

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-07 Thread via GitHub
jonahgao commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2643116010 I also think it's necessary to move the `ExpandWildcardRule` to the builder. This helps to solve the current problem. We won't need to perform wildcard expansion when [computin

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-07 Thread via GitHub
jonahgao commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2643083761 We need to rely on the `TypeCoercion` analyzer rule to obtain the correct schema of union inputs. See #11961 for some details. We might need to perform union coercion twi

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-06 Thread via GitHub
findepi commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2639110011 You have good point about the wildcards > is there benefit to producing a plan that has a correct schema but may have non-coerced input plans? i don't think there

Re: [I] Create UNION plan node with correct schema [datafusion]

2025-02-05 Thread via GitHub
rkrishn7 commented on issue #14380: URL: https://github.com/apache/datafusion/issues/14380#issuecomment-2638760053 Hello @findepi! I'd be happy to work on this. I believe it's as simple as shifting union schema coercion from the analyzer to logical plan building. However, since