Arnab Karmakar has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/25062 )

Change subject: IMPALA-15141 (part 2): Codegen expressions that involve VARIANT
......................................................................


Patch Set 1:

(7 comments)

Thanks for working on this!

http://gerrit.cloudera.org:8080/#/c/25062/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/25062/1//COMMIT_MSG@36
PS1, Line 36: TOP-N and
            : UNION ALL nodes
nit: CTE Consumer nodes would also right?


http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/codegen/codegen-anyval.cc
File be/src/codegen/codegen-anyval.cc:

http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/codegen/codegen-anyval.cc@197
PS1, Line 197:     llvm::Type* sret_type = fn->getParamStructRetType(0);
             :     bool returns_variant = sret_type != nullptr && 
IsUnloweredValType(sret_type)
             :         && sret_type->getStructName() == LLVM_VARIANTVAL_NAME;
Can we simplify the helper with?

```
auto* sret_struct = 
llvm::dyn_cast_or_null<llvm::StructType>(fn->getParamStructRetType(0));
bool returns_variant = sret_struct != nullptr && sret_struct->hasName() && 
sret_struct->getName() == LLVM_VARIANTVAL_NAME;
```


http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/codegen/llvm-codegen.cc
File be/src/codegen/llvm-codegen.cc:

http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/codegen/llvm-codegen.cc@895
PS1, Line 895:   if (fn.binary_type == TFunctionBinaryType::NATIVE
I think every VARIANT builtin takes the IR-module path and the changes in the 
NATIVE path are unreachable.


http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/exprs/slot-ref.h
File be/src/exprs/slot-ref.h:

http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/exprs/slot-ref.h@108
PS1, Line 108:   CodegenAnyVal CodegenVariantValue(LlvmCodeGen* codegen, 
LlvmBuilder* builder,
Since we cant include the header file in slot-ref-ir.cc, in case the signatures 
ever drift apart, we wont get any compile error. Would adding a small llvm-free 
header just for this declaration be good?


http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/runtime/fragment-state.cc
File be/src/runtime/fragment-state.cc:

http://gerrit.cloudera.org:8080/#/c/25062/1/be/src/runtime/fragment-state.cc@247
PS1, Line 247: ScalarExprIsWithinStruct
nit: The method name is somewhat misleading as it now also covers the 
metadata/value children of VARIANT.


http://gerrit.cloudera.org:8080/#/c/25062/1/tests/query_test/test_iceberg.py
File tests/query_test/test_iceberg.py:

http://gerrit.cloudera.org:8080/#/c/25062/1/tests/query_test/test_iceberg.py@2729
PS1, Line 2729: testdata/bin/generate-iceberg-v3-variant-formats.java
This is from part 1 but this file doesn't exist.


http://gerrit.cloudera.org:8080/#/c/25062/1/tests/query_test/test_iceberg.py@2756
PS1, Line 2756: pytest.skip("Codegen-specific test")
nit: Not sure if its worth it but a matrix constraint would stop the vectors 
from being generated at all.



--
To view, visit http://gerrit.cloudera.org:8080/25062
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I08c6a4e9a4b6759276da1340d91ac0606f8b1419
Gerrit-Change-Number: 25062
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Balazs Hevele <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Comment-Date: Mon, 12 Oct 2026 09:27:23 +0000
Gerrit-HasComments: Yes

Reply via email to