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

[GitHub] [arrow-datafusion] jackwener opened a new issue, #6596: Some expression return wrong expression

jackwener opened a new issue, #6596:
URL: https://github.com/apache/arrow-datafusion/issues/6596

   ### Describe the bug
   
   Some expression return wrong expression like.
   
   Internal error: Optimizer rule 'simplify_expressions' failed, due to generate a different schema, original schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name: "array_fill(Int64(11),make_array(Int64(1),Int64(2),Int64(3)))", data_type: List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }, DFField { qualifier: None, field: Field { name: "array_fill(Int64(3),make_array(Int64(2),Int64(3)))", data_type: List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }, DFField { qualifier: None, field: Field { name: "array_fill(Int64(2),make_array(Int64(2)))", data_type: List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_or
 dered: false, metadata: {} } }], metadata: {} }, new schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name: "array_fill(Int64(11),make_array(Int64(1),Int64(2),Int64(3)))", data_type: List(Field { name: "item", data_type: List(Field { name: "item", data_type: List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } }, DFField { qualifier: None, field: Field { name: "array_fill(Int64(3),make_array(Int64(2),Int64(3)))", data_type: List(Field { name: "item", data_type: List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: false, dict_id: 0, dict_is_ordered: false, metadat
 a: {} } }, DFField { qualifier: None, field: Field { name: "array_fill(Int64(2),make_array(Int64(2)))", data_type: List(Field { name: "item", data_type: Int64, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} }), nullable: false, dict_id: 0, dict_is_ordered: false, metadata: {} } }], metadata: {} }. 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
   [SQL] select array_fill(11, make_array(1, 2, 3)), array_fill(3, make_array(2, 3)), array_fill(2, make_array(2));
   
   
   ### To Reproduce
   
   #6595
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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

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


[GitHub] [arrow-datafusion] alamb commented on issue #6596: simplify_expressions return expression with wrong type.

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

   FWIW the `date_trunc` issue from https://github.com/apache/arrow-datafusion/issues/6596#issuecomment-1582112533 is tracked  in https://github.com/apache/arrow-datafusion/issues/6623


-- 
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 issue #6596: simplify_expressions return expression with wrong type.

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

   ```sql
   SELECT DATE_TRUNC('MINUTE', TIMESTAMP '2022-08-03 14:38:50Z');
   
   "Projection: date_trunc(Utf8("MINUTE"), CAST(Utf8("2022-08-03 14:38:50Z") AS Timestamp(Nanosecond, None)))
     EmptyRelation"
   -->
   "Projection: TimestampSecond(1659537480, None) AS date_trunc(Utf8("MINUTE"),Utf8("2022-08-03 14:38:50Z"))
     EmptyRelation"
   ```
   
   expr type from timestamp nanosecond -> timestamp second.


-- 
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] izveigor commented on issue #6596: simplify_expressions return expression with wrong type.

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

   @jackwener As I understand the main problem is in the `nullable` parameter.
   I think the solution to the problem is https://github.com/apache/arrow-datafusion/issues/6556


-- 
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 issue #6596: simplify_expressions return expression with wrong type.

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

   I already fix bug about type convert.
   There is a bug related with `simplify expression` about `arrays`


-- 
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