DateSplitter (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.mapreduce.lib.db, class: DateSplitter

Package org.apache.hadoop.mapreduce.lib.db

# Class DateSplitter

java.lang.Object
org.apache.hadoop.mapreduce.lib.db.IntegerSplitter
org.apache.hadoop.mapreduce.lib.db.DateSplitter

All Implemented Interfaces:
  `DBSplitter`

Direct Known Subclasses:
  `OracleDateSplitter`

@Public @Evolving public class DateSplitter extends IntegerSplitter
Implement DBSplitter over date/time values. Make use of logic from IntegerSplitter, since date/time are just longs in Java.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DateSplitter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `dateToString(Date d)`
  Given a Date 'd', format it as a string for use in a SQL date comparison operation.
  `List<InputSplit>`
  `split(Configuration conf, ResultSet results, String colName)`
  Given a ResultSet containing one record (and already advanced to that record) with two columns (a low value, and a high value, both of the same type), determine a set of splits that span the given values.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DateSplitter

    public DateSplitter()

- ## Method Details

  - ### split

    public List<InputSplit> split(Configuration conf, ResultSet results, String colName) throws SQLException
    Description copied from interface: `DBSplitter`
    Given a ResultSet containing one record (and already advanced to that record) with two columns (a low value, and a high value, both of the same type), determine a set of splits that span the given values.
    Specified by:
      `split` in interface `DBSplitter`
    Overrides:
      `split` in class `IntegerSplitter`
    Throws:
      `SQLException`

  - ### dateToString

    protected String dateToString(Date d)
    Given a Date 'd', format it as a string for use in a SQL date comparison operation.
    Parameters:
      `d` - the date to format.
    Returns:
      the string representing this date in SQL with any appropriate quotation characters, etc.