Github user tdas commented on a diff in the pull request:
    --- Diff: 
    @@ -15,40 +15,48 @@
      * limitations under the License.
    -package org.apache.spark.sql.execution.streaming
    +package org.apache.spark.sql.execution.streaming.sources
     import{BufferedReader, InputStreamReader, IOException}
     import java.sql.Timestamp
     import java.text.SimpleDateFormat
    -import java.util.{Calendar, Locale}
    +import java.util.{Calendar, List => JList, Locale, Optional}
     import javax.annotation.concurrent.GuardedBy
    +import scala.collection.JavaConverters._
     import scala.collection.mutable.ListBuffer
     import scala.util.{Failure, Success, Try}
     import org.apache.spark.internal.Logging
     import org.apache.spark.sql._
    -import org.apache.spark.sql.catalyst.InternalRow
    -import org.apache.spark.sql.sources.{DataSourceRegister, 
    +import org.apache.spark.sql.execution.streaming.LongOffset
    +import org.apache.spark.sql.sources.DataSourceRegister
    +import org.apache.spark.sql.sources.v2.{DataSourceOptions, DataSourceV2}
    +import org.apache.spark.sql.sources.v2.reader.{DataReader, 
DataReaderFactory, MicroBatchReadSupport}
    +import org.apache.spark.sql.sources.v2.reader.streaming.{MicroBatchReader, 
     import org.apache.spark.sql.types.{StringType, StructField, StructType, 
    -import org.apache.spark.unsafe.types.UTF8String
    -object TextSocketSource {
    +object TextSocketMicroBatchReader {
       val SCHEMA_REGULAR = StructType(StructField("value", StringType) :: Nil)
       val SCHEMA_TIMESTAMP = StructType(StructField("value", StringType) ::
         StructField("timestamp", TimestampType) :: Nil)
       val DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US)
    - * A source that reads text lines through a TCP socket, designed only for 
tutorials and debugging.
    - * This source will *not* work in production applications due to multiple 
reasons, including no
    - * support for fault recovery and keeping all of the text read in memory 
    + * A MicroBatchReader that reads text lines through a TCP socket, designed 
only for tutorials and
    --- End diff --
    nit: tutorials -> testing (i know it was like that, but lets fix it since 
we are changing it anyway)


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to