You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org> on 2024/11/28 19:19:34 UTC

[Impala-ASF-CR] IMPALA-13589: SELECT INPUT FILE NAME can crash Impala

Zoltan Borok-Nagy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/22141


Change subject: IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala
......................................................................

IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala

If the user only queries virtual column INPUT__FILE__NAME
from a table backed by text files, and the last row doesn't
end with the row delimiter (e.g. '\n') then Impala crashes.

In HdfsTextScanner::FinishScanRange() there is specific code
to deal with the last row if it doesn't end with the row
delimiter, and we fill the last tuple here. This code wasn't active
when we only read INPUT__FILE__NAME, which means the last
tuple contained garbage which caused a segfault later.

The fix is to always fill the last tuple if we have a template
tuple as it means we either have partition expressions, or
file-level virtual columns like INPUT__FILE__NAME.

Other file-level virtual columns only apply to Iceberg tables
which don't support text data files, so those are not affected
by this bug.

Testing
 * added e2e tests

Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
---
M be/src/exec/text/hdfs-text-scanner.cc
M testdata/workloads/functional-query/queries/QueryTest/virtual-column-input-file-name-in-table.test
M testdata/workloads/functional-query/queries/QueryTest/virtual-column-input-file-name.test
3 files changed, 46 insertions(+), 1 deletion(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Gerrit-Change-Number: 22141
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>

[Impala-ASF-CR] IMPALA-13589: SELECT INPUT FILE NAME can crash Impala

Posted by "Gabor Kaszab (Code Review)" <ge...@cloudera.org>.
Gabor Kaszab has posted comments on this change. ( http://gerrit.cloudera.org:8080/22141 )

Change subject: IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala
......................................................................


Patch Set 2: Code-Review+2


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Gerrit-Change-Number: 22141
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Gabor Kaszab <ga...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Mon, 02 Dec 2024 13:58:14 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13589: SELECT INPUT FILE NAME can crash Impala

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

Change subject: IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala
......................................................................


Patch Set 2: Verified+1


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Gerrit-Change-Number: 22141
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Fri, 29 Nov 2024 00:48:08 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13589: SELECT INPUT FILE NAME can crash Impala

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

Change subject: IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala
......................................................................


Patch Set 1:

Build Successful 

https://jenkins.impala.io/job/gerrit-code-review-checks/17608/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Gerrit-Change-Number: 22141
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Thu, 28 Nov 2024 19:48:43 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13589: SELECT INPUT FILE NAME can crash Impala

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

Change subject: IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala
......................................................................


Patch Set 2:

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


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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Gerrit-Change-Number: 22141
Gerrit-PatchSet: 2
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Comment-Date: Thu, 28 Nov 2024 19:20:16 +0000
Gerrit-HasComments: No

[Impala-ASF-CR] IMPALA-13589: SELECT INPUT FILE NAME can crash Impala

Posted by "Zoltan Borok-Nagy (Code Review)" <ge...@cloudera.org>.
Zoltan Borok-Nagy has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/22141 )

Change subject: IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala
......................................................................

IMPALA-13589: SELECT INPUT__FILE__NAME can crash Impala

If the user only queries virtual column INPUT__FILE__NAME
from a table backed by text files, and the last row doesn't
end with the row delimiter (e.g. '\n') then Impala crashes.

In HdfsTextScanner::FinishScanRange() there is specific code
to deal with the last row if it doesn't end with the row
delimiter, and we fill the last tuple here. This code wasn't active
when we only read INPUT__FILE__NAME, which means the last
tuple contained garbage which caused a segfault later.

The fix is to always fill the last tuple if we have a template
tuple as it means we either have partition expressions, or
file-level virtual columns like INPUT__FILE__NAME.

Other file-level virtual columns only apply to Iceberg tables
which don't support text data files, so those are not affected
by this bug.

Testing
 * added e2e tests

Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Reviewed-on: http://gerrit.cloudera.org:8080/22141
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Gabor Kaszab <ga...@cloudera.com>
---
M be/src/exec/text/hdfs-text-scanner.cc
M testdata/workloads/functional-query/queries/QueryTest/virtual-column-input-file-name-in-table.test
M testdata/workloads/functional-query/queries/QueryTest/virtual-column-input-file-name.test
3 files changed, 46 insertions(+), 1 deletion(-)

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

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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0ea8e7fed77cbc9ae90a858eafeee9dcfd73d143
Gerrit-Change-Number: 22141
Gerrit-PatchSet: 3
Gerrit-Owner: Zoltan Borok-Nagy <bo...@cloudera.com>
Gerrit-Reviewer: Gabor Kaszab <ga...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Zoltan Borok-Nagy <bo...@cloudera.com>