AshinGau commented on code in PR #18566:
URL: https://github.com/apache/doris/pull/18566#discussion_r1164837191
##########
be/src/vec/exec/vjdbc_connector.cpp:
##########
@@ -692,6 +696,59 @@ Status JdbcConnector::exec_write_sql(const std::u16string&
insert_stmt,
return Status::OK();
}
+Status JdbcConnector::exec_stmt_write(
+ Block* block, const std::vector<vectorized::VExprContext*>&
output_vexpr_ctxs) {
+ SCOPED_TIMER(_result_send_timer);
+ JNIEnv* env = nullptr;
+ RETURN_IF_ERROR(JniUtil::GetJNIEnv(&env));
+
+ // prepare table schema
+ std::ostringstream required_fields;
+ std::ostringstream columns_types;
+ for (int i = 0; i < block->columns(); ++i) {
+ std::string field = block->get_by_position(i).name;
+ std::string type =
JniConnector::get_hive_type(output_vexpr_ctxs[i]->root()->type());
+ if (i == 0) {
+ required_fields << field;
+ columns_types << type;
+ } else {
+ required_fields << "," << field;
+ columns_types << "#" << type;
Review Comment:
JVM will fail and throw `IndexOutOfBounds` exception, so vjdbc_connetor
produces fake names like `_col0, _col1, ...`
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]