You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kumarUjjawal (via GitHub)" <gi...@apache.org> on 2026/01/09 06:19:06 UTC

[PR] fix: sqllogictest failing in Substrait round-trip mode [datafusion]

kumarUjjawal opened a new pull request, #19707:
URL: https://github.com/apache/datafusion/pull/19707

   ## 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 #16278 .
   - Part of #16248 
   
   ## Rationale for this change
   
   Sqllogictest was failing in Substrait round trip 
   
   ```
   query failed: DataFusion error: This feature is not implemented: Unsupported cast type: FixedSizeList
   ```
   
   <!--
    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?
   
   - Added FixedSizeList support to both producer and consumer 
   types.rs Producer encodes FixedSizeList as Substrait List with variation ref 3 + size. Consumer decodes back when variation ref >= 3.
   
   <!--
   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?
   
   Yes
   
   <!--
   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@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: [PR] fix: sqllogictest failing in Substrait round-trip mode [datafusion]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #19707:
URL: https://github.com/apache/datafusion/pull/19707#issuecomment-4473683491

   Thank you for your contribution. Unfortunately, this pull request is stale because it has been open 60 days with no activity. Please remove the stale label or comment or this will be closed in 7 days.


-- 
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: [PR] fix: sqllogictest failing in Substrait round-trip mode [datafusion]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #19707: fix: sqllogictest failing in Substrait round-trip mode
URL: https://github.com/apache/datafusion/pull/19707


-- 
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: [PR] fix: sqllogictest failing in Substrait round-trip mode [datafusion]

Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on code in PR #19707:
URL: https://github.com/apache/datafusion/pull/19707#discussion_r2677089077


##########
datafusion/substrait/src/variation_const.rs:
##########
@@ -55,6 +55,13 @@ pub const TIME_64_TYPE_VARIATION_REF: u32 = 1;
 pub const DEFAULT_CONTAINER_TYPE_VARIATION_REF: u32 = 0;
 pub const LARGE_CONTAINER_TYPE_VARIATION_REF: u32 = 1;
 pub const VIEW_CONTAINER_TYPE_VARIATION_REF: u32 = 2;
+/// Used for the arrow type [`DataType::FixedSizeList`].
+///
+/// The size of the fixed list is encoded by adding it to this base value.
+/// For example, `FixedSizeList(10)` would use variation reference `3 + 10 = 13`.
+///
+/// [`DataType::FixedSizeList`]: datafusion::arrow::datatypes::DataType::FixedSizeList
+pub const FIXED_SIZE_LIST_TYPE_VARIATION_REF: u32 = 3;

Review Comment:
   Hmm, I didn't think of that. Thanks for pointing that out. 



-- 
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: [PR] fix: sqllogictest failing in Substrait round-trip mode [datafusion]

Posted by "gabotechs (via GitHub)" <gi...@apache.org>.
gabotechs commented on code in PR #19707:
URL: https://github.com/apache/datafusion/pull/19707#discussion_r2676833472


##########
datafusion/substrait/src/variation_const.rs:
##########
@@ -55,6 +55,13 @@ pub const TIME_64_TYPE_VARIATION_REF: u32 = 1;
 pub const DEFAULT_CONTAINER_TYPE_VARIATION_REF: u32 = 0;
 pub const LARGE_CONTAINER_TYPE_VARIATION_REF: u32 = 1;
 pub const VIEW_CONTAINER_TYPE_VARIATION_REF: u32 = 2;
+/// Used for the arrow type [`DataType::FixedSizeList`].
+///
+/// The size of the fixed list is encoded by adding it to this base value.
+/// For example, `FixedSizeList(10)` would use variation reference `3 + 10 = 13`.
+///
+/// [`DataType::FixedSizeList`]: datafusion::arrow::datatypes::DataType::FixedSizeList
+pub const FIXED_SIZE_LIST_TYPE_VARIATION_REF: u32 = 3;

Review Comment:
   This is a smart way of representing the size of a list!
   
   However, I imagine this can easily backfire in the future if different type variation refs are needed for lists, as this approach eliminates the option to add new ones.
   
   I see two possible paths forward:
   1. Convince the Substrait community that adding a new FixedSizeList type to the Substrait specification is worth it. There's an open issue about this https://github.com/substrait-io/substrait/issues/873
   2. Implement this as a user defined type, same as what we did for Float16: https://github.com/apache/datafusion/blob/main/datafusion/substrait/src/logical_plan/producer/types.rs#L111-L120



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