@@ -108,6 +108,7 @@ private static RowFilter.Expression filerPred(String column, Operator operation)
108108    {
109109        RowFilter .Expression  pred  = Mockito .mock (RowFilter .Expression .class );
110110        Mockito .when (pred .toCQLString (false )).thenReturn (column  + ' '  + operation  + " X" );
111+         Mockito .when (pred .toCQLString (true )).thenReturn (column  + ' '  + operation  + " ?" );
111112        Mockito .when (pred .operator ()).thenReturn (operation );
112113        return  pred ;
113114    }
@@ -561,8 +562,6 @@ public void prettyPrint()
561562        Plan .RowsIteration  filter  = factory .recheckFilter (RowFilter .builder ().add (pred1 ).add (pred2 ).add (pred4 ).build (), fetch );
562563        Plan .RowsIteration  limit  = factory .limit (filter , 3 );
563564
564-         String  prettyStr  = limit .toStringRecursive ();
565- 
566565        assertEquals ("Limit 3 (rows: 3.0, cost/row: 3895.8, cost: 44171.3..55858.7)\n "  +
567566                     " └─ Filter pred1 < X AND pred2 < X AND pred4 < X (sel: 1.000000000) (rows: 3.0, cost/row: 3895.8, cost: 44171.3..55858.7)\n "  +
568567                     "     └─ Fetch (rows: 3.0, cost/row: 3895.8, cost: 44171.3..55858.7)\n "  +
@@ -574,7 +573,22 @@ public void prettyPrint()
574573                     "                 │   └─ NumericIndexScan of pred1_idx (sel: 0.500000000, step: 250.0) (keys: 2000.0, cost/key: 14.6, cost: 4500.0..33701.3)\n "  +
575574                     "                 │      predicate: RANGE(pred1)\n "  +
576575                     "                 └─ LiteralIndexScan of pred4_idx (sel: 0.001000000, step: 1.0) (keys: 1000.0, cost/key: 0.1, cost: 4500.0..4600.0)\n "  +
577-                      "                    predicate: RANGE(pred4)\n " , prettyStr );
576+                      "                    predicate: RANGE(pred4)\n " ,
577+                      limit .toStringRecursive (false ));
578+ 
579+         assertEquals ("Limit 3 (rows: 3.0, cost/row: 3895.8, cost: 44171.3..55858.7)\n "  +
580+                      " └─ Filter pred1 < ? AND pred2 < ? AND pred4 < ? (sel: 1.000000000) (rows: 3.0, cost/row: 3895.8, cost: 44171.3..55858.7)\n "  +
581+                      "     └─ Fetch (rows: 3.0, cost/row: 3895.8, cost: 44171.3..55858.7)\n "  +
582+                      "         └─ KeysSort (keys: 3.0, cost/key: 3792.4, cost: 44171.3..55548.4)\n "  +
583+                      "             └─ Union (keys: 1999.0, cost/key: 14.8, cost: 13500.0..43001.3)\n "  +
584+                      "                 ├─ Intersection (keys: 1000.0, cost/key: 29.4, cost: 9000.0..38401.3)\n "  +
585+                      "                 │   ├─ NumericIndexScan of pred2_idx (sel: 0.002000000, step: 1.0) (keys: 2000.0, cost/key: 0.1, cost: 4500.0..4700.0)\n "  +
586+                      "                 │   │  predicate: RANGE(pred2)\n "  +
587+                      "                 │   └─ NumericIndexScan of pred1_idx (sel: 0.500000000, step: 250.0) (keys: 2000.0, cost/key: 14.6, cost: 4500.0..33701.3)\n "  +
588+                      "                 │      predicate: RANGE(pred1)\n "  +
589+                      "                 └─ LiteralIndexScan of pred4_idx (sel: 0.001000000, step: 1.0) (keys: 1000.0, cost/key: 0.1, cost: 4500.0..4600.0)\n "  +
590+                      "                    predicate: RANGE(pred4)\n " ,
591+                      limit .toStringRecursive (true ));
578592    }
579593
580594    @ Test 
@@ -1035,7 +1049,6 @@ public void testLazyAccessPropagation()
10351049        Mockito .when (indexScan1 .withAccess (Mockito .any ())).thenReturn (indexScan1 );
10361050        Mockito .when (indexScan1 .estimateCost ()).thenReturn (new  Plan .KeysIterationCost (20 ,0.0 , 0.5 ));
10371051        Mockito .when (indexScan1 .estimateSelectivity ()).thenReturn (0.001 );
1038-         Mockito .when (indexScan1 .title ()).thenReturn ("" );
10391052
10401053        Plan .KeysIteration  indexScan2  = factory .indexScan (saiPred2 , (long ) (0.01  * factory .tableMetrics .rows ));
10411054        Plan .KeysIteration  indexScan3  = factory .indexScan (saiPred3 , (long ) (0.5  * factory .tableMetrics .rows ));
0 commit comments