Skip to content

Commit

Permalink
Addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cgivre committed Jun 7, 2022
1 parent f5faeb3 commit fc1a320
Showing 1 changed file with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static class ConvertFromJsonNullableInput implements DrillSimpleFunc {
@Inject
ResultSetLoader loader;

@Output
@Output // TODO Remove in future work
BaseWriter.ComplexWriter writer;

@Override
Expand All @@ -68,9 +68,6 @@ public void setup() {
public void eval() {
if (in.end == 0) {
// Return empty map
org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter mapWriter = writer.rootAsMap();
mapWriter.start();
mapWriter.end();
return;
}

Expand All @@ -79,7 +76,6 @@ public void eval() {
org.apache.drill.exec.store.easy.json.loader.JsonLoader jsonLoader = jsonLoaderBuilder.build();
loader.startBatch();
jsonLoader.readBatch();
loader.close();
} catch (Exception e) {
throw new org.apache.drill.common.exceptions.DrillRuntimeException("Error while converting from JSON. ", e);
}
Expand All @@ -93,7 +89,7 @@ public static class ConvertFromJsonVarcharInput implements DrillSimpleFunc {
@Param
VarCharHolder in;

@Output
@Output // TODO Remove in future work
ComplexWriter writer;

@Workspace
Expand All @@ -118,9 +114,6 @@ public void eval() {

// If the input is null or empty, return an empty map
if (jsonString.length() == 0) {
org.apache.drill.exec.vector.complex.writer.BaseWriter.MapWriter mapWriter = writer.rootAsMap();
mapWriter.start();
mapWriter.end();
return;
}

Expand All @@ -129,7 +122,6 @@ public void eval() {
org.apache.drill.exec.store.easy.json.loader.JsonLoader jsonLoader = jsonLoaderBuilder.build();
loader.startBatch();
jsonLoader.readBatch();
loader.close();
} catch (Exception e) {
throw new org.apache.drill.common.exceptions.DrillRuntimeException("Error while converting from JSON. ", e);
}
Expand Down

0 comments on commit fc1a320

Please sign in to comment.