a2l007 commented on a change in pull request #10387:
URL: https://github.com/apache/druid/pull/10387#discussion_r487429439
##########
File path: docs/ingestion/native-batch.md
##########
@@ -1368,6 +1368,48 @@ Compared to the other native batch InputSources, SQL
InputSource behaves differe
* Similar to file-based input formats, any updates to existing data will
replace the data in segments specific to the intervals specified in the
`granularitySpec`.
+### Combining Input Source
+
+The Combining input source is used to read data from multiple InputSources.
This input source should be only used if all the delegate input sources are
+ _splittable_ and can be used by the [Parallel task](#parallel-task). This
input source will identify the splits from its delegates and each split will be
processed by a worker task. Similar to other input sources, this input source
supports a single `inputFormat`. Therefore, please note that delegate input
sources requiring an `inputFormat` must have the same format for input data.
Review comment:
Yeah did think about that and it would be definitely be more useful if
we can handle multiple inputFormats as well. For doing this, we might have to
push `inputFormat` to be a part of the `inputSource` config. Since it would
impact other inputSources as well, I thought it would be better to investigate
that separately and have an independent PR for that.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case it would be
useful.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case where it
would be useful.
##########
File path: docs/ingestion/native-batch.md
##########
@@ -1368,6 +1368,48 @@ Compared to the other native batch InputSources, SQL
InputSource behaves differe
* Similar to file-based input formats, any updates to existing data will
replace the data in segments specific to the intervals specified in the
`granularitySpec`.
+### Combining Input Source
+
+The Combining input source is used to read data from multiple InputSources.
This input source should be only used if all the delegate input sources are
+ _splittable_ and can be used by the [Parallel task](#parallel-task). This
input source will identify the splits from its delegates and each split will be
processed by a worker task. Similar to other input sources, this input source
supports a single `inputFormat`. Therefore, please note that delegate input
sources requiring an `inputFormat` must have the same format for input data.
Review comment:
Yeah did think about that and it would be definitely be more useful if
we can handle multiple inputFormats as well. For doing this, we might have to
push `inputFormat` to be a part of the `inputSource` config. Since it would
impact other inputSources as well, I thought it would be better to investigate
that separately and have an independent PR for that.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case it would be
useful.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case where it
would be useful.
##########
File path: docs/ingestion/native-batch.md
##########
@@ -1368,6 +1368,48 @@ Compared to the other native batch InputSources, SQL
InputSource behaves differe
* Similar to file-based input formats, any updates to existing data will
replace the data in segments specific to the intervals specified in the
`granularitySpec`.
+### Combining Input Source
+
+The Combining input source is used to read data from multiple InputSources.
This input source should be only used if all the delegate input sources are
+ _splittable_ and can be used by the [Parallel task](#parallel-task). This
input source will identify the splits from its delegates and each split will be
processed by a worker task. Similar to other input sources, this input source
supports a single `inputFormat`. Therefore, please note that delegate input
sources requiring an `inputFormat` must have the same format for input data.
Review comment:
Yeah did think about that and it would be definitely be more useful if
we can handle multiple inputFormats as well. For doing this, we might have to
push `inputFormat` to be a part of the `inputSource` config. Since it would
impact other inputSources as well, I thought it would be better to investigate
that separately and have an independent PR for that.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case it would be
useful.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case where it
would be useful.
##########
File path: docs/ingestion/native-batch.md
##########
@@ -1368,6 +1368,48 @@ Compared to the other native batch InputSources, SQL
InputSource behaves differe
* Similar to file-based input formats, any updates to existing data will
replace the data in segments specific to the intervals specified in the
`granularitySpec`.
+### Combining Input Source
+
+The Combining input source is used to read data from multiple InputSources.
This input source should be only used if all the delegate input sources are
+ _splittable_ and can be used by the [Parallel task](#parallel-task). This
input source will identify the splits from its delegates and each split will be
processed by a worker task. Similar to other input sources, this input source
supports a single `inputFormat`. Therefore, please note that delegate input
sources requiring an `inputFormat` must have the same format for input data.
Review comment:
Yeah did think about that and it would be definitely be more useful if
we can handle multiple inputFormats as well. For doing this, we might have to
push `inputFormat` to be a part of the `inputSource` config. Since it would
impact other inputSources as well, I thought it would be better to investigate
that separately and have an independent PR for that.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case it would be
useful.
##########
File path:
core/src/main/java/org/apache/druid/data/input/impl/CombiningInputSource.java
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.druid.data.input.impl;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import org.apache.druid.data.input.AbstractInputSource;
+import org.apache.druid.data.input.InputFormat;
+import org.apache.druid.data.input.InputSource;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.java.util.common.Pair;
+
+import javax.annotation.Nullable;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+/**
+ * InputSource that combines data from multiple inputSources. The delegate
inputSources must be splittable.
Review comment:
Since `CombiningInputSource` accepts a list of `SplittableInputSource`
objects, the task would fail anyway at the deserialization phase if a non
splittable input source was used. So I didn't think it would be needed to
override isSplittable(). I can add it if you feel there is a case where it
would be useful.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]