Skip to content

Commit

Permalink
Fix various LocalInputSource calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
gianm committed Oct 30, 2023
1 parent f69f7de commit 0f44f6c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.apache.druid.data.input.impl.InlineInputSource;
import org.apache.druid.data.input.impl.JsonInputFormat;
import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.Intervals;
import org.apache.druid.msq.indexing.MSQSpec;
Expand Down Expand Up @@ -121,7 +122,7 @@ public void setup() throws IOException
dataFileSignatureJsonString = queryFramework().queryJsonMapper().writeValueAsString(dataFileSignature);

dataFileExternalDataSource = new ExternalDataSource(
new LocalInputSource(null, null, ImmutableList.of(dataFile)),
new LocalInputSource(null, null, ImmutableList.of(dataFile), SystemFields.none()),
new JsonInputFormat(null, null, null, null, null),
dataFileSignature
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.google.common.collect.ImmutableList;
import org.apache.druid.data.input.impl.CsvInputFormat;
import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.msq.indexing.MSQSpec;
Expand Down Expand Up @@ -163,7 +164,7 @@ public void testIngestWithSanitizedNullByte() throws IOException
newScanQueryBuilder()
.dataSource(
new ExternalDataSource(
new LocalInputSource(null, null, ImmutableList.of(toRead)),
new LocalInputSource(null, null, ImmutableList.of(toRead), SystemFields.none()),
new CsvInputFormat(null, null, null, true, 0),
RowSignature.builder()
.add("timestamp", ColumnType.STRING)
Expand Down Expand Up @@ -302,7 +303,7 @@ public void testMultiValueStringWithIncorrectType() throws IOException
.createException(
new Exception("dummy"),
"v1",
new LocalInputSource(null, null, ImmutableList.of(toRead)),
new LocalInputSource(null, null, ImmutableList.of(toRead), SystemFields.none()),
new SimpleAscendingOffset(Integer.MAX_VALUE)
)
.getMessage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.apache.druid.data.input.impl.CsvInputFormat;
import org.apache.druid.data.input.impl.JsonInputFormat;
import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.error.DruidException;
import org.apache.druid.error.DruidExceptionMatcher;
import org.apache.druid.frame.util.DurableStorageUtils;
Expand Down Expand Up @@ -1272,7 +1273,12 @@ public void testExternGroupBy() throws IOException
GroupByQuery.builder()
.setDataSource(
new ExternalDataSource(
new LocalInputSource(null, null, ImmutableList.of(toRead.getAbsoluteFile())),
new LocalInputSource(
null,
null,
ImmutableList.of(toRead.getAbsoluteFile()),
SystemFields.none()
),
new JsonInputFormat(null, null, null, null, null),
RowSignature.builder()
.add("timestamp", ColumnType.STRING)
Expand Down Expand Up @@ -1362,7 +1368,15 @@ public void testExternSelectWithMultipleWorkers() throws IOException
final ScanQuery expectedQuery =
newScanQueryBuilder().dataSource(
new ExternalDataSource(
new LocalInputSource(null, null, ImmutableList.of(toRead.getAbsoluteFile(), toRead.getAbsoluteFile())),
new LocalInputSource(
null,
null,
ImmutableList.of(
toRead.getAbsoluteFile(),
toRead.getAbsoluteFile()
),
SystemFields.none()
),
new JsonInputFormat(null, null, null, null, null),
RowSignature.builder()
.add("timestamp", ColumnType.STRING)
Expand Down Expand Up @@ -2143,7 +2157,12 @@ public void testSelectRowsGetUntruncatedByDefault() throws IOException
.builder()
.query(newScanQueryBuilder()
.dataSource(new ExternalDataSource(
new LocalInputSource(null, null, Collections.nCopies(numFiles, toRead)),
new LocalInputSource(
null,
null,
Collections.nCopies(numFiles, toRead),
SystemFields.none()
),
new CsvInputFormat(null, null, null, true, 0),
RowSignature.builder().add("timestamp", ColumnType.STRING).build()
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import com.google.common.collect.ImmutableMap;
import org.apache.druid.data.input.impl.JsonInputFormat;
import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.msq.indexing.MSQSpec;
import org.apache.druid.msq.indexing.MSQTuningConfig;
Expand Down Expand Up @@ -85,7 +86,8 @@ public void setUp3() throws IOException
null,
ImmutableList.of(
toRead.getAbsoluteFile()
)
),
SystemFields.none()
),
new JsonInputFormat(null, null, null, null, null),
RowSignature.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import nl.jqno.equalsverifier.EqualsVerifier;
import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.msq.guice.MSQIndexingModule;
import org.apache.druid.msq.input.InputSlice;
import org.apache.druid.segment.TestHelper;
Expand All @@ -44,7 +45,8 @@ public void testSerde() throws Exception
new LocalInputSource(
null,
null,
Collections.singletonList(new File("/nonexistent/file"))
Collections.singletonList(new File("/nonexistent/file")),
SystemFields.none()
)
),
ExternalInputSpecSlicerTest.INPUT_FORMAT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import nl.jqno.equalsverifier.EqualsVerifier;
import org.apache.druid.data.input.impl.LocalInputSource;
import org.apache.druid.data.input.impl.systemfield.SystemFields;
import org.apache.druid.msq.guice.MSQIndexingModule;
import org.apache.druid.msq.input.InputSpec;
import org.apache.druid.segment.TestHelper;
Expand All @@ -43,7 +44,8 @@ public void testSerde() throws Exception
new LocalInputSource(
null,
null,
Collections.singletonList(new File("/nonexistent/file"))
Collections.singletonList(new File("/nonexistent/file")),
SystemFields.none()
),
ExternalInputSpecSlicerTest.INPUT_FORMAT,
ExternalInputSpecSlicerTest.SIGNATURE
Expand Down

0 comments on commit 0f44f6c

Please sign in to comment.