Wenzhe Zhou has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17168
Change subject: WIP IMPALA-10564: Return error when inserting an overflowed decimal value ...................................................................... WIP IMPALA-10564: Return error when inserting an overflowed decimal value When using CTAS statements or INSERT-SELECT statements to insert rows to table with decimal columns, Impala insert NULL for overflowed decimal values, instead of returning error. This issue happens when the data expression for the decimal column in SELECT sub-query consists at least one alias. This issue is similar as IMPALA-6340, but IMPALA-6340 only fixed the issue for the cases with the data expression for the decimal columns as constants so that the overflowed decimal values could be detected by frontend during expression analysis. If there is an alias (variable) in the data expression for the decimal column, only backend could detect decimal overflow. This patch added checking for the error status of ScalarExprEvaluator in TableWriter when ScalarExprEvaluator return NULL for decimal column. If there is an error, the query will be failed without inserting NULL for decimal column. Tests: - Manually ran queries with overflowed decimal values by using CTAS and INSERT-SELECT statements. Verified that queries failed as expected. - TODO: add unit-test. Change-Id: I64ce4ed194af81ef06401ffc1124e12f05b8da98 --- M be/src/exec/hdfs-text-table-writer.cc M be/src/exec/parquet/hdfs-parquet-table-writer.cc 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/68/17168/1 -- To view, visit http://gerrit.cloudera.org:8080/17168 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I64ce4ed194af81ef06401ffc1124e12f05b8da98 Gerrit-Change-Number: 17168 Gerrit-PatchSet: 1 Gerrit-Owner: Wenzhe Zhou <wz...@cloudera.com> Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com> Gerrit-Reviewer: Thomas Tauber-Marshall <tmarsh...@cloudera.com>