Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions be/src/exec/base_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,11 @@ bool BaseScanner::fill_dest_tuple(const Slice& line, Tuple* dest_tuple, MemPool*
ctx->clear_error_msg();
return false;
}
SlotDescriptor* slot_descriptor = _src_slot_descs_order_by_dest[dest_index];
if (_strict_mode && (slot_descriptor != nullptr)&& !_src_tuple->is_null(slot_descriptor->null_indicator_offset())) {
// If _strict_mode is false, _src_slot_descs_order_by_dest size could be zero
if (_strict_mode && (_src_slot_descs_order_by_dest[dest_index] != nullptr) &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better leave a comment for this change, I'm afraid other will change it back someday.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

!_src_tuple->is_null(_src_slot_descs_order_by_dest[dest_index]->null_indicator_offset())) {
//Type of the slot is must be Varchar in _src_tuple.
StringValue* raw_value = _src_tuple->get_string_slot(slot_descriptor->tuple_offset());
StringValue* raw_value = _src_tuple->get_string_slot(_src_slot_descs_order_by_dest[dest_index]->tuple_offset());
std::string raw_string;
if (raw_value != nullptr) {//is not null then get raw value
raw_string = raw_value->to_string();
Expand Down
13 changes: 3 additions & 10 deletions be/test/exec/parquet_scanner_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,23 +462,22 @@ TEST_F(ParquetSannerTest, normal) {
MemTracker tracker;
// Get batch
RowBatch batch(scan_node.row_desc(), _runtime_state.batch_size(), &tracker);
std::cout << time(NULL) << std::endl;
bool eof = false;
for (int i = 0; i < 14; i++) {
status = scan_node.get_next(&_runtime_state, &batch, &eof);
ASSERT_TRUE(status.ok());
ASSERT_EQ(2048, batch.num_rows());
//ASSERT_EQ(1000, batch.num_rows());
ASSERT_FALSE(eof);
batch.reset();
}

status = scan_node.get_next(&_runtime_state, &batch, &eof);
ASSERT_TRUE(status.ok());
ASSERT_EQ(1328, batch.num_rows());
//ASSERT_EQ(1000, batch.num_rows());
ASSERT_FALSE(eof);
batch.reset();
std::cout << time(NULL) << std::endl;
status = scan_node.get_next(&_runtime_state, &batch, &eof);
ASSERT_TRUE(status.ok());
ASSERT_EQ(0, batch.num_rows());
ASSERT_TRUE(eof);

Expand All @@ -493,12 +492,6 @@ TEST_F(ParquetSannerTest, normal) {
}

int main(int argc, char** argv) {
// std::string conffile = std::string(getenv("DORIS_HOME")) + "/conf/be.conf";
// if (!doris::config::init(conffile.c_str(), false)) {
// fprintf(stderr, "error read config file. \n");
// return -1;
// }
// init_glog("be-test");
::testing::InitGoogleTest(&argc, argv);
doris::CpuInfo::init();
return RUN_ALL_TESTS();
Expand Down