You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/05 12:19:41 UTC

[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #8525: [Vectorized][Feature] support query into outfile in vec mode

yiguolei commented on code in PR #8525:
URL: https://github.com/apache/incubator-doris/pull/8525#discussion_r865842460


##########
be/src/exec/parquet_writer.cpp:
##########
@@ -443,9 +480,333 @@ Status ParquetWriterWrapper::_write_one_row(TupleRow* row) {
                 break;
             }
             default: {
-                std::stringstream ss;
-                ss << "unsupported file format: " << _output_expr_ctxs[index]->root()->type().type;
-                return Status::InvalidArgument(ss.str());
+                fmt::memory_buffer err_ss;
+                fmt::format_to(err_ss, "unsupported file format: : {}.",
+                               (*_output_vexpr_ctxs)[index]->root()->type().type);
+                return Status::InvalidArgument(fmt::to_string(err_ss.data()));
+            }
+            }
+        }
+    } catch (const std::exception& e) {
+        LOG(WARNING) << "Parquet write error: " << e.what();
+        return Status::InternalError(e.what());
+    }
+    return Status::OK();
+}
+
+Status ParquetWriterWrapper::_write_one_row(vectorized::Block& block, size_t row) {
+    int num_columns = _output_vexpr_ctxs->size();

Review Comment:
   It's better to write a util method to convert vectorized::Block to arrow::RecordBatch, and then write to file stream block by block.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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