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/10/21 07:15:13 UTC

[GitHub] [doris] BePPPower opened a new pull request, #13546: [feature-wip](new-scan) support Json reader

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

   # Proposed changes
   
   Issue Number: close #12574
   This pr adds `NewJsonReader` which implements GenericReader interface to support read json format file.
   
   TODO:
   1. Rename `NewJsonReader` to `JsonReader` when `JsonReader` is deleted.
   
   ## Problem summary
   
   Describe your changes.
   
   ## Checklist(Required)
   
   1. Does it affect the original behavior: 
       - [ ] Yes
       - [x] No
       - [ ] I don't know
   2. Has unit tests been added:
       - [ ] Yes
       - [x] No
       - [ ] No Need
   3. Has document been added or modified:
       - [ ] Yes
       - [ ] No
       - [x] No Need
   4. Does it need to update dependencies:
       - [ ] Yes
       - [x] No
   5. Are there any changes that cannot be rolled back:
       - [ ] Yes (If Yes, please explain WHY)
       - [x] No
   
   ## 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] morningman merged pull request #13546: [feature-wip](new-scan) support Json reader

Posted by GitBox <gi...@apache.org>.
morningman merged PR #13546:
URL: https://github.com/apache/doris/pull/13546


-- 
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] BePPPower commented on a diff in pull request #13546: [feature-wip](new-scan) support Json reader

Posted by GitBox <gi...@apache.org>.
BePPPower commented on code in PR #13546:
URL: https://github.com/apache/doris/pull/13546#discussion_r1002677449


##########
be/src/vec/exec/format/json/new_json_reader.cpp:
##########
@@ -0,0 +1,753 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "vec/exec/format/json/new_json_reader.h"
+
+#include "common/compiler_util.h"
+#include "exec/plain_text_line_reader.h"
+#include "exprs/json_functions.h"
+#include "io/file_factory.h"
+#include "runtime/descriptors.h"
+#include "runtime/runtime_state.h"
+#include "vec/core/block.h"
+#include "vec/exec/scan/vscanner.h"
+namespace doris::vectorized {
+
+NewJsonReader::NewJsonReader(RuntimeState* state, RuntimeProfile* profile, ScannerCounter* counter,
+                             const TFileScanRangeParams& params, const TFileRangeDesc& range,
+                             const std::vector<SlotDescriptor*>& file_slot_descs, bool* scanner_eof)
+        : _state(state),
+          _profile(profile),
+          _counter(counter),
+          _params(params),
+          _range(range),
+          _file_slot_descs(file_slot_descs),
+          _file_reader(nullptr),
+          _file_reader_s(nullptr),
+          _real_file_reader(nullptr),
+          _line_reader(nullptr),
+          _reader_eof(false),
+          _skip_first_line(false),
+          _next_row(0),
+          _total_rows(0),
+          _scanner_eof(scanner_eof) {
+    _file_format_type = _params.format_type;
+
+    _bytes_read_counter = ADD_COUNTER(_profile, "BytesRead", TUnit::BYTES);
+    _read_timer = ADD_TIMER(_profile, "ReadTime");
+    _file_read_timer = ADD_TIMER(_profile, "FileReadTime");
+}
+
+Status NewJsonReader::init_reader() {
+    RETURN_IF_ERROR(_get_range_params());
+
+    LOG(INFO) << "--ftw: strip_out_array" << _strip_outer_array;
+    LOG(INFO) << "--ftw: read_json_by_line" << _read_json_by_line;

Review Comment:
   done



-- 
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 commented on a diff in pull request #13546: [feature-wip](new-scan) support Json reader

Posted by GitBox <gi...@apache.org>.
morningman commented on code in PR #13546:
URL: https://github.com/apache/doris/pull/13546#discussion_r1002499586


##########
be/src/vec/exec/format/json/new_json_reader.cpp:
##########
@@ -0,0 +1,753 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#include "vec/exec/format/json/new_json_reader.h"
+
+#include "common/compiler_util.h"
+#include "exec/plain_text_line_reader.h"
+#include "exprs/json_functions.h"
+#include "io/file_factory.h"
+#include "runtime/descriptors.h"
+#include "runtime/runtime_state.h"
+#include "vec/core/block.h"
+#include "vec/exec/scan/vscanner.h"
+namespace doris::vectorized {
+
+NewJsonReader::NewJsonReader(RuntimeState* state, RuntimeProfile* profile, ScannerCounter* counter,
+                             const TFileScanRangeParams& params, const TFileRangeDesc& range,
+                             const std::vector<SlotDescriptor*>& file_slot_descs, bool* scanner_eof)
+        : _state(state),
+          _profile(profile),
+          _counter(counter),
+          _params(params),
+          _range(range),
+          _file_slot_descs(file_slot_descs),
+          _file_reader(nullptr),
+          _file_reader_s(nullptr),
+          _real_file_reader(nullptr),
+          _line_reader(nullptr),
+          _reader_eof(false),
+          _skip_first_line(false),
+          _next_row(0),
+          _total_rows(0),
+          _scanner_eof(scanner_eof) {
+    _file_format_type = _params.format_type;
+
+    _bytes_read_counter = ADD_COUNTER(_profile, "BytesRead", TUnit::BYTES);
+    _read_timer = ADD_TIMER(_profile, "ReadTime");
+    _file_read_timer = ADD_TIMER(_profile, "FileReadTime");
+}
+
+Status NewJsonReader::init_reader() {
+    RETURN_IF_ERROR(_get_range_params());
+
+    LOG(INFO) << "--ftw: strip_out_array" << _strip_outer_array;
+    LOG(INFO) << "--ftw: read_json_by_line" << _read_json_by_line;

Review Comment:
   remove this



-- 
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] hello-stephen commented on pull request #13546: [feature-wip](new-scan) support Json reader

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #13546:
URL: https://github.com/apache/doris/pull/13546#issuecomment-1286858817

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 38.92 seconds
    load time: 570 seconds
    storage size: 17154644820 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221021195440_clickbench_pr_32519.html


-- 
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] hello-stephen commented on pull request #13546: [feature-wip](new-scan) support Json reader

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #13546:
URL: https://github.com/apache/doris/pull/13546#issuecomment-1288072148

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 38.77 seconds
    load time: 574 seconds
    storage size: 17154644803 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221023175947_clickbench_pr_32848.html


-- 
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] hello-stephen commented on pull request #13546: [feature-wip](new-scan) support Json reader

Posted by GitBox <gi...@apache.org>.
hello-stephen commented on PR #13546:
URL: https://github.com/apache/doris/pull/13546#issuecomment-1291441920

   TeamCity pipeline, clickbench performance test result:
    the sum of best hot time: 37.85 seconds
    load time: 559 seconds
    storage size: 17154887228 Bytes
    https://doris-community-test-1308700295.cos.ap-hongkong.myqcloud.com/tmp/20221026031737_clickbench_pr_34041.html


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