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

Method Tokenize

be/src/runtime/datetime-iso-sql-format-tokenizer.cc:103–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101const int IsoSqlFormatTokenizer::FRACTIONAL_MAX_LEN = 9;
102
103FormatTokenizationResult IsoSqlFormatTokenizer::Tokenize() {
104 DCHECK(dt_ctx_ != nullptr);
105 DCHECK(dt_ctx_->fmt != nullptr);
106 DCHECK(dt_ctx_->fmt_len > 0);
107 DCHECK(dt_ctx_->toks.size() == 0);
108 DCHECK(used_tokens_.empty());
109 if (dt_ctx_->fmt_len > MAX_FORMAT_LENGTH) return TOO_LONG_FORMAT_ERROR;
110 const char* str_end = dt_ctx_->fmt + dt_ctx_->fmt_len;
111 const char* current_pos = dt_ctx_->fmt;
112 ProcessFXModifier(&current_pos);
113 while (current_pos < str_end) {
114 ProcessSeparators(&current_pos);
115 if (current_pos == str_end) break;
116 FormatTokenizationResult parse_result = ProcessNextToken(&current_pos);
117 if (parse_result != SUCCESS) return parse_result;
118 }
119 if (dt_ctx_->toks.empty()) return GENERAL_ERROR;
120 return CheckIncompatibilities();
121}
122
123void IsoSqlFormatTokenizer::ProcessSeparators(const char** current_pos) {
124 DCHECK(current_pos != nullptr && *current_pos != nullptr);

Callers 2

OpenEvaluatorMethod · 0.45
mainFunction · 0.45

Calls 2

sizeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected