You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "AshinGau (via GitHub)" <gi...@apache.org> on 2023/04/11 11:54:17 UTC

[GitHub] [doris] AshinGau opened a new pull request, #18566: [feature](jni) map c++ block to java vector table

AshinGau opened a new pull request, #18566:
URL: https://github.com/apache/doris/pull/18566

   # Proposed changes
   
   Issue Number: close #xxx
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   * [ ] Does it affect the original behavior
   * [ ] Has unit tests been added
   * [ ] Has document been added or modified
   * [ ] Does it need to update dependencies
   * [ ] Is this PR support rollback (If NO, please explain WHY)
   
   ## Further comments
   
   If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
   
   


-- 
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


[GitHub] [doris] AshinGau commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "AshinGau (via GitHub)" <gi...@apache.org>.
AshinGau commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1506620068

   run buildall


-- 
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


[GitHub] [doris] morningman merged pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "morningman (via GitHub)" <gi...@apache.org>.
morningman merged PR #18566:
URL: https://github.com/apache/doris/pull/18566


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1506224509

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] zhangstar333 commented on a diff in pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "zhangstar333 (via GitHub)" <gi...@apache.org>.
zhangstar333 commented on code in PR #18566:
URL: https://github.com/apache/doris/pull/18566#discussion_r1163772903


##########
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:
   Will there be any other effects if it has mistake to split name by ','
   



-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1503254370

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1506556696

   PR approved by anyone and no changes requested.


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1504442236

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1506556597

   PR approved by at least one committer and no changes requested.


-- 
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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1506624741

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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


[GitHub] [doris] AshinGau commented on a diff in pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "AshinGau (via GitHub)" <gi...@apache.org>.
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:
   FE will be failed 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: 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


[GitHub] [doris] AshinGau commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "AshinGau (via GitHub)" <gi...@apache.org>.
AshinGau commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1507857223

   run buildall


-- 
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


[GitHub] [doris] AshinGau commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "AshinGau (via GitHub)" <gi...@apache.org>.
AshinGau commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1506226890

   run buildall


-- 
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


[GitHub] [doris] AshinGau commented on a diff in pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "AshinGau (via GitHub)" <gi...@apache.org>.
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: 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


[GitHub] [doris] github-actions[bot] commented on pull request #18566: [feature](jni) map c++ block to java vector table

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #18566:
URL: https://github.com/apache/doris/pull/18566#issuecomment-1503195162

   clang-tidy review says "All clean, LGTM! :+1:"


-- 
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