You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Daniel Becker (Jira)" <ji...@apache.org> on 2022/10/07 15:01:00 UTC
[jira] [Commented] (IMPALA-11643) Implement ColumnType::ToIR() for non-scalar types
[ https://issues.apache.org/jira/browse/IMPALA-11643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17614117#comment-17614117 ]
Daniel Becker commented on IMPALA-11643:
----------------------------------------
The reason why structs are not supported is that information about the children is stored in std::vectors, which are difficult to deal with in LLVM code. As the layout of std::vector depends on the compiler and can change (and is also quite complicated), we shouldn't touch it from hand-crafted LLVM code directly, only through IR functions (functions compiled from C++ to LLVM).
A possible solution is to add an IR function that takes a ColumnType* and inserts an element into its vectors. We could construct the non-vector parts of ColumnType in LLVM as we do now, then call this function from hand-crafted LLVM code repeatedly to insert the necessary elements into the vectors.
However, the resulting value is no longer an llvm::ConstantStruct*, which is the return type of ColumnType::ToIR(). Some callers depend on the result being a constant, so we can't change the return type in these cases.
A solution is to have two functions: one that returns a constant and is only valid for non-struct types, and a general function that supports all types and returns llvm::Value*. Creating a function that supports all types and returns a constant is not possible in my opinion without meddling with the internals of std::vector from LLVM code.
This is in a way just moving the problem a bit further as we still end up with a function that only supports scalar types. On the other hand, we would have full support for converting ColumnType objects to LLVM in the cases where constantness is not needed.
> Implement ColumnType::ToIR() for non-scalar types
> -------------------------------------------------
>
> Key: IMPALA-11643
> URL: https://issues.apache.org/jira/browse/IMPALA-11643
> Project: IMPALA
> Issue Type: Improvement
> Components: Backend
> Reporter: Daniel Becker
> Assignee: Daniel Becker
> Priority: Minor
> Labels: codegen
>
> Currently ColumnType::ToIR() is only implemented for scalar types. It should be extended to support all types.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org