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

Function ReportBadFormat

be/src/runtime/datetime-parser-common.cc:68–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void ReportBadFormat(FunctionContext* context, FormatTokenizationResult error_type,
69 const StringVal& format, bool is_error) {
70 DCHECK(context != nullptr);
71 std::stringstream ss;
72 if (format.is_null || format.len == 0) {
73 ss << "Bad date/time conversion format: format string is NULL or has 0 length";
74 } else {
75 switch (error_type) {
76 case DUPLICATE_FORMAT:
77 ss << "PARSE ERROR: Invalid duplication of format element";
78 break;
79 case YEAR_WITH_ROUNDED_YEAR_ERROR:
80 ss << "PARSE ERROR: Both year and round year are provided";
81 break;
82 case CONFLICTING_YEAR_TOKENS_ERROR:
83 ss << "PARSE ERROR: Multiple year tokens provided";
84 break;
85 case CONFLICTING_MONTH_TOKENS_ERROR:
86 ss << "PARSE ERROR: Multiple month tokens provided";
87 break;
88 case DAY_OF_YEAR_TOKEN_CONFLICT:
89 ss << "PARSE ERROR: Day of year provided with day or month token";
90 break;
91 case CONFLICTING_HOUR_TOKENS_ERROR:
92 ss << "PARSE ERROR: Multiple hour tokens provided";
93 break;
94 case CONFLICTING_MERIDIEM_TOKENS_ERROR:
95 ss << "PARSE ERROR: Multiple median indicator tokens provided";
96 break;
97 case MERIDIEM_CONFLICTS_WITH_HOUR_ERROR:
98 ss << "PARSE ERROR: Conflict between median indicator and hour token";
99 break;
100 case MISSING_HOUR_TOKEN_ERROR:
101 ss << "PARSE ERROR: Missing hour token";
102 break;
103 case SECOND_IN_DAY_CONFLICT:
104 ss << "PARSE ERROR: Second of day token conflicts with other token(s)";
105 break;
106 case TOO_LONG_FORMAT_ERROR:
107 ss << "PARSE ERROR: The input format is too long";
108 break;
109 case TIMEZONE_OFFSET_NOT_ALLOWED_ERROR:
110 ss << "PARSE ERROR: Timezone offset not allowed in a datetime to string "
111 "conversion";
112 break;
113 case MISSING_TZH_TOKEN_ERROR:
114 ss << "PARSE ERROR: TZH token is required for TZM";
115 break;
116 case DATE_WITH_TIME_ERROR:
117 ss << "PARSE ERROR: Time tokens provided with date type.";
118 break;
119 case CONFLICTING_FRACTIONAL_SECOND_TOKENS_ERROR:
120 ss << "PARSE ERROR: Multiple fractional second tokens provided.";
121 break;
122 case TEXT_TOKEN_NOT_CLOSED:
123 ss << "PARSE ERROR: Missing closing quotation mark.";
124 break;
125 case NO_DATETIME_TOKENS_ERROR:

Callers 5

FromUnixMethod · 0.85
ToTimestampMethod · 0.85
OpenEvaluatorMethod · 0.85
UnixAndFromUnixPrepareFunction · 0.85

Calls 4

AddWarningMethod · 0.80
DebugStringMethod · 0.45
SetErrorMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected