OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
com.mapd.tests.DateTimeTest.Encoding Enum Reference
+ Collaboration diagram for com.mapd.tests.DateTimeTest.Encoding:

Public Member Functions

 Encoding (String sqlType, String pattern, ChronoUnit unit, LocalDateTime min, LocalDateTime max)
 
String toSqlColumn (String prefx, LocalDateTime val)
 
String toSql (LocalDateTime d)
 
LocalDateTime clear (LocalDateTime d)
 
LocalDateTime clearForDateAddResult (LocalDateTime d)
 
boolean isValid (LocalDateTime t)
 

Public Attributes

 TIMESTAMP
 
 TIMESTAMP_0
 
 TIMESTAMP_3
 
 TIMESTAMP_6
 
 TIMESTAMP_9
 
 TIMESTAMP_FIXED_32
 
 DATE
 
 DATE_DAYS_16
 
 DATE_DAYS_32
 
DateTimeFormatter formatter
 
String sqlType
 
ChronoUnit toClear
 
LocalDateTime min
 
LocalDateTime max
 

Detailed Description

Definition at line 572 of file DateTimeTest.java.

Constructor & Destructor Documentation

com.mapd.tests.DateTimeTest.Encoding.Encoding ( String  sqlType,
String  pattern,
ChronoUnit  unit,
LocalDateTime  min,
LocalDateTime  max 
)
inline

Definition at line 626 of file DateTimeTest.java.

630  {
631  this.sqlType = sqlType;
632  formatter = DateTimeFormatter.ofPattern(pattern);
633  this.toClear = unit;
634  this.min = min;
635  this.max = max;
636  }

Member Function Documentation

LocalDateTime com.mapd.tests.DateTimeTest.Encoding.clear ( LocalDateTime  d)
inline

Definition at line 647 of file DateTimeTest.java.

647  {
648  if (null != toClear) {
649  d = d.truncatedTo(toClear);
650  }
651 
652  return d;
653  }
LocalDateTime com.mapd.tests.DateTimeTest.Encoding.clearForDateAddResult ( LocalDateTime  d)
inline

Definition at line 655 of file DateTimeTest.java.

655  {
656  if (null != toClear) {
657  if (toClear == ChronoUnit.DAYS) {
658  d = d.truncatedTo(ChronoUnit.SECONDS);
659  } else {
660  d = d.truncatedTo(toClear);
661  }
662  }
663 
664  return d;
665  }
boolean com.mapd.tests.DateTimeTest.Encoding.isValid ( LocalDateTime  t)
inline

Definition at line 667 of file DateTimeTest.java.

667  {
668  return t.isAfter(min) && t.isBefore(max);
669  }
String com.mapd.tests.DateTimeTest.Encoding.toSql ( LocalDateTime  d)
inline

Definition at line 643 of file DateTimeTest.java.

643  {
644  return formatter.format(d);
645  }
String com.mapd.tests.DateTimeTest.Encoding.toSqlColumn ( String  prefx,
LocalDateTime  val 
)
inline

Definition at line 638 of file DateTimeTest.java.

References setup.name.

638  {
639  if (null != val) return prefx + "_" + name() + " /* " + toSql(val) + " */";
640  return prefx + "_" + name();
641  }
string name
Definition: setup.in.py:72

Member Data Documentation

com.mapd.tests.DateTimeTest.Encoding.DATE
Initial value:
=("DATE",
"'DATE' ''yyyy-MM-dd''",
ChronoUnit.DAYS,
LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC).plusDays(-2147483648L),
LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC).plusDays(2147483647L))

Definition at line 603 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.DATE_DAYS_16
Initial value:
=("DATE ENCODING DAYS(16)",
"'DATE' ''yyyy-MM-dd''",
ChronoUnit.DAYS,
LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC)
.plusDays(Short.MIN_VALUE + 1),
LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC).plusDays(Short.MAX_VALUE))

Definition at line 608 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.DATE_DAYS_32
Initial value:
=("DATE ENCODING DAYS(32)",
"'DATE' ''yyyy-MM-dd''",
ChronoUnit.DAYS,
LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC).plusDays(-2147483648L),
LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC).plusDays(2147483647L))

Definition at line 614 of file DateTimeTest.java.

DateTimeFormatter com.mapd.tests.DateTimeTest.Encoding.formatter

Definition at line 620 of file DateTimeTest.java.

LocalDateTime com.mapd.tests.DateTimeTest.Encoding.max

Definition at line 624 of file DateTimeTest.java.

LocalDateTime com.mapd.tests.DateTimeTest.Encoding.min

Definition at line 623 of file DateTimeTest.java.

String com.mapd.tests.DateTimeTest.Encoding.sqlType

Definition at line 621 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.TIMESTAMP
Initial value:
=("TIMESTAMP",
"'TIMESTAMP' ''yyyy-MM-dd HH:mm:ss''",
ChronoUnit.SECONDS,
LocalDateTime.ofEpochSecond(-30610224000L, 0, ZoneOffset.UTC),
LocalDateTime.ofEpochSecond(29379542399L, 0, ZoneOffset.UTC))

Definition at line 573 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.TIMESTAMP_0
Initial value:
=("TIMESTAMP(0)",
"'TIMESTAMP(0)' ''yyyy-MM-dd HH:mm:ss''",
ChronoUnit.SECONDS,
LocalDateTime.ofEpochSecond(-30610224000L, 0, ZoneOffset.UTC),
LocalDateTime.ofEpochSecond(29379542399L, 0, ZoneOffset.UTC))

Definition at line 578 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.TIMESTAMP_3
Initial value:
=("TIMESTAMP(3)",
"'TIMESTAMP(3)' ''yyyy-MM-dd HH:mm:ss.SSS''",
ChronoUnit.MILLIS,
LocalDateTime.ofEpochSecond(-30610224000L, 0, ZoneOffset.UTC),
LocalDateTime.ofEpochSecond(29379542399L, 0, ZoneOffset.UTC))

Definition at line 583 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.TIMESTAMP_6
Initial value:
=("TIMESTAMP(6)",
"'TIMESTAMP(6)' ''yyyy-MM-dd HH:mm:ss.SSSSSS''",
ChronoUnit.MICROS,
LocalDateTime.ofEpochSecond(-30610224000L, 0, ZoneOffset.UTC),
LocalDateTime.ofEpochSecond(29379542399L, 0, ZoneOffset.UTC))

Definition at line 588 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.TIMESTAMP_9
Initial value:
=("TIMESTAMP(9)",
"'TIMESTAMP(9)' ''yyyy-MM-dd HH:mm:ss.SSSSSSSSS''",
ChronoUnit.NANOS,
LocalDateTime.ofEpochSecond(-9223372036L, 0, ZoneOffset.UTC),
LocalDateTime.ofEpochSecond(9223372036L, 0, ZoneOffset.UTC))

Definition at line 593 of file DateTimeTest.java.

com.mapd.tests.DateTimeTest.Encoding.TIMESTAMP_FIXED_32
Initial value:
=("TIMESTAMP ENCODING FIXED(32)",
"'TIMESTAMP' ''yyyy-MM-dd HH:mm:ss''",
ChronoUnit.SECONDS,
LocalDateTime.ofEpochSecond(Integer.MIN_VALUE + 1, 0, ZoneOffset.UTC),
LocalDateTime.ofEpochSecond(Integer.MAX_VALUE, 0, ZoneOffset.UTC))

Definition at line 598 of file DateTimeTest.java.

ChronoUnit com.mapd.tests.DateTimeTest.Encoding.toClear

Definition at line 622 of file DateTimeTest.java.


The documentation for this enum was generated from the following file: