You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "suryaprasanna (via GitHub)" <gi...@apache.org> on 2023/05/31 20:30:33 UTC

[GitHub] [hudi] suryaprasanna opened a new pull request, #8858: [UBER] Support SqlFileBasedSource for DeltaStreamer

suryaprasanna opened a new pull request, #8858:
URL: https://github.com/apache/hudi/pull/8858

   ### Change Logs
   
   Introducing a new Source type called SqlFileBasedSource which can be used to create complex SQL statements by and caches datasets in-memory and running complex joins on them.
   
   ### Impact
   
   This is a new feature should not impact existing use cases.
   
   ### Risk level (write none, low medium or high below)
   
   None.
   
   ### Documentation Update
   
   Some documentation is added within the classes, but since new configs and source are introduced it requires updates to the 
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Change Logs and Impact were stated clearly
   - [x] Adequate tests were added if applicable
   - [x] CI passed
   


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8858:
URL: https://github.com/apache/hudi/pull/8858#issuecomment-1585991074

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530",
       "triggerID" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "06b637c413d4d3ad002339e9428b733dcc53e04b",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "06b637c413d4d3ad002339e9428b733dcc53e04b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ac360c703518f4f7a468c86e93f08cbcbacf22b4 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530) 
   * 06b637c413d4d3ad002339e9428b733dcc53e04b UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8858:
URL: https://github.com/apache/hudi/pull/8858#issuecomment-1570948967

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530",
       "triggerID" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ac360c703518f4f7a468c86e93f08cbcbacf22b4 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] danny0405 commented on a diff in pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #8858:
URL: https://github.com/apache/hudi/pull/8858#discussion_r1212583636


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/deltastreamer/TestHoodieDeltaStreamer.java:
##########
@@ -2325,7 +2325,7 @@ public void testCsvDFSSourceNoHeaderWithoutSchemaProviderAndWithTransformer() th
   public void testCsvDFSSourceNoHeaderWithSchemaProviderAndTransformer() throws Exception {
     // The CSV files do not have header, the columns are separated by '\t'
     // File schema provider is used, transformer is applied
-    // In this case, the source and target schema come from the Avro schema files
+    // In this case, the source and target schema come from the Avro schema filesTestSqlFileBasedSour
     testCsvDFSSource(false, '\t', true, Collections.singletonList(TripsWithDistanceTransformer.class.getName()));

Review Comment:
   unnecessary change?



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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8858:
URL: https://github.com/apache/hudi/pull/8858#issuecomment-1571101921

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530",
       "triggerID" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ac360c703518f4f7a468c86e93f08cbcbacf22b4 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8858:
URL: https://github.com/apache/hudi/pull/8858#issuecomment-1570939581

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ac360c703518f4f7a468c86e93f08cbcbacf22b4 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8858:
URL: https://github.com/apache/hudi/pull/8858#issuecomment-1586036603

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530",
       "triggerID" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "06b637c413d4d3ad002339e9428b733dcc53e04b",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17739",
       "triggerID" : "06b637c413d4d3ad002339e9428b733dcc53e04b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 06b637c413d4d3ad002339e9428b733dcc53e04b Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17739) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] danny0405 commented on a diff in pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #8858:
URL: https://github.com/apache/hudi/pull/8858#discussion_r1212583839


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/SqlFileBasedSource.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * 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.hudi.utilities.sources;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+import org.apache.hudi.DataSourceUtils;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.hudi.utilities.schema.SchemaProvider;
+
+import org.apache.spark.api.java.JavaSparkContext;
+import org.apache.spark.sql.Dataset;
+import org.apache.spark.sql.Row;
+import org.apache.spark.sql.SparkSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Scanner;
+
+/**
+ * File-based SQL Source that uses SQL queries in a file to read from any table.
+ *
+ * <p>SQL file path should be configured using this hoodie config:
+ *
+ * <p>hoodie.deltastreamer.source.sql.file = 'hdfs://xxx/source.sql'
+ *
+ * <p>File-based SQL Source is used for one time backfill scenarios, this won't update the deltastreamer.checkpoint.key
+ * to the processed commit, instead it will fetch the latest successful checkpoint key and set that value as
+ * this backfill commits checkpoint so that it won't interrupt the regular incremental processing.
+ *
+ * <p>To fetch and use the latest incremental checkpoint, you need to also set this hoodie_conf for deltastremer jobs:
+ *
+ * <p>hoodie.write.meta.key.prefixes = 'deltastreamer.checkpoint.key'
+ */
+public class SqlFileBasedSource extends RowSource {
+
+  private static final Logger LOG = LoggerFactory.getLogger(SqlFileBasedSource.class);
+  private final String sourceSqlFile;
+  private final boolean shouldEmitCheckPoint;
+
+  public SqlFileBasedSource(
+      TypedProperties props,
+      JavaSparkContext sparkContext,
+      SparkSession sparkSession,
+      SchemaProvider schemaProvider) {
+    super(props, sparkContext, sparkSession, schemaProvider);
+    DataSourceUtils.checkRequiredProperties(
+        props, Collections.singletonList(SqlFileBasedSource.Config.SOURCE_SQL_FILE));
+    sourceSqlFile = props.getString(SqlFileBasedSource.Config.SOURCE_SQL_FILE);
+    shouldEmitCheckPoint = props.getBoolean(Config.EMIT_EPOCH_CHECKPOINT, false);
+  }
+
+  @Override
+  protected Pair<Option<Dataset<Row>>, String> fetchNextBatch(
+      Option<String> lastCkptStr, long sourceLimit) {
+    Dataset<Row> rows = null;
+    final FileSystem fs = FSUtils.getFs(sourceSqlFile, sparkContext.hadoopConfiguration(), true);
+    try {
+      final Scanner scanner = new Scanner(fs.open(new Path(sourceSqlFile)));
+      scanner.useDelimiter(";");
+      while (scanner.hasNext()) {
+        String sqlStr = scanner.next().trim();
+        if (!sqlStr.isEmpty()) {
+          LOG.info(sqlStr);
+          // overwrite the same dataset object until the last statement then return.
+          rows = sparkSession.sql(sqlStr);
+        }
+      }
+      return Pair.of(Option.of(rows), shouldEmitCheckPoint ? String.valueOf(System.currentTimeMillis()) : null);
+    } catch (IOException ioe) {
+      throw new HoodieIOException("Error reading source SQL file.", ioe);
+    }
+  }
+
+  /**
+   * Configs supported.
+   */
+  private static class Config {
+    private static final String SOURCE_SQL_FILE = "hoodie.deltastreamer.source.sql.file";
+    private static final String EMIT_EPOCH_CHECKPOINT = "hoodie.deltastreamer.source.sql.checkpoint.emit";

Review Comment:
   Should we make these keys public?



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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] danny0405 merged pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #8858:
URL: https://github.com/apache/hudi/pull/8858


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] hudi-bot commented on pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #8858:
URL: https://github.com/apache/hudi/pull/8858#issuecomment-1585995847

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530",
       "triggerID" : "ac360c703518f4f7a468c86e93f08cbcbacf22b4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "06b637c413d4d3ad002339e9428b733dcc53e04b",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17739",
       "triggerID" : "06b637c413d4d3ad002339e9428b733dcc53e04b",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * ac360c703518f4f7a468c86e93f08cbcbacf22b4 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17530) 
   * 06b637c413d4d3ad002339e9428b733dcc53e04b Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=17739) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [hudi] suryaprasanna commented on a diff in pull request #8858: [HUDI-6301][UBER] Support SqlFileBasedSource for DeltaStreamer

Posted by "suryaprasanna (via GitHub)" <gi...@apache.org>.
suryaprasanna commented on code in PR #8858:
URL: https://github.com/apache/hudi/pull/8858#discussion_r1225685232


##########
hudi-utilities/src/test/java/org/apache/hudi/utilities/deltastreamer/TestHoodieDeltaStreamer.java:
##########
@@ -2325,7 +2325,7 @@ public void testCsvDFSSourceNoHeaderWithoutSchemaProviderAndWithTransformer() th
   public void testCsvDFSSourceNoHeaderWithSchemaProviderAndTransformer() throws Exception {
     // The CSV files do not have header, the columns are separated by '\t'
     // File schema provider is used, transformer is applied
-    // In this case, the source and target schema come from the Avro schema files
+    // In this case, the source and target schema come from the Avro schema filesTestSqlFileBasedSour
     testCsvDFSSource(false, '\t', true, Collections.singletonList(TripsWithDistanceTransformer.class.getName()));

Review Comment:
   Fixed it.



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/SqlFileBasedSource.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * 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.hudi.utilities.sources;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+
+import org.apache.hudi.DataSourceUtils;
+import org.apache.hudi.common.config.TypedProperties;
+import org.apache.hudi.common.fs.FSUtils;
+import org.apache.hudi.common.util.Option;
+import org.apache.hudi.common.util.collection.Pair;
+import org.apache.hudi.exception.HoodieIOException;
+import org.apache.hudi.utilities.schema.SchemaProvider;
+
+import org.apache.spark.api.java.JavaSparkContext;
+import org.apache.spark.sql.Dataset;
+import org.apache.spark.sql.Row;
+import org.apache.spark.sql.SparkSession;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Scanner;
+
+/**
+ * File-based SQL Source that uses SQL queries in a file to read from any table.
+ *
+ * <p>SQL file path should be configured using this hoodie config:
+ *
+ * <p>hoodie.deltastreamer.source.sql.file = 'hdfs://xxx/source.sql'
+ *
+ * <p>File-based SQL Source is used for one time backfill scenarios, this won't update the deltastreamer.checkpoint.key
+ * to the processed commit, instead it will fetch the latest successful checkpoint key and set that value as
+ * this backfill commits checkpoint so that it won't interrupt the regular incremental processing.
+ *
+ * <p>To fetch and use the latest incremental checkpoint, you need to also set this hoodie_conf for deltastremer jobs:
+ *
+ * <p>hoodie.write.meta.key.prefixes = 'deltastreamer.checkpoint.key'
+ */
+public class SqlFileBasedSource extends RowSource {
+
+  private static final Logger LOG = LoggerFactory.getLogger(SqlFileBasedSource.class);
+  private final String sourceSqlFile;
+  private final boolean shouldEmitCheckPoint;
+
+  public SqlFileBasedSource(
+      TypedProperties props,
+      JavaSparkContext sparkContext,
+      SparkSession sparkSession,
+      SchemaProvider schemaProvider) {
+    super(props, sparkContext, sparkSession, schemaProvider);
+    DataSourceUtils.checkRequiredProperties(
+        props, Collections.singletonList(SqlFileBasedSource.Config.SOURCE_SQL_FILE));
+    sourceSqlFile = props.getString(SqlFileBasedSource.Config.SOURCE_SQL_FILE);
+    shouldEmitCheckPoint = props.getBoolean(Config.EMIT_EPOCH_CHECKPOINT, false);
+  }
+
+  @Override
+  protected Pair<Option<Dataset<Row>>, String> fetchNextBatch(
+      Option<String> lastCkptStr, long sourceLimit) {
+    Dataset<Row> rows = null;
+    final FileSystem fs = FSUtils.getFs(sourceSqlFile, sparkContext.hadoopConfiguration(), true);
+    try {
+      final Scanner scanner = new Scanner(fs.open(new Path(sourceSqlFile)));
+      scanner.useDelimiter(";");
+      while (scanner.hasNext()) {
+        String sqlStr = scanner.next().trim();
+        if (!sqlStr.isEmpty()) {
+          LOG.info(sqlStr);
+          // overwrite the same dataset object until the last statement then return.
+          rows = sparkSession.sql(sqlStr);
+        }
+      }
+      return Pair.of(Option.of(rows), shouldEmitCheckPoint ? String.valueOf(System.currentTimeMillis()) : null);
+    } catch (IOException ioe) {
+      throw new HoodieIOException("Error reading source SQL file.", ioe);
+    }
+  }
+
+  /**
+   * Configs supported.
+   */
+  private static class Config {
+    private static final String SOURCE_SQL_FILE = "hoodie.deltastreamer.source.sql.file";
+    private static final String EMIT_EPOCH_CHECKPOINT = "hoodie.deltastreamer.source.sql.checkpoint.emit";

Review Comment:
   Made them public.



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

To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org