Zoltan Borok-Nagy has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/24990 )

Change subject: IMPALA-15460: Read VARIANT object fields stored out of name 
order
......................................................................


Patch Set 2:

(2 comments)

Thanks for the comments!

http://gerrit.cloudera.org:8080/#/c/24990/1/be/src/runtime/variant-value.h
File be/src/runtime/variant-value.h:

http://gerrit.cloudera.org:8080/#/c/24990/1/be/src/runtime/variant-value.h@106
PS1, Line 106: VariantLookupResult
> Why do we need a new enum instead of using NavStatus?
VariantLookupResult is about the encoded data:
- FOUND: there is a value, and it can be variant null
- NOT_FOUND: no such field
- CORRUPT: bytes can't be read.

NavStatus is what variant_get() does with the result:
OK: non-NULL value
SQL_NULL: NULL input, NOT_FOUND, or FOUND variant null
CORRUPT: raise error or warning

So VariantLookupResult stores the result based on VARIANT semantics, and 
NavStatus is about what to return to the SQL user.


http://gerrit.cloudera.org:8080/#/c/24990/1/be/src/runtime/variant-value.cc
File be/src/runtime/variant-value.cc:

http://gerrit.cloudera.org:8080/#/c/24990/1/be/src/runtime/variant-value.cc@291
PS1, Line 291:   uint32_t index;
> I agree that the original code is buggy, but what it writes about Spark is
Updated the commit message.

GetFieldByName() now does a binary search over the object's field ids when it 
has 32 or more fields, and a linear scan below that, like parquet-java and 
Spark, also a fallback if UTF-16 order could interfere.



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ief71d02788a4c830619e6ceaf45ef8eed366411f
Gerrit-Change-Number: 24990
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
Gerrit-Comment-Date: Wed, 07 Oct 2026 12:02:44 +0000
Gerrit-HasComments: Yes

Reply via email to