From 0f44f6cd3ee555ce1296b7a543e508cabd276ad4 Mon Sep 17 00:00:00 2001 From: Gian Merlino Date: Sun, 29 Oct 2023 23:07:42 -0700 Subject: [PATCH] Fix various LocalInputSource calls. --- .../apache/druid/msq/exec/MSQArraysTest.java | 3 ++- .../msq/exec/MSQParseExceptionsTest.java | 5 ++-- .../apache/druid/msq/exec/MSQSelectTest.java | 25 ++++++++++++++++--- .../msq/indexing/error/MSQWarningsTest.java | 4 ++- .../external/ExternalInputSliceTest.java | 4 ++- .../input/external/ExternalInputSpecTest.java | 4 ++- 6 files changed, 36 insertions(+), 9 deletions(-) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java index 282dacc115c2..456c74c29bc7 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQArraysTest.java @@ -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; @@ -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 ); diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQParseExceptionsTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQParseExceptionsTest.java index 61a89f0d6fc2..7dd9674e06a6 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQParseExceptionsTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQParseExceptionsTest.java @@ -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; @@ -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) @@ -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() diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java index 441c98b91d8b..2d86f619449b 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/exec/MSQSelectTest.java @@ -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; @@ -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) @@ -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) @@ -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() )) diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/error/MSQWarningsTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/error/MSQWarningsTest.java index 4b1f7df37dea..f21d92ee90fd 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/error/MSQWarningsTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/indexing/error/MSQWarningsTest.java @@ -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; @@ -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() diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSliceTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSliceTest.java index b99eed1ca521..091ae1982cf1 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSliceTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSliceTest.java @@ -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; @@ -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, diff --git a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSpecTest.java b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSpecTest.java index 878e29ecc3aa..2fe00b4be43b 100644 --- a/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSpecTest.java +++ b/extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/external/ExternalInputSpecTest.java @@ -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; @@ -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