aleofreddi / timel Goto Github PK
View Code? Open in Web Editor NEWA java library to evaluate time-series expressions
License: GNU Lesser General Public License v3.0
A java library to evaluate time-series expressions
License: GNU Lesser General Public License v3.0
Describe the bug
Detect duplicate signatures as soon as they are registered to the function registry.
Actual behavior
FunctionRegistry registry = ...; registry.add(function); registry.add(function);
does not detect the duplicated.
Expected behavior
The code above should throw IllegalArgumentException
on the second add.
Runtime
Any
Additional context
/
Describe the bug
TimEL is not able to parse hexadecimal constants, like 0x1
.
Actual behavior
java.lang.NumberFormatException: For input string: "0x1"
at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at net.vleo.timel.impl.parser.ParserTreeAdapter.visitTerminal(ParserTreeAdapter.java:255)
at net.vleo.timel.impl.parser.ParserTreeAdapter.visitTerminal(ParserTreeAdapter.java:47)
Expected behavior
0x1
(as well 0X1
) is interpreted correctly.
Runtime
Any
Additional context
/
Is your feature request related to a problem? Please describe.
Currently one can't escape characters in a string.
Describe the solution you'd like
The grammar and the parser should be evolved to support
fragment
EscapeSequence
: SimpleEscapeSequence // Standard C-like escapes
| OctalEscapeSequence
| HexadecimalEscapeSequence
| UniversalCharacterName
Describe alternatives you've considered
/
Additional context
/
Describe the bug
uniform
and the current implementation of variables don't play well together.
The problem arises due to the temporally-unbound nature of uniform
, because the result varies semantically (not only by resolution) on the evaluation time frame.
Actual behavior
For the interval 07/06/2019 10:09 PM
β 07/07/2019 12:00 PM
, evaluate the following:
a = extract("DAY_OF_WEEK", "Europe/Rome") == 7 ? uniform(1.0) : uniform(0);
scale(
a,
every(1, "DAY_OF_MONTH", "Europe/Rome")
);
The expected result would be 0.5, actual 0.75! That one is due to the uniform(1.0)
being interpreted differently during the first evaluation and the second one.
Expected behavior
Such inconsistency should not happen, how it is still unclear.
Runtime
Any
Additional context
Maybe forcing uniform
to be time-bounded will do? To be investigated.
Is your feature request related to a problem? Please describe.
TimEL should support true
and false
constants.
Describe the solution you'd like
True and false should be constants so that things like
when(a > 10, 10, b > 5, 5, 1==1, 0)
can be rewritten as
when(a > 10, 10, b > 5, 5, true, 0)
Describe alternatives you've considered
/
Additional context
/
Describe the bug
TimEL lacks unary operator- implementation
Actual behavior
Parsing "-1" leads to:
Parse error: net.vleo.timel.ParseException: Cannot resolve function -(Integer)
Expected behavior
"-1" is parsed correctly
Runtime
/
Additional context
/
Trunc and extract were handy functions available in version 0.2.
These allow better interaction with timestamp values.
Describe the bug
TimEL doesn't support unary operator+ so far.
Actual behavior
Evaluating +1
causes a Parse error at line 1:0: Failed to lookup function +
Expected behavior
Evaluating +1
returns 1.
Runtime
/
Additional context
/
Describe the bug
Compile version(1)
or any other invalid function call that doesn't match a valid signature
Actual behavior
Aug 28 20:54:57 timel-demo java[23887]: java.lang.NullPointerException: null
Aug 28 20:54:57 timel-demo java[23887]: at net.vleo.timel.function.FunctionRegistry.lookup(FunctionRegistry.java:145) ~[timel-core-0.9.3-SNAPSHOT.jar!/:na]
Aug 28 20:54:57 timel-demo java[23887]: at net.vleo.timel.impl.intermediate.SyntaxTreeAdapter.visit(SyntaxTreeAdapter.java:97) ~[timel-core-0.9.3-SNAPSHOT.jar!/:na]
Aug 28 20:54:57 timel-demo java[23887]: at net.vleo.timel.impl.intermediate.SyntaxTreeAdapter.visit(SyntaxTreeAdapter.java:49) ~[timel-core-0.9.3-SNAPSHOT.jar!/:na]
Aug 28 20:54:57 timel-demo java[23887]: at net.vleo.timel.impl.parser.tree.FunctionCall.accept(FunctionCall.java:48) ~[timel-core-0.9.3-SNAPSHOT.jar!/:na]
Aug 28 20:54:57 timel-demo java[23887]: at net.vleo.timel.impl.intermediate.SyntaxTreeAdapter.lambda$visit$1(SyntaxTreeAdapter.java:119) ~[timel-core-0.9.3-SNAPSHOT.jar!/:na]
Aug 28 20:54:57 timel-demo java[23887]: at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[na:1.8.0_151]
Aug 28 20:54:57 timel-demo java[23887]: at java.util.LinkedList$LLSpliterator.forEachRemaining(LinkedList.java:1235) ~[na:1.8.0_151]
Expected behavior
ParseException
should be thrown instead, including the suggested signatures.
Runtime
0.9.3-SNAPSHOT (14e3ae9574c5d66e73f6e51554349219b7761c34)
Additional context
/
Describe the bug
TimEL's grammar supports unicode escape sequences as \uHHHH
and \UHHHHHHHH
to be used in identifiers, but these are not handled correctly.
Actual behavior
Running hello\U0001f602 = 1
defines a variable called hello\U0001f602
Expected behavior
Running hello\U0001f602 = 1
defines a variable called helloπ
Runtime
Any
Additional context
/
Is your feature request related to a problem? Please describe.
TimEL should support long constants via the L suffix
Describe the solution you'd like
Add IntegerSuffix
to the grammar, so that maybe one day one can use it also for other data types (bigdecimals?):
fragment
IntegerConstant
: DecimalConstant IntegerSuffix?
| OctalConstant IntegerSuffix?
| HexadecimalConstant IntegerSuffix?
;
fragment
IntegerSuffix
: LongSuffix
;
fragment
LongSuffix
: [lL]
;
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Currently the last statement should not be semicolon terminated, which is extremely annoying for the users.
Change the behavior so that the last expression can be compiled with a closing semicolon without affecting the semantic
Evaluate the "Pay-per-use scenario" on the web console with a stoptime as 03/05/2020 12:00 AM, leads to 500:
Value 2 for hourOfDay is not supported: Illegal instant due to time zone offset transition (daylight savings time 'gap'): 2019-03-31T02:00:00.000 (Europe/Rome)
To be investigated!
Describe the bug
Many Functions throw RuntimeException
when an evaluation exception happens. These should be migrated to a specific checked exception EvaluationException
.
Actual behavior
Evaluation of every(1, "x", "x")
throws java.lang.RuntimeException: Invalid field specified: x
Expected behavior
Evaluation of every(1, "x", "x")
throws EvaluationException
.
Runtime
Any
Additional context
/
Is your feature request related to a problem? Please describe.
For the sake of compability with the rest of the world, TimEL should be able to understand octal constants.
Describe the solution you'd like
Add octal support:
fragment
IntegerConstant
: OctalConstant
fragment
OctalConstant
: '0' OctalDigit*
;
Describe alternatives you've considered
/
Additional context
/
Describe the bug
Compile (Integer<1>) 1
Actual behavior
Throws a ParseException
wrapped in a RuntimeException
.
Expected behavior
Throws a ParseException
.
Runtime
0.9.3-SNAPSHOT (14e3ae9574c5d66e73f6e51554349219b7761c34)
Additional context
/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.