public class DateTruncFunction extends Scalar<java.lang.Long,java.lang.Object>
Modifier and Type | Field and Description |
---|---|
protected static com.google.common.collect.ImmutableMap<org.apache.lucene.util.BytesRef,org.elasticsearch.common.rounding.DateTimeUnit> |
DATE_FIELD_PARSERS |
static java.lang.String |
NAME |
Constructor and Description |
---|
DateTruncFunction(FunctionInfo info) |
DateTruncFunction(FunctionInfo info,
org.elasticsearch.common.rounding.Rounding tzRounding) |
Modifier and Type | Method and Description |
---|---|
Scalar<java.lang.Long,java.lang.Object> |
compile(java.util.List<Symbol> arguments)
Returns a optional compiled version of the scalar implementation.
|
java.lang.Long |
evaluate(Input[] args) |
FunctionInfo |
info() |
protected org.elasticsearch.common.rounding.DateTimeUnit |
intervalAsUnit(org.apache.lucene.util.BytesRef interval) |
Symbol |
normalizeSymbol(Function symbol,
TransactionContext transactionContext)
Normalize a symbol into a simplified form.
|
static void |
register(ScalarFunctionModule module) |
protected org.elasticsearch.common.rounding.Rounding |
rounding(org.apache.lucene.util.BytesRef interval,
org.apache.lucene.util.BytesRef timeZoneString) |
protected java.lang.Long |
truncate(org.elasticsearch.common.rounding.Rounding rounding,
java.lang.Long ts)
Truncates given
timestamp down to the given interval . |
anyNonLiterals, containsNullLiteral
public static final java.lang.String NAME
protected static final com.google.common.collect.ImmutableMap<org.apache.lucene.util.BytesRef,org.elasticsearch.common.rounding.DateTimeUnit> DATE_FIELD_PARSERS
public DateTruncFunction(FunctionInfo info)
public DateTruncFunction(FunctionInfo info, org.elasticsearch.common.rounding.Rounding tzRounding)
public static void register(ScalarFunctionModule module)
public FunctionInfo info()
public Scalar<java.lang.Long,java.lang.Object> compile(java.util.List<Symbol> arguments)
Scalar
public Symbol normalizeSymbol(Function symbol, TransactionContext transactionContext)
FunctionImplementation
normalizeSymbol
in interface FunctionImplementation<Function>
normalizeSymbol
in class Scalar<java.lang.Long,java.lang.Object>
transactionContext
- context which is shared across normalizeSymbol calls during a statement-lifecycle.
This will only be present if normalizeSymbol is called on the handler node.
normalizeSymbol calls during execution won't receive a StmtCtxpublic final java.lang.Long evaluate(Input[] args)
protected org.elasticsearch.common.rounding.Rounding rounding(org.apache.lucene.util.BytesRef interval, org.apache.lucene.util.BytesRef timeZoneString)
protected java.lang.Long truncate(org.elasticsearch.common.rounding.Rounding rounding, java.lang.Long ts)
timestamp
down to the given interval
.
The timestamp
is expected to be in milliseconds.protected org.elasticsearch.common.rounding.DateTimeUnit intervalAsUnit(org.apache.lucene.util.BytesRef interval)