a2l007 commented on a change in pull request #9449:
URL: https://github.com/apache/druid/pull/9449#discussion_r435423848



##########
File path: 
server/src/main/java/org/apache/druid/metadata/input/SqlInputSource.java
##########
@@ -0,0 +1,151 @@
+/*
+ * 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.metadata.input;
+
+import com.fasterxml.jackson.annotation.JacksonInject;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.ObjectMapper;
+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.InputRowSchema;
+import org.apache.druid.data.input.InputSourceReader;
+import org.apache.druid.data.input.InputSplit;
+import org.apache.druid.data.input.SplitHintSpec;
+import org.apache.druid.data.input.impl.InputEntityIteratingReader;
+import org.apache.druid.data.input.impl.SplittableInputSource;
+import org.apache.druid.guice.annotations.Smile;
+import org.apache.druid.metadata.SQLFirehoseDatabaseConnector;
+
+import javax.annotation.Nullable;
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+import java.util.stream.Stream;
+
+public class SqlInputSource extends AbstractInputSource implements 
SplittableInputSource<String>
+{
+  private final List<String> sqls;
+  private final SQLFirehoseDatabaseConnector sqlFirehoseDatabaseConnector;
+  private final ObjectMapper objectMapper;
+  private final boolean foldCase;
+
+  @JsonCreator
+  public SqlInputSource(
+      @JsonProperty("sqls") List<String> sqls,
+      @JsonProperty("foldCase") boolean foldCase,
+      @JsonProperty("database") SQLFirehoseDatabaseConnector 
sqlFirehoseDatabaseConnector,
+      @JacksonInject @Smile ObjectMapper objectMapper

Review comment:
       Smile would be a better option here as it is more compact and would have 
less overhead while the query results are written to file.




----------------------------------------------------------------
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]

Reply via email to