File tree 2 files changed +16
-1
lines changed
test/taoensso/faraday/tests
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1152
1152
[table
1153
1153
& [{:keys [attr-conds last-prim-kvs return limit total-segments
1154
1154
proj-expr expr-attr-names filter-expr expr-attr-vals
1155
- index segment return-cc?] :as opts}]]
1155
+ consistent? index segment return-cc?] :as opts}]]
1156
1156
(doto-cond [g (ScanRequest. )]
1157
1157
:always (.setTableName (name table))
1158
1158
attr-conds (.setScanFilter (query|scan-conditions g))
1166
1166
proj-expr (.setProjectionExpression g)
1167
1167
total-segments (.setTotalSegments (int g))
1168
1168
segment (.setSegment (int g))
1169
+ consistent? (.setConsistentRead consistent?)
1169
1170
(coll?* return) (.setAttributesToGet (mapv name return))
1170
1171
return-cc? (.setReturnConsumedCapacity (utils/enum :total ))
1171
1172
(and return (not (coll?* return)))
1188
1189
[<attr> ...]}.
1189
1190
:total-segments - Total number of parallel scan segments.
1190
1191
:segment - Calling worker's segment number (>=0, <=total-segments).
1192
+ :consistent? - If the scan should use consistent reads
1191
1193
1192
1194
comparison-operators e/o #{:eq :le :lt :ge :gt :begins-with :between :ne
1193
1195
:not-null :null :contains :not-contains :in}.
Original file line number Diff line number Diff line change 437
437
(expect " age, #t" (.getProjectionExpression req))
438
438
(expect {" #t" " year" } (.getExpressionAttributeNames req))
439
439
)
440
+
441
+ (let [req ^ScanRequest (scan-request
442
+ :scan
443
+ {:filter-expr " age < 25"
444
+ :index " age-index"
445
+ :limit 5
446
+ :consistent? true })]
447
+ (expect " scan" (.getTableName req))
448
+ (expect 5 (.getLimit req))
449
+ (expect " age < 25" (.getFilterExpression req))
450
+ (expect " age-index" (.getIndexName req))
451
+ (expect (.getConsistentRead req))
452
+ )
You can’t perform that action at this time.
0 commit comments