Skip to content

Commit e05a2a3

Browse files
committed
Cleaning up diagnostic output.
1 parent dd424c9 commit e05a2a3

File tree

15 files changed

+34
-101
lines changed

15 files changed

+34
-101
lines changed

fhir-server/src/main/java/au/csiro/pathling/aggregate/AggregateExecutor.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ public AggregateExecutor(@Nonnull final QueryConfiguration configuration,
7373
public AggregateResponse execute(@Nonnull final AggregateRequest query) {
7474
final ResultWithExpressions resultWithExpressions = buildQuery(
7575
query);
76-
resultWithExpressions.getDataset().explain();
77-
resultWithExpressions.getDataset().show(1_000, false);
78-
7976
// Translate the result into a response object to be passed back to the user.
8077
return buildResponse(resultWithExpressions);
8178
}
@@ -105,8 +102,8 @@ private AggregateResponse buildResponse(
105102
@Nonnull
106103
@SuppressWarnings("unchecked")
107104
private Function<Row, AggregateResponse.Grouping> mapRowToGrouping(
108-
@Nonnull final List<EvaluatedPath> aggregations, @Nonnull final List<EvaluatedPath> groupings,
109-
@Nonnull final List<EvaluatedPath> filters) {
105+
@Nonnull final List<EvaluatedPath> aggregations, @Nonnull final List<EvaluatedPath> groupings,
106+
@Nonnull final List<EvaluatedPath> filters) {
110107
return row -> {
111108
final List<Optional<Type>> labels = new ArrayList<>();
112109
final List<Optional<Type>> results = new ArrayList<>();

fhir-server/src/main/java/au/csiro/pathling/search/SearchExecutor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ public List<IBaseResource> getResources(final int theFromIndex, final int theToI
230230
.of(subjectResource.toCode());
231231
requireNonNull(encoder);
232232
reportQueryPlan(resources);
233-
resources.explain();
234-
235233
return resources.as(encoder).collectAsList();
236234
}
237235

fhir-server/src/test/java/au/csiro/pathling/aggregate/AggregateQueryExecutorTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ void simpleQueryWithLabels() {
9999
assertArrayEquals(new String[]{"patient_gender", "patient_count"},
100100
result.columns());
101101
assertThat(result)
102-
.debugAllRows()
103102
.hasRows(spark, "responses/AggregateQueryExecutorTest/simpleQuery.tsv");
104103
}
105104

@@ -116,7 +115,6 @@ void simpleQueryWithNoLabels() {
116115
final Dataset<Row> result = executor.buildQuery(request).getDataset();
117116
//assertTrue(Stream.of(result.columns()).allMatch(Strings::looksLikeAlias));
118117
assertThat(result)
119-
.debugAllRows()
120118
.hasRows(spark, "responses/AggregateQueryExecutorTest/simpleQuery.tsv");
121119
}
122120

fhir-server/src/test/java/au/csiro/pathling/extract/ExtractQueryTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ void multiplePolymorphicResolves() {
169169

170170
final Dataset<Row> result = executor.buildQuery(request, ProjectionConstraint.FLAT);
171171
assertThat(result)
172-
.debugAllRows()
173172
.hasRows(spark, "responses/ExtractQueryTest/multiplePolymorphicResolves.tsv");
174173
}
175174

@@ -469,7 +468,6 @@ void structuredResult() {
469468
);
470469

471470
assertThat(result)
472-
.debugAllRows()
473471
.hasRows(spark, "responses/ExtractQueryTest/structuredResult.tsv");
474472
}
475473

fhir-server/src/test/java/au/csiro/pathling/fhirpath/parser/ParserTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,6 @@ void testDesignationFunctionWithNoLanguage() {
589589
assertThatResultOf(ResourceType.CONDITION,
590590
"code.coding.designation(http://terminology.hl7.org/CodeSystem/designation-usage|display)")
591591
.selectOrderedResult()
592-
.debugAllRows()
593592
.hasRows(spark, "responses/ParserTest/testDesignationFunctionWithNoLanguage.tsv");
594593
}
595594

fhir-server/src/test/resources/logback-test.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<pattern>[%level] %logger{36} - %msg%n</pattern>
2323
</encoder>
2424
</appender>
25-
<logger level="DEBUG" name="au.csiro"/>
25+
<logger level="INFO" name="au.csiro"/>
2626
<logger level="ERROR" name="org.apache.hadoop.metrics2"/>
2727
<logger level="ERROR" name="org.apache.spark.sql.execution.CacheManager"/>
2828
<logger level="ERROR" name="org.apache.spark.sql.catalyst.util.SparkStringUtils"/>

fhirpath/src/main/java/au/csiro/pathling/fhirpath/execution/DataRootResolver.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@
2323
import java.util.stream.Collectors;
2424
import java.util.stream.Stream;
2525
import lombok.Value;
26+
import lombok.extern.slf4j.Slf4j;
2627
import org.hl7.fhir.r4.model.Enumerations.ResourceType;
2728

2829
@Value
30+
@Slf4j
2931
public class DataRootResolver {
3032

3133
ResourceType subjectResource;
@@ -108,7 +110,7 @@ public void collectDataRoots(@Nonnull final DataRoot currentRoot,
108110
}
109111
} else if (headPath instanceof Paths.ExternalConstantPath ecp) {
110112
// we do not need to do anything here
111-
System.out.println("External constant path" + ecp);
113+
log.debug("External constant path: {}", ecp);
112114
if ("resource".equals(ecp.getName()) || "rootResource".equals(ecp.getName())) {
113115
// this root should already be addded here
114116
collectDataRoots(ResourceRoot.of(subjectResource), fhirPath.suffix(), FhirPath.nullPath(),

fhirpath/src/main/java/au/csiro/pathling/fhirpath/function/provider/ResolverFunctions.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ public static ResourceCollection reverseResolve(@Nonnull final ResourceCollectio
2828
final ReverseResolveRoot root = ReverseResolveRoot.ofResource(input.getResourceType(),
2929
childResourceType, childPath);
3030

31-
log.info("Reverse resolve root: {}", root);
32-
System.out.println("Reverse resolve root: " + root);
33-
31+
log.debug("Reverse resolve root: {}", root);
3432
return evaluationContext.resolveReverseJoin(input, subjectPath.toExpression());
3533
}
3634

fhirpath/src/test/java/au/csiro/pathling/extract/ExtractTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ void simple() {
6464
), Collections.emptyList(), Optional.empty());
6565

6666
final Dataset<Row> result = executor.buildQuery(request);
67-
result.show();
68-
6967
final Dataset<Row> expected = DatasetBuilder.of(spark)
7068
.withColumn("id", DataTypes.StringType)
7169
.withColumn("given_name", DataTypes.StringType)

fhirpath/src/test/java/au/csiro/pathling/fhirpath/column/DefaultRepresentationTest.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ void check() {
6666
for (int i = 0; i < result.size(); i++) {
6767
assertTrue(result.getBoolean(i), "Test " + i + " failed: " + tests.get(i));
6868
}
69-
System.out.println(result);
7069
}
7170
}
7271

@@ -116,13 +115,6 @@ void testSingular() {
116115
.assertEquals(13, valueOf(13).singular())
117116
.assertEquals("a", arrayOfOne("a").singular())
118117
.check();
119-
120-
// final SparkException ex = assertThrows(SparkException.class, () ->
121-
// spark.range(1).select(
122-
// ColumnHelpers.singular(functions.array(functions.lit("a"), functions.lit("b")))
123-
// ).collect());
124-
// System.out.println(ex.getCause().getMessage());
125-
126118
}
127119

128120
@Test

0 commit comments

Comments
 (0)