|
454 | 454 | ;; Projection Pushdown (Phase 3C) |
455 | 455 | ;; ============================================================================ |
456 | 456 |
|
457 | | - |
458 | 457 | (defn- materialize-column |
459 | 458 | "Ensure a column has array :data, materializing from index if needed. |
460 | 459 | Uses direct single-copy path (idx-materialize-to-array) to avoid |
|
707 | 706 | ;; Return (fn [^long length] -> long[]) that closes over the data |
708 | 707 | (fn [^long length] ^longs (compiled-fn col-data-arr length))))) |
709 | 708 |
|
710 | | - |
711 | 709 | ;; ============================================================================ |
712 | 710 | ;; String Predicate Materialization |
713 | 711 | ;; ============================================================================ |
|
1726 | 1724 | (double (aget ^longs col i)) |
1727 | 1725 | (aget ^doubles col i))) |
1728 | 1726 |
|
1729 | | - |
1730 | 1727 | ;; ============================================================================ |
1731 | 1728 | ;; Scalar Fallback Execution |
1732 | 1729 | ;; ============================================================================ |
|
1910 | 1907 | aggs-ok? (every? #(supported-agg-ops (:op %)) aggs)] |
1911 | 1908 | (and group-cols-ok? aggs-ok?))) |
1912 | 1909 |
|
1913 | | - |
1914 | 1910 | (defn- ensure-longs |
1915 | 1911 | "Get a column's data as long[], converting double[] if needed." |
1916 | 1912 | ^longs [col-data ^long length] |
|
2559 | 2555 | (- (* nd syy) (* sy sy))))] |
2560 | 2556 | (if (zero? denom) Double/NaN (/ num denom)))) |
2561 | 2557 |
|
2562 | | - |
2563 | 2558 | (defn- var-acc-slots |
2564 | 2559 | "Number of accumulator slots for an agg type in the variable-width format." |
2565 | 2560 | ^long [op] |
|
2585 | 2580 | :variance (compute-variance (aget accs off) (aget accs (+ off 1)) (long (aget accs (+ off 2)))) |
2586 | 2581 | :stddev (Math/sqrt (compute-variance (aget accs off) (aget accs (+ off 1)) (long (aget accs (+ off 2))))) |
2587 | 2582 | :corr (compute-correlation (aget accs off) (aget accs (+ off 1)) (aget accs (+ off 2)) |
2588 | | - (aget accs (+ off 3)) (aget accs (+ off 4)) (long (aget accs (+ off 5)))) |
| 2583 | + (aget accs (+ off 3)) (aget accs (+ off 4)) (long (aget accs (+ off 5)))) |
2589 | 2584 | :count (long (aget accs (+ off (dec (var-acc-slots op))))) |
2590 | 2585 | :avg (let [sum (aget accs off) |
2591 | 2586 | cnt (long (aget accs (+ off 1)))] |
|
3311 | 3306 | :count-distinct (int ColumnOps/AGG_COUNT) |
3312 | 3307 | (int ColumnOps/AGG_SUM))) |
3313 | 3308 |
|
3314 | | - |
3315 | 3309 | (defn- prepare-group-key-arrays |
3316 | 3310 | "Prepare group key columns, compute normalization and strides. |
3317 | 3311 | Returns {:group-arrays :group-muls :group-maxes :group-dicts :group-offsets :max-key :use-dense? :n-group}." |
|
4330 | 4324 | (aset dirs i (not= (second (nth order-by i)) :desc))) |
4331 | 4325 | (into-array Object [oks dirs]))) |
4332 | 4326 |
|
4333 | | - |
4334 | 4327 | (defn- frame-has-numeric-bounds? |
4335 | 4328 | "Check if a frame has numeric ROWS bounds (not just unbounded/current)." |
4336 | 4329 | [frame] |
|
0 commit comments