public class Calcites extends Object
Modifier and Type | Method and Description |
---|---|
static org.joda.time.DateTime |
calciteDateToJoda(int date,
org.joda.time.DateTimeZone timeZone)
The inverse of
jodaToCalciteDate(DateTime, DateTimeZone) . |
static org.joda.time.DateTime |
calciteTimestampToJoda(long timestamp,
org.joda.time.DateTimeZone timeZone)
The inverse of
jodaToCalciteTimestamp(DateTime, DateTimeZone) . |
static org.apache.calcite.schema.SchemaPlus |
createRootSchema(org.apache.calcite.schema.Schema druidSchema) |
static Charset |
defaultCharset() |
static String |
escapeStringLiteral(String s) |
static ValueType |
getValueTypeForSqlTypeName(org.apache.calcite.sql.type.SqlTypeName sqlTypeName) |
static int |
jodaToCalciteDate(org.joda.time.DateTime dateTime,
org.joda.time.DateTimeZone timeZone)
Calcite expects "DATE" types to be number of days from the epoch to the UTC date matching the local time fields.
|
static long |
jodaToCalciteTimestamp(org.joda.time.DateTime dateTime,
org.joda.time.DateTimeZone timeZone)
Calcite expects "TIMESTAMP" types to be an instant that has the expected local time fields if printed as UTC.
|
static void |
setSystemProperties() |
public static void setSystemProperties()
public static Charset defaultCharset()
public static org.apache.calcite.schema.SchemaPlus createRootSchema(org.apache.calcite.schema.Schema druidSchema)
public static ValueType getValueTypeForSqlTypeName(org.apache.calcite.sql.type.SqlTypeName sqlTypeName)
public static long jodaToCalciteTimestamp(org.joda.time.DateTime dateTime, org.joda.time.DateTimeZone timeZone)
dateTime
- joda timestamptimeZone
- session time zonepublic static int jodaToCalciteDate(org.joda.time.DateTime dateTime, org.joda.time.DateTimeZone timeZone)
dateTime
- joda timestamptimeZone
- session time zonepublic static org.joda.time.DateTime calciteTimestampToJoda(long timestamp, org.joda.time.DateTimeZone timeZone)
jodaToCalciteTimestamp(DateTime, DateTimeZone)
.timestamp
- Calcite style timestamptimeZone
- session time zonepublic static org.joda.time.DateTime calciteDateToJoda(int date, org.joda.time.DateTimeZone timeZone)
jodaToCalciteDate(DateTime, DateTimeZone)
.date
- Calcite style datetimeZone
- session time zoneCopyright © 2011–2017. All rights reserved.