This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch branch-1.2-lts
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-1.2-lts by this push:
     new db793e256b7 [fix](Outfile) Fix exporting cast expression issue (#25750)
db793e256b7 is described below

commit db793e256b72e793b7c344be3dd1732b9250edf9
Author: Tiewei Fang <43782773+bepppo...@users.noreply.github.com>
AuthorDate: Tue Oct 24 00:19:46 2023 +0800

    [fix](Outfile) Fix exporting cast expression issue (#25750)
---
 be/src/vec/runtime/vfile_result_writer.cpp |  2 +-
 be/src/vec/runtime/vorc_writer.cpp         | 16 ++++++++++------
 be/src/vec/runtime/vparquet_writer.cpp     | 13 ++++++++-----
 3 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/be/src/vec/runtime/vfile_result_writer.cpp 
b/be/src/vec/runtime/vfile_result_writer.cpp
index 93b60bc1bf2..b239ad0d541 100644
--- a/be/src/vec/runtime/vfile_result_writer.cpp
+++ b/be/src/vec/runtime/vfile_result_writer.cpp
@@ -207,7 +207,7 @@ Status VFileResultWriter::append_block(Block& block) {
         return status;
     }
     if (_vfile_writer) {
-        _write_file(output_block);
+        RETURN_IF_ERROR(_write_file(output_block));
     } else {
         RETURN_IF_ERROR(_write_csv_file(output_block));
     }
diff --git a/be/src/vec/runtime/vorc_writer.cpp 
b/be/src/vec/runtime/vorc_writer.cpp
index 4129a868310..b98de180e40 100644
--- a/be/src/vec/runtime/vorc_writer.cpp
+++ b/be/src/vec/runtime/vorc_writer.cpp
@@ -267,11 +267,15 @@ Status VOrcWriterWrapper::write(const Block& block) {
         for (size_t i = 0; i < block.columns(); i++) {
             auto& raw_column = block.get_by_position(i).column;
             auto nullable = raw_column->is_nullable();
-            const auto col = nullable ? reinterpret_cast<const 
ColumnNullable*>(
-                                                
block.get_by_position(i).column.get())
-                                                ->get_nested_column_ptr()
-                                                .get()
-                                      : block.get_by_position(i).column.get();
+            auto column_ptr = 
block.get_by_position(i).column->convert_to_full_column_if_const();
+            doris::vectorized::ColumnPtr column;
+            if (nullable) {
+                column = assert_cast<const 
ColumnNullable&>(*column_ptr).get_nested_column_ptr();
+            } else {
+                column = column_ptr;
+            }
+            auto col = column.get();
+
             auto null_map = nullable && reinterpret_cast<const 
ColumnNullable*>(
                                                 
block.get_by_position(i).column.get())
                                                     ->has_null()
@@ -500,7 +504,7 @@ Status VOrcWriterWrapper::write(const Block& block) {
             }
         }
     } catch (const std::exception& e) {
-        LOG(WARNING) << "Parquet write error: " << e.what();
+        LOG(WARNING) << "Orc write error: " << e.what();
         return Status::InternalError(e.what());
     }
     root->numElements = sz;
diff --git a/be/src/vec/runtime/vparquet_writer.cpp 
b/be/src/vec/runtime/vparquet_writer.cpp
index 4a80d65c7b0..76ce4e29658 100644
--- a/be/src/vec/runtime/vparquet_writer.cpp
+++ b/be/src/vec/runtime/vparquet_writer.cpp
@@ -174,11 +174,14 @@ Status VParquetWriterWrapper::write(const Block& block) {
         for (size_t i = 0; i < block.columns(); i++) {
             auto& raw_column = block.get_by_position(i).column;
             auto nullable = raw_column->is_nullable();
-            const auto col = nullable ? reinterpret_cast<const 
ColumnNullable*>(
-                                                
block.get_by_position(i).column.get())
-                                                ->get_nested_column_ptr()
-                                                .get()
-                                      : block.get_by_position(i).column.get();
+            auto column_ptr = 
block.get_by_position(i).column->convert_to_full_column_if_const();
+            doris::vectorized::ColumnPtr column;
+            if (nullable) {
+                column = assert_cast<const 
ColumnNullable&>(*column_ptr).get_nested_column_ptr();
+            } else {
+                column = column_ptr;
+            }
+            auto col = column.get();
             auto null_map = nullable && reinterpret_cast<const 
ColumnNullable*>(
                                                 
block.get_by_position(i).column.get())
                                                     ->has_null()


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to