Skip to content

Commit 6e05823

Browse files
committed
DEVEXP-477 Upgraded to Java Client 6.2.1
Can't believe it, but resultDoc with JacksonHandle is consistently outperforming resultRows with a StringHandle. So not changing that code, just changed the comments.
1 parent 983a10d commit 6e05823

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repositories {
2020

2121
dependencies {
2222
compileOnly 'org.apache.spark:spark-sql_2.12:3.4.0'
23-
implementation "com.marklogic:marklogic-client-api:6.2.0"
23+
implementation "com.marklogic:marklogic-client-api:6.2.1"
2424

2525
// Makes it possible to use lambdas in Java 8 to implement Spark's Function1 and Function2 interfaces
2626
// See https://github.com/scala/scala-java8-compat for more information

src/main/java/com/marklogic/spark/reader/ReadContext.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ Iterator<JsonNode> readRowsInBucket(RowManager rowManager, PlanAnalysis.Partitio
120120
PlanBuilder.Plan plan = buildPlanForBucket(rowManager, bucket);
121121
JacksonHandle jsonHandle = new JacksonHandle();
122122
jsonHandle.setPointInTimeQueryTimestamp(serverTimestamp);
123-
// Unable to use resultRows as Java Client <= 6.2.0 has a bug where the serverTimestamp is ignored.
124-
// TODO Change this to use resultRows once Java Client 6.2.1 is available. That should perform better as it
125-
// avoids creating a JsonNode.
123+
// Remarkably, the use of resultDoc has consistently proven to be a few percentage points faster than using
124+
// resultRows with a StringHandle, even though the latter avoids the need for converting to and from a JsonNode.
125+
// The overhead with resultRows may be due to the processing of a multipart response; it's not yet clear.
126126
JsonNode result = rowManager.resultDoc(plan, jsonHandle).get();
127127
return result != null && result.has("rows") ?
128128
result.get("rows").iterator() :

0 commit comments

Comments
 (0)