You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Daniel Vanko (Code Review)" <ge...@cloudera.org> on 2026/09/25 18:09:56 UTC

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Daniel Vanko has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24950


Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................

IMPALA-15411: Add is_valid_utf8() builtin

IMPALA-12675 turned on UTF-8 validation on the Parquet write path, so an
INSERT or CTAS writing non-UTF-8 bytes into an annotated STRING column
fails with PARQUET_INVALID_UTF8_STRING. The error points at one byte,
but there was no way to find which rows are affected.

is_valid_utf8(STRING) -> BOOLEAN closes that gap:

  SELECT * FROM t WHERE NOT is_valid_utf8(s);

It calls impala::IsValidUtf8(), the same simdutf-based primitive the
Parquet writer uses, so it accepts exactly what the write path accepts.
It validates bytes, not characters, so the result does not depend on
UTF8_MODE. NULL returns NULL, the empty string is valid.

The error message and the incompatible-changes note now name it.

Testing:
 - extended Utf8Test
 - added is_valid_utf8() call and error message check to e2e test

Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Assisted-by: Claude Opus 5 (Claude Code)
---
M be/src/exprs/expr-test.cc
M be/src/exprs/string-functions-ir.cc
M be/src/exprs/string-functions.h
M common/function-registry/impala_functions.py
M common/thrift/generate_error_codes.py
M docs/topics/impala_incompatible_changes.xml
M docs/topics/impala_string_functions.xml
M tests/query_test/test_scanners.py
8 files changed, 72 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/50/24950/1
-- 
To view, visit http://gerrit.cloudera.org:8080/24950
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 1:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/14160/ DRY_RUN=true


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Sep 2026 08:15:15 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 1: Verified-1

Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/14156/


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Sat, 26 Sep 2026 04:22:46 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 2: Code-Review+2


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 05:51:28 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 1: Code-Review+2

LGTM!


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 05:51:13 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 1:

Build failed: https://jenkins.impala.io/job/gerrit-verify-dryrun/14160/


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Mon, 28 Sep 2026 17:07:54 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 2:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/14167/ DRY_RUN=false


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 05:51:29 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 2: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 2
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Comment-Date: Tue, 29 Sep 2026 10:28:58 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................


Patch Set 1:

Build started: https://jenkins.impala.io/job/gerrit-verify-dryrun/14156/ DRY_RUN=true


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Fri, 25 Sep 2026 18:22:33 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-15411: Add is valid utf8() builtin

Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24950 )

Change subject: IMPALA-15411: Add is_valid_utf8() builtin
......................................................................

IMPALA-15411: Add is_valid_utf8() builtin

IMPALA-12675 turned on UTF-8 validation on the Parquet write path, so an
INSERT or CTAS writing non-UTF-8 bytes into an annotated STRING column
fails with PARQUET_INVALID_UTF8_STRING. The error points at one byte,
but there was no way to find which rows are affected.

is_valid_utf8(STRING) -> BOOLEAN closes that gap:

  SELECT * FROM t WHERE NOT is_valid_utf8(s);

It calls impala::IsValidUtf8(), the same simdutf-based primitive the
Parquet writer uses, so it accepts exactly what the write path accepts.
It validates bytes, not characters, so the result does not depend on
UTF8_MODE. NULL returns NULL, the empty string is valid.

The error message and the incompatible-changes note now name it.

Testing:
 - extended Utf8Test
 - added is_valid_utf8() call and error message check to e2e test

Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Assisted-by: Claude Opus 5 (Claude Code)
Reviewed-on: http://gerrit.cloudera.org:8080/24950
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
M be/src/exprs/expr-test.cc
M be/src/exprs/string-functions-ir.cc
M be/src/exprs/string-functions.h
M common/function-registry/impala_functions.py
M common/thrift/generate_error_codes.py
M docs/topics/impala_incompatible_changes.xml
M docs/topics/impala_string_functions.xml
M tests/query_test/test_scanners.py
8 files changed, 72 insertions(+), 2 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia1c8b537bdfc7c35839d53eb43fbe841c71c4a51
Gerrit-Change-Number: 24950
Gerrit-PatchSet: 3
Gerrit-Owner: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Daniel Vanko <dv...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Quanlong Huang <hu...@gmail.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>