MCPcopy Create free account
hub / github.com/apache/impala / ReportColumnParseError

Method ReportColumnParseError

be/src/exec/hdfs-scanner.cc:941–971  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

939}
940
941void HdfsScanner::ReportColumnParseError(const SlotDescriptor* desc,
942 const char* data, int len) {
943 if (state_->LogHasSpace() || state_->abort_on_error()) {
944 stringstream ss;
945 ss << "Error converting column: "
946 << desc->col_pos() - scan_node_->num_partition_keys()
947 << " to " << desc->type();
948
949 // When skipping multiple header lines we only try to skip them in the first scan
950 // range. For subsequent scan ranges, it's impossible to determine how many lines
951 // precede it and whether any header lines should be skipped. If the header does not
952 // fit into the first scan range and spills into subsequent scan ranges, then we will
953 // try to parse header data here and fail. The scanner of the first scan range will
954 // fail the query if it cannot fully skip the header. However, if abort_on_error is
955 // set, then a race happens between the first scanner to detect the condition and any
956 // other scanner that tries to parse an invalid value. Therefore a possible mitigation
957 // is to increase the max_scan_range_length so the header is fully contained in the
958 // first scan range.
959 if (scan_node_->skip_header_line_count() > 1) {
960 ss << "\n" << "Table has skip.header.line.count set to a value > 1. If the data "
961 << "that could not be parsed looks like it's part of the file's header, then "
962 << "try increasing max_scan_range_length to a value larger than the size of the "
963 << "file's header.";
964 }
965 if (state_->LogHasSpace()) {
966 state_->LogError(ErrorMsg(TErrorCode::GENERAL, ss.str()), 2);
967 }
968
969 if (state_->abort_on_error() && parse_status_.ok()) parse_status_ = Status(ss.str());
970 }
971}
972
973void HdfsScanner::CheckFiltersEffectiveness() {
974 for (int i = 0; i < filter_stats_.size(); ++i) {

Callers

nothing calls this directly

Calls 11

ErrorMsgClass · 0.85
LogHasSpaceMethod · 0.80
col_posMethod · 0.80
num_partition_keysMethod · 0.80
StatusClass · 0.70
abort_on_errorMethod · 0.45
typeMethod · 0.45
LogErrorMethod · 0.45
strMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected