worker_query_engine.go ×9

Frontier kind: Code frontier

unlabeled · c_84f050cbb774

6 tests · 2213 LOC · 107 files · introduces 0 tests · 21 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges21 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
350 ranges2213 lines · 107 files · Browse complete extent
All tests (intent)
6 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 21 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

go.temporal.io/server/service/matching/workers/worker_query_engine.go 21 introduced LOC · 9 ranges

Open complete file

221 case *sqlparser.ParenExpr:
222 return w.evaluateExpression(e.Expr)
223 > case *sqlparser.RangeCond: worker_query_engine.go
224 > return w.evaluateRange(e)
225 case *sqlparser.IsExpr:
226 return w.evaluateIsExpr(e)
343 }
344
345 > func (w *workerQueryEngine) evaluateRange(expr *sqlparser.RangeCond) (bool, error) { worker_query_engine.go
346 > if expr == nil {
347 return false, serviceerror.NewInvalidArgumentf("RangeCond input expression cannot be nil")
348 }
349 > colName, ok := expr.Left.(*sqlparser.ColName) worker_query_engine.go
350 > if !ok {
351 return false, serviceerror.NewInvalidArgumentf("unknown or unsupported column name: %s", sqlparser.String(expr.Left))
352 }
353 // Strip backticks added by the SQL parser for reserved words (e.g., "Status" → "`status`" → "status").
354 > colNameStr := strings.ReplaceAll(sqlparser.String(colName), "`", "") worker_query_engine.go
355 >
356 > switch colNameStr {
357 > case workerStartTimeColName, workerHeartbeatTimeColName:
358 > fromValue, err := sqlquery.ConvertToTime(sqlparser.String(expr.From))
359 > if err != nil {
360 return false, err
361 }
362 > toValue, err := sqlquery.ConvertToTime(sqlparser.String(expr.To)) worker_query_engine.go
363 > if err != nil {
364 return false, err
365 }
366
367 > timeValue, err := w.getTimeValue(colNameStr) worker_query_engine.go
368 > if err != nil {
369 return false, err
370 }
371 > if timeValue.IsZero() { worker_query_engine.go
372 // If the time value is zero, it means the time was not provided with heartbeat.
373 // In this case, we return false for the range condition.
375 }
376
377 > switch expr.Operator { worker_query_engine.go
378 case sqlparser.BetweenStr:
379 return w.compareTimeBetween(fromValue, toValue, timeValue), nil
430 func (w *workerQueryEngine) compareTimeBetween(
431 fromTime time.Time, toTime time.Time, timeValue time.Time,
432 > ) bool { worker_query_engine.go
433 > return timeValue.Compare(fromTime) >= 0 && timeValue.Compare(toTime) <= 0
434 > }
435
436 func (w *workerQueryEngine) compareTime(receivedTime time.Time, expectedTime time.Time, operation string) (bool, error) {