MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / ParseIntervalWithTypeMetadata

Function ParseIntervalWithTypeMetadata

pkg/sql/sem/tree/datum.go:3195–3204  ·  view source on GitHub ↗

ParseIntervalWithTypeMetadata is the same as ParseDIntervalWithTypeMetadata but returns a duration.Duration.

(
	style duration.IntervalStyle, s string, itm types.IntervalTypeMetadata,
)

Source from the content-addressed store, hash-verified

3193// ParseIntervalWithTypeMetadata is the same as ParseDIntervalWithTypeMetadata
3194// but returns a duration.Duration.
3195func ParseIntervalWithTypeMetadata(
3196 style duration.IntervalStyle, s string, itm types.IntervalTypeMetadata,
3197) (duration.Duration, error) {
3198 d, err := duration.ParseInterval(style, s, itm)
3199 if err != nil {
3200 return d, err
3201 }
3202 truncateInterval(&d, itm)
3203 return d, nil
3204}
3205
3206// ResolvedType implements the TypedExpr interface.
3207func (*DInterval) ResolvedType() *types.T {

Callers 2

Calls 2

ParseIntervalFunction · 0.92
truncateIntervalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…