You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "ahirner (via GitHub)" <gi...@apache.org> on 2024/06/02 07:37:18 UTC

[I] Error `NamedStructField should be rewritten in OperatorToFunction with subquery` if query is wrapped in view [datafusion]

ahirner opened a new issue, #10764:
URL: https://github.com/apache/datafusion/issues/10764

   ### Describe the bug
   
   When selecting from a view that selects fields from structs, this error is thrown:
   ```
   Internal error: NamedStructField should be rewritten in OperatorToFunction.
   ```
   
   ### To Reproduce
   
   In datafusion 38.0.0 cli:
   ```
   > create or replace view v as select struct(1, 'b')['c1'];
   0 row(s) fetched.
   Elapsed 0.001 seconds.
   
   > select * from v;
   Internal error: NamedStructField should be rewritten in OperatorToFunction.
   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
   ```
   
   ### Expected behavior
   
   ```
   +--------------------------------+
   | struct(Int64(1),Utf8("b"))[c1] |
   +--------------------------------+
   | b                              |
   +--------------------------------+
   1 row(s) fetched.
   ```
   
   ### Additional context
   
   It errors the same when a subquery is viewed: `create view v as select (select struct(1, 'b')['c1']);`.
   This error appeared once as a regression in 37.0: https://github.com/apache/datafusion/issues/10029


-- 
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@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Error `NamedStructField should be rewritten in OperatorToFunction with subquery` if query is wrapped in view [datafusion]

Posted by "ahirner (via GitHub)" <gi...@apache.org>.
ahirner commented on issue #10764:
URL: https://github.com/apache/datafusion/issues/10764#issuecomment-2156104504

   Can confirm that it's gone for our more complicated use case in `8fcb3e4b`, thus also probably in `0.39`.
   Was or should it be covered in a test? Otherwise feel free to close.


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Error `NamedStructField should be rewritten in OperatorToFunction with subquery` if query is wrapped in view [datafusion]

Posted by "ahirner (via GitHub)" <gi...@apache.org>.
ahirner closed issue #10764: Error `NamedStructField should be rewritten in OperatorToFunction with subquery` if query is wrapped in view
URL: https://github.com/apache/datafusion/issues/10764


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Error `NamedStructField should be rewritten in OperatorToFunction with subquery` if query is wrapped in view [datafusion]

Posted by "sergiimk (via GitHub)" <gi...@apache.org>.
sergiimk commented on issue #10764:
URL: https://github.com/apache/datafusion/issues/10764#issuecomment-2147809643

   Also hit a similar error in a different scenario and can confirm that `master` version fixed it for me.


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org


Re: [I] Error `NamedStructField should be rewritten in OperatorToFunction with subquery` if query is wrapped in view [datafusion]

Posted by "jonahgao (via GitHub)" <gi...@apache.org>.
jonahgao commented on issue #10764:
URL: https://github.com/apache/datafusion/issues/10764#issuecomment-2147028848

   It appears to be successful on the current [main](https://github.com/apache/datafusion/commit/6a0a2dce90fde73d36a5451a59381cd357fae648) branch.
   
   ```sh
   DataFusion CLI v38.0.0
   > create or replace view v as select struct(1, 'b')['c1'];
   0 row(s) fetched.
   Elapsed 0.005 seconds.
   
   > select * from v;
   +--------------------------------+
   | struct(Int64(1),Utf8("b"))[c1] |
   +--------------------------------+
   | b                              |
   +--------------------------------+
   1 row(s) fetched.
   Elapsed 0.006 seconds.
   ```


-- 
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@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org